config-map data source¶
Description¶
ConfigMapDataSource reads one ConfigMap without changing it. Missing objects return lookup metadata, empty data maps, and the configured immutable value.
Source: internal/api/core/v1/config_map_dsrc.go:22
Example usage:
imports: {
kubernetes-core-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/core/v1'
}
data-sources: {
example: kubernetes-core-v1.config-map {
# Set input fields here.
}
}
Inputs¶
metadata
object
object({
name: optional(string)
namespace: optional(string)
annotations: optional(map(string))
labels: optional(map(string))
})
Metadata selects only by namespace and name. Namespace defaults to default; name is optional. Annotation and label maps do not select objects.
immutable
optional(boolean)
Immutable does not affect the lookup; it is returned only for missing objects.
Input Constraints¶
Metadata rules
Requirement.
Rule logic
- Require
@core.is-match(input.metadata.name, '^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$')
&& @core.length(input.metadata.name ?? '') <= 253
Requirement.
Rule logic
- For each
input.metadata.labels ?? {}- Require
@core.is-match(@each.key, '^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')
If set, @each.value must match the specified pattern.
Rule logic
- For each
input.metadata.labels ?? {}- Require
@core.is-match(@each.value, '^([A-Za-z0-9]([-A-Za-z0-9_.]{0,61}[A-Za-z0-9])?)?$')
Requirement.
Rule logic
- For each
input.metadata.annotations ?? {}- Require
@core.is-match(@each.key, '^([a-zA-Z0-9İK]([-a-zA-Z0-9İK]*[a-zA-Z0-9İK])?(\\.[a-zA-Z0-9İK]([-a-zA-Z0-9İK]*[a-zA-Z0-9İK])?)*/)?[A-Za-z0-9İK]([-A-Za-z0-9_.İK]*[A-Za-z0-9İK])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')
Outputs¶
metadata
object
object({
name: string
namespace: string
annotations: map(string)
labels: map(string)
generation: integer
resource-version: string
uid: string
})
data
map(string)
binary-data
map(string)
immutable
boolean