/
githubmirror
/
kubernetes
Обзор
Документация
Войти
/
githubmirror
/
kubernetes
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
hack/kube-api-linter/exceptions.yaml
153 строки
13 KB
kubernetes-prow[bot]
Merge pull request #140009 from pravk03/native-dra-alpha2
23 июл 2026, 10:07
Не верифицирован
23 июл 2026, 10:07
af7eeeb
Код
Авторство
О чём код?
# Exceptions for kube-api-linter. # Exceptions are used for kube-api-linter to ignore existing issues that cannot be fixed without breaking changes. # Pre-existing issues from the conditions linter # Conditions generally should be a metav1.Condition, and should not use custom condition types. - text: "Conditions field in StorageVersionStatus|StatefulSetStatus|DeploymentStatus|DaemonSetStatus|ReplicaSetStatus|HorizontalPodAutoscalerStatus|JobStatus|CertificateSigningRequestStatus|PersistentVolumeClaimStatus|ReplicationControllerStatus|ServiceStatus|NodeStatus|NamespaceStatus|ComponentStatus|PodStatus|FlowSchemaStatus|PriorityLevelConfigurationStatus|FlowSchemaStatus|PriorityLevelConfigurationStatus|PodDisruptionBudgetStatus|AllocatedDeviceStatus|Endpoint|StatefulSetStatus|DeploymentStatus|DaemonSetStatus|ReplicaSetStatus|HorizontalPodAutoscalerStatus|JobStatus|CertificateSigningRequestStatus|PersistentVolumeClaimStatus|ReplicationControllerStatus|ServiceStatus|NodeStatus|NamespaceStatus|ComponentStatus|PodStatus|FlowSchemaStatus|PriorityLevelConfigurationStatus|FlowSchemaStatus|PriorityLevelConfigurationStatus|PodDisruptionBudgetStatus|AllocatedDeviceStatus|Endpoint|StorageVersionMigrationStatus must be a slice of metav1.Condition" path: "staging/src/k8s.io/api/" # Conditions should have patch strategy markers, but changing these after shipping a client is a breaking change. # Clients would treat these as atomic, when the patch strategy should be merge. - text: "Conditions field in ValidatingAdmissionPolicyStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type" path: "staging/src/k8s.io/api/admissionregistration/" - text: "Conditions field in ValidatingAdmissionPolicyStatus has incorrect tags, should be: `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,3,rep,name=conditions\"`" path: "staging/src/k8s.io/api/admissionregistration/" - text: "Conditions field in PodDisruptionBudgetStatus has incorrect tags, should be: `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`" path: "staging/src/k8s.io/api/policy/" - text: "Conditions field in AllocatedDeviceStatus is missing the following markers: patchStrategy=merge, patchMergeKey=type" path: "staging/src/k8s.io/api/resource/" - 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/" # Commentstart - Ignore commentstart issues for existing API group # TODO: For each existing API group, we aim to remove it over time. - text: "godoc for field .* should start with '.* ...'" path: "staging/src/k8s.io/api/(apps|batch|certificates|core|extensions|flowcontrol|resource|storagemigration)" # notimestamp: Legacy 'Timestamp' fields retained for backward compatibility - text: 'notimestamp: naming convention "notimestamp": field TokenRequestStatus.ExpirationTimestamp: prefer use of the term ''time'' over ''timestamp''' path: "staging/src/k8s.io/api/authentication/v1/types.go" - text: 'notimestamp: naming convention "notimestamp": field (PodLogOptions.Timestamps|Event.FirstTimestamp|Event.LastTimestamp): prefer use of the term ''time'' over ''timestamp''' path: "staging/src/k8s.io/api/core/v1/types.go" - text: 'notimestamp: naming convention "notimestamp": field Event.Deprecated(FirstTimestamp|LastTimestamp): prefer use of the term ''time'' over ''timestamp''' path: "staging/src/k8s.io/api/events/(v1|v1beta1)/types.go" - text: 'notimestamp: naming convention "notimestamp": field AllocationResult.AllocationTimestamp: prefer use of the term ''time'' over ''timestamp''' path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go" # optionalfields - Ignore optionalfields issues for existing API group # TODO: For each existing API group, we aim to remove it over time. - text: "optionalfields: field .* should (?:be a pointer|have the omitempty tag)\\." path: "staging/src/k8s.io/api/(admission|admissionregistration|apidiscovery|apps|authentication|authorization|autoscaling|batch|certificates|coordination|core|discovery|events|extensions|flowcontrol|imagepolicy|networking|node|policy|rbac|resource|scheduling|storage|storagemigration)" # optionalfields - Ignore existing issues for apiserverinternal API group - text: "optionalfields: field StorageVersionCondition.(ObservedGeneration|LastTransitionTime) should be a pointer." path: "staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go" - text: "optionalfields: field StorageVersion.(Spec|Status) should (?:be a pointer|have the omitempty tag)\\." path: "staging/src/k8s.io/api/apiserverinternal/v1alpha1/types.go" # 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. - text: "field PortStatus.Error has conflicting markers: optional_vs_required: {\\[optional\\], \\[kubebuilder:validation:Required\\]}. fields cannot be both optional and required" path: "staging/src/k8s.io/api/core/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/extensions/v1beta1/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/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" # The following exceptions are for fields in stable or deprecated APIs that cannot be # changed due to backward compatibility constraints. Each rule is scoped to the # specific field to avoid hiding new violations. ## For the "Extra" field, which is common across several auth-related APIs. - text: "field UserInfo.Extra should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/authentication/(v1|v1beta1)/types.go" - text: "field SubjectAccessReviewSpec.Extra should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/authorization/(v1|v1beta1)/types.go" - text: "field CertificateSigningRequestSpec.Extra should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/certificates/(v1|v1beta1)/types.go" ## For ResourceList fields in the core API. - text: "field (PersistentVolumeSpec.Capacity|ContainerStatus.AllocatedResources|PodSpec.Overhead|ResourceQuotaSpec.Hard) type ResourceList should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" - text: "field (ResourceRequirements|VolumeResourceRequirements).(Limits|Requests) type ResourceList should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" - text: "field LimitRangeItem.(Max|Min|Default|DefaultRequest|MaxLimitRequestRatio) type ResourceList should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" - text: "field ResourceQuotaStatus.(Hard|Used) type ResourceList should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" - text: "type ResourceList should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" ## For the Secret.Data and ConfigMap.BinaryData fields in the core API. - text: "field (Secret.Data|ConfigMap.BinaryData) should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/core/v1/types.go" ## For map fields in the resource API (across all versions). - text: "field (CounterSet|CounterSetStatus|DeviceCounterConsumption).Counters should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/(v1|v1alpha3|v1beta1|v1beta2)/types.go" - text: "field BasicDevice.(Attributes|Capacity) should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/v1beta1/types.go" - text: "field Device.(Attributes|Capacity) should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/(v1|v1beta2)/types.go" - text: "field (CapacityRequirements.Requests|DeviceRequestAllocationResult.ConsumedCapacity) should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/(v1|v1beta1|v1beta2)/types.go" - text: "nomaps: field Device.NodeAllocatableResources should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/(v1|v1beta2)/types.go" - text: "nomaps: field BasicDevice.NodeAllocatableResources should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/resource/v1beta1/types.go" - text: "nomaps: field TokenRequestSpec.Attestations should not use a map type, use a list type with a unique name/identifier instead" path: "staging/src/k8s.io/api/authentication/v1/types.go" # OptionalOrRequired is being enabled over time. For now, each API group should be added to this list until we comb through each group and fix the missing tags. # The nonpointerstructs linter is included here as well as these two should be enabled hand-in-hand on each API group. - text: "must be marked as optional or required|is a non-pointer struct with no required fields." path: "staging/src/k8s.io/api/(admissionregistration|authorization|autoscaling|batch|certificates|core|discovery|events|extensions|networking|storage)" # OptionalOrRequired - Existing fields that are marked as both optional and required (based on standard optional vs kubebuilder:validation:Required) and should not be fixed. - text: "field (PortStatus|IngressPortStatus)\\.Error must not be marked as both optional and required" path: "staging/src/k8s.io/api/(core/v1|extensions/v1beta1|networking/(v1|v1beta1))" # jsontags: 'Port' must be capitalized for backward compatibility - text: 'jsontags: field DaemonEndpoint.Port json tag does not match' path: "staging/src/k8s.io/api/core/v1/types.go" # NonPointerStructs - Existing fields that are non-pointer structs but where the current rules are incorrect. # The (PodGroupSpec|PodGroupTemplate|CompositePodGroupSpec|CompositePodGroupTemplate).SchedulingPolicy field is a union type, but nonpointerstructs does not understand unions today. # Validation makes this require at least one of the fields within to be set. - text: "nonpointerstructs: field (PodGroupSpec|PodGroupTemplate|CompositePodGroupSpec|CompositePodGroupTemplate)\\.SchedulingPolicy is a non-pointer struct with no required fields\\..*" path: "staging/src/k8s.io/api/scheduling/(v1alpha3|v1beta1)/types\\.go" # Workload.Spec no longer has any strictly required fields due to the introduction of the # CompositePodGroup API. The template fields have been refactored into a union where either # podGroupTemplates or compositePodGroupTemplates must be provided (enforced via validation). - text: "nonpointerstructs: field Workload\\.Spec is a non-pointer struct with no required fields\\..*" path: "staging/src/k8s.io/api/scheduling/(v1alpha3|v1beta1)/types\\.go" # WorkloadSpec.CompositePodGroupTemplates is a union member that is conditionally optional (+k8s:ifEnabled("CompositePodGroup")=+k8s:optional), but the linter requires a static +k8s:optional tag. - text: "dependenttags: field WorkloadSpec\\.CompositePodGroupTemplates with marker \\+k8s:unionMember is missing required marker.*" path: "staging/src/k8s.io/api/scheduling/(v1alpha3|v1beta1)/types\\.go" # NoReferences - Existing fields that use Reference/References suffixes instead of Ref/Refs. # These fields use the Reference suffix, but renaming them would be a breaking change, so they are allowlisted. - text: 'noreferences: naming convention "reference-to-ref": field (SerializedReference|ImageVolumeSource)\.Reference:' path: "staging/src/k8s.io/api/core/v1/types.go" # The EvictionRequest.Spec.Target and Eviction.Spec.Target fields are of a union type and nonpointerstructs does not understand unions today. # Validation makes this require at least one of the fields within to be set. - text: "nonpointerstructs: field EvictionRequestSpec.Target is a non-pointer struct with no required fields." path: "staging/src/k8s.io/api/lifecycle/v1alpha1/types.go" - text: "nonpointerstructs: field EvictionSpec.Target is a non-pointer struct with no required fields." path: "staging/src/k8s.io/api/lifecycle/v1alpha1/types.go" # Status is conventionally a non-pointer. - text: "optionalfields: field EvictionRequest.Status should be a pointer." path: "staging/src/k8s.io/api/lifecycle/v1alpha1/types.go" - text: "optionalfields: field Eviction.Status should be a pointer." path: "staging/src/k8s.io/api/lifecycle/v1alpha1/types.go"