// +kubebuilder:pruning:PreserveUnknownFields on array field #2178
-
Struct definition: type Status struct {
// +kubebuilder:pruning:PreserveUnknownFields
Deployed []unstructured.Unstructured `json:"deployed,omitempty"`
} Generated: deployed:
items:
type: object
type: array
x-kubernetes-preserve-unknown-fields: true Expect: deployed:
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array Is there a way to generate |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
As of controller-tools v0.2.0, all markers apply to the field itself, not items. The current best way to get it to apply to an item instead is something like this: // +kubebuilder:pruning:PreserveUnknownFields
type MyItem unstructured.Unstructured
type Status struct {
Deployed []MyItem
} All that being said: |
Beta Was this translation helpful? Give feedback.
-
It is sorted out with the latest version of controller-gen v0.10 |
Beta Was this translation helpful? Give feedback.
-
Closing since it is answered. |
Beta Was this translation helpful? Give feedback.
As of controller-tools v0.2.0, all markers apply to the field itself, not items. The current best way to get it to apply to an item instead is something like this:
All that being said:
unstructured.Unstructured
should havePreserveUnknownFields
on by default, please file a bug about that :-)