-
Notifications
You must be signed in to change notification settings - Fork 27
Fix modernize linter errors #740
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -37,19 +37,23 @@ var CertificateRequestPolicyKind = "CertificateRequestPolicy" | |||
| // makes decisions on whether applicable CertificateRequests should be approved | ||||
| // or denied. | ||||
| type CertificateRequestPolicy struct { | ||||
| metav1.TypeMeta `json:",inline"` | ||||
| metav1.ObjectMeta `json:"metadata,omitempty"` | ||||
| metav1.TypeMeta `json:",inline"` | ||||
| // +optional | ||||
| metav1.ObjectMeta `json:"metadata"` | ||||
|
|
||||
| Spec CertificateRequestPolicySpec `json:"spec,omitempty"` | ||||
| Status CertificateRequestPolicyStatus `json:"status,omitempty"` | ||||
| Spec CertificateRequestPolicySpec `json:"spec"` | ||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The spec probably should not have been optional.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that we should do this, but it's technically a breaking change.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should not be an issue imo, a |
||||
| // +optional | ||||
| Status CertificateRequestPolicyStatus `json:"status,omitzero"` | ||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @erikgb I believe in the marshalled object, it would be cleaner to not have a status field if it is empty.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I agree. |
||||
| } | ||||
|
|
||||
| // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||||
| // CertificateRequestPolicyList is a list of CertificateRequestPolicies. | ||||
| type CertificateRequestPolicyList struct { | ||||
| metav1.TypeMeta `json:",inline"` | ||||
| metav1.ListMeta `json:"metadata,omitempty"` | ||||
| Items []CertificateRequestPolicy `json:"items"` | ||||
| // +optional | ||||
| metav1.ListMeta `json:"metadata"` | ||||
|
|
||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Unintentional change?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is unintentional? the extra newline?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, why?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, thanks, just verifying. I think it is OK. |
||||
| Items []CertificateRequestPolicy `json:"items"` | ||||
| } | ||||
|
|
||||
| // CertificateRequestPolicySpec defines the desired state of | ||||
|
|
||||
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.
In this KEP: https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/2335-vanilla-crd-openapi-subset-structural-schemas#metadata, it looks like the metadata field is not required.
I think it is fine to always have this field in the marshalled resource.