mutating-webhook-configuration resource¶
Source: internal/api/admissionregistration/v1/mutating_webhook_configuration_rsrc.go:21
Example usage:
imports: {
kubernetes-admissionregistration-v1: 'github.com/cloudboss/unobin-library-kubernetes//api/admissionregistration/v1'
}
resources: {
example: kubernetes-admissionregistration-v1.mutating-webhook-configuration {
# Set input fields here.
}
}
Inputs¶
metadata
object
object({
name: optional(string)
generate-name: optional(string)
annotations: optional(map(string))
labels: optional(map(string))
})
webhook
list(object)
list(
object({
name: string
client-config: object({
ca-bundle: optional(string)
service: optional(
object({
name: string
namespace: string
path: optional(string)
port: optional(integer)
})
)
url: optional(string)
})
admission-review-versions: optional(list(string))
failure-policy: optional(string)
match-policy: optional(string)
namespace-selector: optional(
object({
match-labels: optional(map(string))
match-expressions: optional(
list(
object({
key: optional(string)
operator: optional(string)
values: optional(list(string))
})
)
)
})
)
object-selector: optional(
object({
match-labels: optional(map(string))
match-expressions: optional(
list(
object({
key: optional(string)
operator: optional(string)
values: optional(list(string))
})
)
)
})
)
reinvocation-policy: optional(string)
rule: optional(
list(
object({
api-groups: list(string)
api-versions: list(string)
operations: list(string)
resources: list(string)
scope: optional(string)
})
)
)
side-effects: optional(string)
timeout-seconds: optional(integer)
})
)
ignore-annotations
optional(list(string))
ignore-labels
optional(list(string))
Input Constraints¶
Metadata rules
Exactly one of metadata.name or metadata.generate-name.
metadata.name must not be empty.
Rule logic
- When
input.metadata.name != null- Require
@core.length(input.metadata.name) >= 1
metadata.generate-name must not be empty.
Rule logic
- When
input.metadata.generate-name != null- Require
@core.length(input.metadata.generate-name) >= 1
invalid metadata.name.
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
invalid metadata.generate-name.
Rule logic
- Require
@core.is-match(input.metadata.generate-name, '^([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?|([a-z0-9][-a-z0-9]{0,61})?[\\x00-\\x7f]-)$')
invalid metadata.labels key.
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]{0,61}[A-Za-z0-9])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')
invalid metadata.labels value.
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])?)?$')
invalid metadata.annotations key.
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]{0,61}[A-Za-z0-9İK])?$')
&& @core.is-match(@each.key, '^([^/]{1,253}/)?[^/]{1,63}$')
Ignore annotations rules
invalid ignore-annotations expression.
Rule logic
- For each
input.ignore-annotations ?? []- Require
@core.is-format(@each.value, 'regex')
Ignore labels rules
invalid ignore-labels expression.
Rule logic
- For each
input.ignore-labels ?? []- Require
@core.is-format(@each.value, 'regex')
Webhook rules
webhook must contain at least one item.
Rule logic
- Require
@core.length(input.webhook) >= 1
failure-policy must be Fail or Ignore.
Rule logic
- For each
input.webhook- When
@each.value.failure-policy != null- Require
@each.value.failure-policy == 'Fail'
|| @each.value.failure-policy == 'Ignore'
match-policy must be Equivalent or Exact.
Rule logic
- For each
input.webhook- When
@each.value.match-policy != null- Require
@each.value.match-policy == 'Equivalent'
|| @each.value.match-policy == 'Exact'
reinvocation-policy must be Never or IfNeeded.
Rule logic
- For each
input.webhook- When
@each.value.reinvocation-policy != null- Require
@each.value.reinvocation-policy == 'Never'
|| @each.value.reinvocation-policy == 'IfNeeded'
invalid side-effects.
Rule logic
- For each
input.webhook- When
@each.value.side-effects != null- Require
@each.value.side-effects == 'Unknown'
|| @each.value.side-effects == 'None'
|| @each.value.side-effects == 'Some'
|| @each.value.side-effects == 'NoneOnDryRun'
timeout-seconds must be between 1 and 30.
Rule logic
- For each
input.webhook- Require
(@each.value.timeout-seconds == null || @each.value.timeout-seconds >= 1)
&& (@each.value.timeout-seconds == null || @each.value.timeout-seconds <= 30)
rule.api-groups must contain at least one item.
Rule logic
- For each
@webhookininput.webhook
@rulein@webhook.value.rule ?? []- Require
@core.length(@rule.value.api-groups) >= 1
rule.api-versions must contain at least one item.
Rule logic
- For each
@webhookininput.webhook
@rulein@webhook.value.rule ?? []- Require
@core.length(@rule.value.api-versions) >= 1
rule.operations must contain at least one item.
Rule logic
- For each
@webhookininput.webhook
@rulein@webhook.value.rule ?? []- Require
@core.length(@rule.value.operations) >= 1
rule.resources must contain at least one item.
Rule logic
- For each
@webhookininput.webhook
@rulein@webhook.value.rule ?? []- Require
@core.length(@rule.value.resources) >= 1
invalid rule operation.
Rule logic
- For each
@webhookininput.webhook
@rulein@webhook.value.rule ?? []
@operationin@rule.value.operations- Require
@operation.value == '*'
|| @operation.value == 'CREATE'
|| @operation.value == 'UPDATE'
|| @operation.value == 'DELETE'
|| @operation.value == 'CONNECT'
Outputs¶
server
string
api-version
string
kind
string
name
string
uid
string
metadata
object
object({
name: string
generate-name: string
annotations: map(string)
labels: map(string)
})
webhook
list(object)
list(
object({
name: string
client-config: object({
ca-bundle: optional(string)
service: optional(
object({
name: string
namespace: string
path: optional(string)
port: optional(integer)
})
)
url: optional(string)
})
admission-review-versions: list(string)
failure-policy: optional(string)
match-policy: optional(string)
namespace-selector: optional(
object({
match-labels: map(string)
match-expressions: list(
object({
key: string
operator: string
values: list(string)
})
)
})
)
object-selector: optional(
object({
match-labels: map(string)
match-expressions: list(
object({
key: string
operator: string
values: list(string)
})
)
})
)
reinvocation-policy: optional(string)
rule: list(
object({
api-groups: list(string)
api-versions: list(string)
operations: list(string)
resources: list(string)
scope: optional(string)
})
)
side-effects: optional(string)
timeout-seconds: optional(integer)
})
)