diff --git a/hack/golangci-hints.yaml b/hack/golangci-hints.yaml index fdd8a2f59c3..868f5d029c5 100644 --- a/hack/golangci-hints.yaml +++ b/hack/golangci-hints.yaml @@ -144,7 +144,6 @@ linters: - text: "Conditions field in AllocatedDeviceStatus has incorrect tags, should be: `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,5,rep,name=conditions\"`" path: "staging/src/k8s.io/api/resource/" - # Pre-existing issues from the conflictmarkers linter # The Error field in some older API types is marked as both optional and required. # This is incorrect, but cannot be changed without breaking changes. @@ -156,6 +155,14 @@ linters: path: "staging/src/k8s.io/api/networking/v1/types.go" - text: "field IngressPortStatus.Error has conflicting markers: optional_vs_required: {\\[optional\\], \\[kubebuilder:validation:Required\\]}. fields cannot be both optional and required" path: "staging/src/k8s.io/api/networking/v1beta1/types.go" + + # Duplicate markers seems to flag markdown table as duplicate entries + - text: "duplicatemarkers: MaxSkew has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" + - text: "duplicatemarkers: WhenUnsatisfiable has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" + - text: "duplicatemarkers: MinDomains has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" default: standard enable: # please keep this alphabetized @@ -321,6 +328,7 @@ linters: # - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`. - "ssatags" # Ensure lists have a listType tag. # - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions. + - "duplicatemarkers" #Prevent identical markers from being present on types and fields lintersConfig: conditions: isFirstField: Ignore diff --git a/hack/golangci.yaml b/hack/golangci.yaml index 86b0a6fba0e..833b11be5be 100644 --- a/hack/golangci.yaml +++ b/hack/golangci.yaml @@ -155,7 +155,6 @@ linters: - text: "Conditions field in AllocatedDeviceStatus has incorrect tags, should be: `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,5,rep,name=conditions\"`" path: "staging/src/k8s.io/api/resource/" - # Pre-existing issues from the conflictmarkers linter # The Error field in some older API types is marked as both optional and required. # This is incorrect, but cannot be changed without breaking changes. @@ -167,6 +166,14 @@ linters: path: "staging/src/k8s.io/api/networking/v1/types.go" - text: "field IngressPortStatus.Error has conflicting markers: optional_vs_required: {\\[optional\\], \\[kubebuilder:validation:Required\\]}. fields cannot be both optional and required" path: "staging/src/k8s.io/api/networking/v1beta1/types.go" + + # Duplicate markers seems to flag markdown table as duplicate entries + - text: "duplicatemarkers: MaxSkew has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" + - text: "duplicatemarkers: WhenUnsatisfiable has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" + - text: "duplicatemarkers: MinDomains has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" default: none enable: # please keep this alphabetized @@ -330,6 +337,7 @@ linters: # - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`. - "ssatags" # Ensure lists have a listType tag. # - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions. + - "duplicatemarkers" #Prevent identical markers from being present on types and fields lintersConfig: conditions: isFirstField: Ignore diff --git a/hack/kube-api-linter/exceptions.yaml b/hack/kube-api-linter/exceptions.yaml index eb371c76bd1..52dbaa65557 100644 --- a/hack/kube-api-linter/exceptions.yaml +++ b/hack/kube-api-linter/exceptions.yaml @@ -20,7 +20,6 @@ - text: "Conditions field in AllocatedDeviceStatus has incorrect tags, should be: `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,5,rep,name=conditions\"`" path: "staging/src/k8s.io/api/resource/" - # Pre-existing issues from the conflictmarkers linter # The Error field in some older API types is marked as both optional and required. # This is incorrect, but cannot be changed without breaking changes. @@ -31,4 +30,12 @@ - text: "field IngressPortStatus.Error has conflicting markers: optional_vs_required: {\\[optional\\], \\[kubebuilder:validation:Required\\]}. fields cannot be both optional and required" path: "staging/src/k8s.io/api/networking/v1/types.go" - text: "field IngressPortStatus.Error has conflicting markers: optional_vs_required: {\\[optional\\], \\[kubebuilder:validation:Required\\]}. fields cannot be both optional and required" - path: "staging/src/k8s.io/api/networking/v1beta1/types.go" \ No newline at end of file + path: "staging/src/k8s.io/api/networking/v1beta1/types.go" + +# Duplicate markers seems to flag markdown table as duplicate entries +- text: "duplicatemarkers: MaxSkew has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" +- text: "duplicatemarkers: WhenUnsatisfiable has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" +- text: "duplicatemarkers: MinDomains has duplicated markers -------+-------+-------+" + path: "staging/src/k8s.io/api/core/v1/" diff --git a/hack/kube-api-linter/kube-api-linter.yaml b/hack/kube-api-linter/kube-api-linter.yaml index ea29a651e5b..f9da4914c61 100644 --- a/hack/kube-api-linter/kube-api-linter.yaml +++ b/hack/kube-api-linter/kube-api-linter.yaml @@ -19,6 +19,7 @@ linters: # - "requiredfields" # Required fields should only be pointers when required based on the validity of the zero value, they should always have `omitempty`. - "ssatags" # Ensure lists have a listType tag. # - "uniquemarkers" # Ensure markers are not duplicated across field and type definitions. + - "duplicatemarkers" #Prevent identical markers from being present on types and fields lintersConfig: conditions: isFirstField: Ignore diff --git a/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go b/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go index ef7c41961ae..c7259d3d3e9 100644 --- a/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go +++ b/staging/src/k8s.io/api/admissionregistration/v1beta1/types.go @@ -88,7 +88,6 @@ const ( SideEffectClassNoneOnDryRun SideEffectClass = "NoneOnDryRun" ) -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object