Skip to content

Commit 53670f3

Browse files
authored
Clarify pruning of defaults
1 parent 2d93692 commit 53670f3

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)