Repository navigation
✨ Generate embedded ObjectMeta with schemapatch as well - #563
k8s-ci-robot merged 1 commit into
Conversation
|
Welcome @markusthoemmes! |
|
/assign @DirectXMan12 |
| } | ||
|
|
||
| // Fix top level ObjectMeta regardless of the settings. | ||
| if _, ok := fullSchema.Properties["metadata"]; ok { |
There was a problem hiding this comment.
this doesn't seem quite right, because top-level metadata is actually allowed to contain a couple validations, and this is one of the things schemapatch enables.
There was a problem hiding this comment.
Interesting, I basically copied the approach over from the crd generator, where this exact change is done unconditionally as well 🤔.
See
controller-tools/pkg/crd/gen.go
Lines 137 to 138 in 97ee66c
and
controller-tools/pkg/crd/gen.go
Lines 281 to 290 in 97ee66c
Could you elaborate on why this should be different in schemapatch?
There was a problem hiding this comment.
oh hmm this might've been me reviewing too fast. My thought was that maybe people had put in place custom validation, but schemapatch is gonna overwrite that anyway. nevermind :-)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, markusthoemmes The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Quite similar to #557, this applies the very same options now available on the CRD generator to be available on the
schemapatchcommand. Since this option only really affects the generation of the schema anyway, it seems like it should be available on both equally.