Add structType=atomic to all selectors

This commit is contained in:
Joe Betz 2021-03-10 20:51:56 -08:00 committed by Jefftree
parent b0abe89ae2
commit 1f2a82f530
3 changed files with 11 additions and 0 deletions

View File

@ -1948,6 +1948,7 @@ type EnvVarSource struct {
} }
// ObjectFieldSelector selects an APIVersioned field of an object. // ObjectFieldSelector selects an APIVersioned field of an object.
// +structType=atomic
type ObjectFieldSelector struct { type ObjectFieldSelector struct {
// Version of the schema the FieldPath is written in terms of, defaults to "v1". // Version of the schema the FieldPath is written in terms of, defaults to "v1".
// +optional // +optional
@ -1957,6 +1958,7 @@ type ObjectFieldSelector struct {
} }
// ResourceFieldSelector represents container resources (cpu, memory) and their output format // ResourceFieldSelector represents container resources (cpu, memory) and their output format
// +structType=atomic
type ResourceFieldSelector struct { type ResourceFieldSelector struct {
// Container name: required for volumes, optional for env vars // Container name: required for volumes, optional for env vars
// +optional // +optional
@ -1969,6 +1971,7 @@ type ResourceFieldSelector struct {
} }
// Selects a key from a ConfigMap. // Selects a key from a ConfigMap.
// +structType=atomic
type ConfigMapKeySelector struct { type ConfigMapKeySelector struct {
// The ConfigMap to select from. // The ConfigMap to select from.
LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"`
@ -1980,6 +1983,7 @@ type ConfigMapKeySelector struct {
} }
// SecretKeySelector selects a key of a Secret. // SecretKeySelector selects a key of a Secret.
// +structType=atomic
type SecretKeySelector struct { type SecretKeySelector struct {
// The name of the secret in the pod's namespace to select from. // The name of the secret in the pod's namespace to select from.
LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"` LocalObjectReference `json:",inline" protobuf:"bytes,1,opt,name=localObjectReference"`
@ -2616,6 +2620,7 @@ const (
// A node selector represents the union of the results of one or more label queries // A node selector represents the union of the results of one or more label queries
// over a set of nodes; that is, it represents the OR of the selectors represented // over a set of nodes; that is, it represents the OR of the selectors represented
// by the node selector terms. // by the node selector terms.
// +structType=atomic
type NodeSelector struct { type NodeSelector struct {
//Required. A list of node selector terms. The terms are ORed. //Required. A list of node selector terms. The terms are ORed.
NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms" protobuf:"bytes,1,rep,name=nodeSelectorTerms"` NodeSelectorTerms []NodeSelectorTerm `json:"nodeSelectorTerms" protobuf:"bytes,1,rep,name=nodeSelectorTerms"`
@ -2668,7 +2673,10 @@ const (
// The requirements of them are ANDed. // The requirements of them are ANDed.
// It provides a subset of functionality as NodeSelectorTerm. // It provides a subset of functionality as NodeSelectorTerm.
// This is an alpha feature and may change in the future. // This is an alpha feature and may change in the future.
// +structType=atomic.
type TopologySelectorTerm struct { type TopologySelectorTerm struct {
// Usage: Fields of type []TopologySelectorTerm must be listType=atomic.
// A list of topology selector requirements by labels. // A list of topology selector requirements by labels.
// +optional // +optional
MatchLabelExpressions []TopologySelectorLabelRequirement `json:"matchLabelExpressions,omitempty" protobuf:"bytes,1,rep,name=matchLabelExpressions"` MatchLabelExpressions []TopologySelectorLabelRequirement `json:"matchLabelExpressions,omitempty" protobuf:"bytes,1,rep,name=matchLabelExpressions"`
@ -5709,6 +5717,7 @@ type ResourceQuotaSpec struct {
// A scope selector represents the AND of the selectors represented // A scope selector represents the AND of the selectors represented
// by the scoped-resource selector requirements. // by the scoped-resource selector requirements.
// +structType=atomic
type ScopeSelector struct { type ScopeSelector struct {
// A list of scope selector requirements by scope of the resources. // A list of scope selector requirements by scope of the resources.
// +optional // +optional

View File

@ -71,6 +71,7 @@ type StorageClass struct {
// An empty TopologySelectorTerm list means there is no topology restriction. // An empty TopologySelectorTerm list means there is no topology restriction.
// This field is only honored by servers that enable the VolumeScheduling feature. // This field is only honored by servers that enable the VolumeScheduling feature.
// +optional // +optional
// +listType=atomic
AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"` AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"`
} }

View File

@ -75,6 +75,7 @@ type StorageClass struct {
// An empty TopologySelectorTerm list means there is no topology restriction. // An empty TopologySelectorTerm list means there is no topology restriction.
// This field is only honored by servers that enable the VolumeScheduling feature. // This field is only honored by servers that enable the VolumeScheduling feature.
// +optional // +optional
// +listType=atomic
AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"` AllowedTopologies []v1.TopologySelectorTerm `json:"allowedTopologies,omitempty" protobuf:"bytes,8,rep,name=allowedTopologies"`
} }