-
Notifications
You must be signed in to change notification settings - Fork 460
Open
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.
Description
controller-gen doesn't deduplicate/flatten MinProperties if a struct is embedded in a struct and both have MinProperties set.
Example
// +kubebuilder:validation:MinProperties=1
type MachineHealthCheckTopology struct {
// +optional
Enable *bool `json:"enable,omitempty"`
MachineHealthCheckClass `json:",inline"`
}
// +kubebuilder:validation:MinProperties=1
type MachineHealthCheckClass struct {
UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"`
...
}Resulting CRD YAML:
machineHealthCheck:
allOf:
- minProperties: 1
- minProperties: 1(The resulting CRD YAML is valid and works, would be just better if we would deduplicate like in other cases)
JoelSpeed
Metadata
Metadata
Assignees
Labels
lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.