Creates a Config.
Input Kubernetes objects. If supplied multiple objects with the same kubernetesKey discards all but the last one. Does not preserve insertion order of the given objects.
Kubernetes object used to parameterize the function's behavior.
For testing only: List of Results returned by the function.
Determines whether addResults should also log to stderr.
Adds given result(s) representing structured findings by the function.
Returns a deep copy of Configs.
Deletes all objects with the same kubernetesKey as any of the given objects.
Does not throw if given duplicates or keys which are not present in the Configs.
The objects to delete.
Deletes all objects.
Returns an array of objects matching the given Kind type predicate.
Casts to an array of Kind. May throw if isKind is incorrect.
The ordering of objects is deterministic.
Returned objects are pass-by-reference; mutating them results in changes being persisted.
is a type predicate on the desired type.
Returns an array of all the objects in this Configs.
The ordering of objects is deterministic.
Returned objects are pass-by-reference; mutating them results in changes being persisted.
Returns the functionConfig if defined.
Returns the map of data values if functionConfig is of kind ConfigMap.
Throws a FunctionConfigError if functionConfig is undefined OR if the kind is not a v1/ConfigMap.
Returns the value for the given key if functionConfig is of kind ConfigMap.
Throws a FunctionConfigError if functionConfig kind is not a ConfigMap.
Returns undefined if functionConfig is undefined OR if the ConfigMap has no such key in the 'data' section.
Similar to getFunctionConfigValue except it throws a ConfigError if the given key is undefined.
Get result(s) representing structured findings by the function.
Partitions the objects using the provided key function
The ordering of objects with the same key is deterministic.
Example: Partition configs by Namespace:
const configsByNamespace = configs.groupBy((o) => o.metadata.namespace)
Generates a key for each Value.
Detects if an unknown value has been provided to the config map
The set of keys expected in the Configs data
Returns undefined if the config map is undefined. Otherwise returns a string[] containing the invalid keys. The string[] will be empty if all of the config maps keys are members of the expecteKeys.
Inserts objects into the Configs.
If another object already in Configs has the same kubernetesKey, replaces that one with the given object.
If inserting multiple objects with the same kubernetesKey, discards all but the last one.
Does not preserve insertion order of the given objects.
The objects to insert.
Returns the ResourceList representation of this Configs object.
Generated using TypeDoc
Configs is an in-memory document store for Kubernetes objects populated from/to configuration files.
It enables performing rich query and mutation operations.