Documentation ¶
Index ¶
- func DeleteNamespaceID(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ...) error
- func GetNamespaceID(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ...) (string, error)
- func SetNamespaceID(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteNamespaceID ¶
func DeleteNamespaceID(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ctx context.Context, 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(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ctx context.Context, 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(namespaceIDConfigMapNN types.NamespacedName, kubeClient client.Client, ctx context.Context, 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.