cluster

package
v1.116.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNamespaceID

func DeleteNamespaceID(ctx context.Context, namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, namespace string) error

Delete the namespace and its ID from configMap. This prevents us from hitting config map size limit. (The data stored in a ConfigMap cannot exceed 1 MiB.)

func GetNamespaceID

func GetNamespaceID(ctx context.Context, namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, namespace string) (string, error)

Get an identifier for the given namespace name.

The first time GetNamespaceID(...) is called, an ID is generated and persisted to the APIServer in a ConfigMap. The xid library is used to generate an ID that is unique across all KCC installations and namespaces.

func SetNamespaceID

func SetNamespaceID(ctx context.Context, namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, namespace, uniqueID string) error

Set the namespace ID value. This is useful for scenarios where ID uniqueness is not desired, for example, while running integration tests, we use a single project in which to run all the tests. Each of the tests runs in a different namespace. If each namespace has a unique id then resource contention prevention will only allow a single test to succeed at a time. To enable parallel testing, we have all tests running against the main test project use the same ID for their namespace.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL