-
Notifications
You must be signed in to change notification settings - Fork 1.4k
⚠️ Change User.PasswdFrom from *PasswdSource to PasswdSource + add omitzero, extend SSA patch helper to handle arrays #12560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/assign @JoelSpeed @fabriziopandini |
/hold |
/test pull-cluster-api-e2e-main-gke |
.golangci-kal.yml
Outdated
@@ -211,6 +211,10 @@ linters: | |||
- kubeapilinter | |||
|
|||
# TODO: Excludes that should be removed once https://github.com/kubernetes-sigs/kube-api-linter/issues/132 will be fixed | |||
- path: "api/.*" | |||
text: "optionalfields: field (.*) is optional and (should have the omitempty tag|should be a pointer)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This disables the whole linter practically?
Are we on the latest KAL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KAL main had some other issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With KAL main I'm getting these:
api/core/v1beta2/clusterclass_types.go:285:2: optionalfields: field TemplateRef is optional and should have the omitempty tag (kubeapilinter)
TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"`
^
api/core/v1beta2/clusterclass_types.go:564:2: optionalfields: field TemplateRef is optional and should have the omitempty tag (kubeapilinter)
TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"`
^
api/core/v1beta2/clusterclass_types.go:1020:2: optionalfields: field XMetadata is optional and should have the omitempty tag (kubeapilinter)
XMetadata VariableSchemaMetadata `json:"x-metadata,omitempty,omitzero"`
^
api/core/v1beta2/machine_types.go:522:2: optionalfields: field NodeRef is optional and should have the omitempty tag (kubeapilinter)
NodeRef MachineNodeReference `json:"nodeRef,omitempty,omitzero"`
^
api/core/v1beta2/machine_types.go:714:2: optionalfields: field ConfigRef is optional and should have the omitempty tag (kubeapilinter)
ConfigRef ContractVersionedObjectReference `json:"configRef,omitempty,omitzero"`
^
api/core/v1beta2/machinehealthcheck_types.go:131:2: optionalfields: field TemplateRef is optional and should have the omitempty tag (kubeapilinter)
TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"`
^
api/runtime/v1beta2/extensionconfig_types.go:77:2: optionalfields: field Service is optional and should have the omitempty tag (kubeapilinter)
Service ServiceReference `json:"service,omitempty,omitzero"`
^
... (34x overall, basically all fixed fields)
I dont' remember if KAL v0.0.0-20250723124831-1b29e82a0f55
produces the exact same findings, the exclude captures both.
WIth your required-field branch these false positives go away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm also these I think (but I think that was with the version currently on this branch)
api/runtime/v1beta2/extensionconfig_types.go:77:2: optionalfields: field Service is optional and has a valid zero value ({}), but the validation is not complete (e.g. min properties/adding required fields). The field should be a pointer to allow the zero value to be set. If the zero value is not a valid use case, complete the validation and remove the pointer. (kubeapilinter)
Service ServiceReference `json:"service,omitempty,omitzero"`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll open a WIP PR tomorrow with cleaned up excludes with your required fields branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This diff is now gone from this PR after rebase)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR with clean excludes based on your required-fields-v2 branch: #12563
lgtm pending rebase |
…ero, extend SSA patch helper to handle arrays
14224ca
to
aad7f3c
Compare
/test pull-cluster-api-e2e-main-gke |
@sbueringer: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
LGTM label has been added. Git tree hash: 7ba6868490c8f0f7c4523c1aec86d5ae6fc4bd83
|
/hold cancel |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of #10852