@@ -12,13 +12,18 @@ impl ApplyResource for CustomResourceDefinition {
1212 // If it does not exist, then simple apply.
1313 //
1414 // 2. If the CRD already exists, then get it, and check...
15- // - spec.conversion (this is likely to change, which is fine)
16- // - spec.group (this should probably never change)
17- // - spec.names (it is ok to add names, probably not great to remove them)
18- // - spec.preserve_unknown_fields (is this ok to change?)
19- // - spec.scope (this should probably never change)
15+ // - spec.conversion (this will often change, which is fine (e.g. caBundle rotation))
16+ // - spec.group (this should never change)
17+ // - spec.names (it is ok to add names, probably not great to remove them, but legit as
18+ // we can only keep a limited number because of CR size limitations)
19+ // - spec.preserve_unknown_fields (we can be opinionated and reject Some(false)
20+ // (and accept None and Some(true)). This is because the field is deprecated in favor
21+ // of setting x-preserve-unknown-fields to true in spec.versions\[*\].schema.openAPIV3Schema.
22+ // See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning
23+ // for details.
24+ // - spec.scope (this should never change)
2025 //
21- // 3. For spec.versions, where "A" is the sert of versions applied to the server ,
26+ // 3. For spec.versions, where "A" is the set of versions currently defined on the stored CRD ,
2227 // and "B" is the set of versions to be applied...
2328 // - A - B: These versions are candidates for removal
2429 // - B - A: These versions can be safely appended
0 commit comments