Skip to content

Commit 72076b9

Browse files
authored
Merge pull request #50246 from porridge/patch-1
Clarify pruning of defaults
2 parents 2d93692 + 53670f3 commit 72076b9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

content/en/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,9 @@ Defaulting happens on the object
14661466
Defaults applied when reading data from etcd are not automatically written back to etcd.
14671467
An update request via the API is required to persist those defaults back into etcd.
14681468

1469-
Default values must be pruned (with the exception of defaults for `metadata` fields) and must
1470-
validate against a provided schema.
1469+
Default values for non-leaf fields must be pruned (with the exception of defaults for `metadata` fields) and must
1470+
validate against a provided schema. For example in the above example, a default of `{"replicas": "foo", "badger": 1}`
1471+
for the `spec` field would be invalid, because `badger` is an unknown field, and `replicas` is not a string.
14711472

14721473
Default values for `metadata` fields of `x-kubernetes-embedded-resources: true` nodes (or parts of
14731474
a default value covering `metadata`) are not pruned during CustomResourceDefinition creation, but

0 commit comments

Comments
 (0)