diff --git a/api/openapi-spec/swagger.json b/api/openapi-spec/swagger.json index 5904d8a8ae3..f5c930920e7 100644 --- a/api/openapi-spec/swagger.json +++ b/api/openapi-spec/swagger.json @@ -13281,9 +13281,9 @@ "description": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements and is immutable.", "type": "string" }, - "topology": { - "$ref": "#/definitions/io.k8s.api.node.v1alpha1.Topology", - "description": "Topology describes the set of nodes in the cluster that support this RuntimeClass. The rules are applied applied to pods running with this RuntimeClass and semantically merged with other scheduling constraints on the pod. If topology is nil, this RuntimeClass is assumed to be supported by all nodes." + "scheduling": { + "$ref": "#/definitions/io.k8s.api.node.v1alpha1.Scheduling", + "description": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes." } }, "required": [ @@ -13291,15 +13291,18 @@ ], "type": "object" }, - "io.k8s.api.node.v1alpha1.Topology": { - "description": "Topology specifies the scheduling constraints for nodes supporting a RuntimeClass.", + "io.k8s.api.node.v1alpha1.Scheduling": { + "description": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.", "properties": { "nodeSelector": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", - "description": "NodeSelector selects the set of nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The NodeSelector is intersected (AND) with a pod's other NodeAffinity or NodeSelector requirements. A nil NodeSelector selects all nodes." + "additionalProperties": { + "type": "string" + }, + "description": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.", + "type": "object" }, "tolerations": { - "description": "Tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", + "description": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", "items": { "$ref": "#/definitions/io.k8s.api.core.v1.Toleration" }, @@ -13327,9 +13330,9 @@ "$ref": "#/definitions/io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta", "description": "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata" }, - "topology": { - "$ref": "#/definitions/io.k8s.api.node.v1beta1.Topology", - "description": "Topology describes the set of nodes in the cluster that support this RuntimeClass. The rules are applied applied to pods running with this RuntimeClass and semantically merged with other scheduling constraints on the pod. If topology is nil, this RuntimeClass is assumed to be supported by all nodes." + "scheduling": { + "$ref": "#/definitions/io.k8s.api.node.v1beta1.Scheduling", + "description": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes." } }, "required": [ @@ -13379,15 +13382,18 @@ } ] }, - "io.k8s.api.node.v1beta1.Topology": { - "description": "Topology specifies the scheduling constraints for nodes supporting a RuntimeClass.", + "io.k8s.api.node.v1beta1.Scheduling": { + "description": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.", "properties": { "nodeSelector": { - "$ref": "#/definitions/io.k8s.api.core.v1.NodeSelector", - "description": "NodeSelector selects the set of nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The NodeSelector is intersected (AND) with a pod's other NodeAffinity or NodeSelector requirements. A nil NodeSelector selects all nodes." + "additionalProperties": { + "type": "string" + }, + "description": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.", + "type": "object" }, "tolerations": { - "description": "Tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", + "description": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", "items": { "$ref": "#/definitions/io.k8s.api.core.v1.Toleration" }, diff --git a/pkg/apis/node/v1alpha1/zz_generated.conversion.go b/pkg/apis/node/v1alpha1/zz_generated.conversion.go index c7c602f990f..f4c4804d54e 100644 --- a/pkg/apis/node/v1alpha1/zz_generated.conversion.go +++ b/pkg/apis/node/v1alpha1/zz_generated.conversion.go @@ -58,13 +58,13 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha1.Topology)(nil), (*node.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_Topology_To_node_Topology(a.(*v1alpha1.Topology), b.(*node.Topology), scope) + if err := s.AddGeneratedConversionFunc((*v1alpha1.Scheduling)(nil), (*node.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Scheduling_To_node_Scheduling(a.(*v1alpha1.Scheduling), b.(*node.Scheduling), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*node.Topology)(nil), (*v1alpha1.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_node_Topology_To_v1alpha1_Topology(a.(*node.Topology), b.(*v1alpha1.Topology), scope) + if err := s.AddGeneratedConversionFunc((*node.Scheduling)(nil), (*v1alpha1.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_node_Scheduling_To_v1alpha1_Scheduling(a.(*node.Scheduling), b.(*v1alpha1.Scheduling), scope) }); err != nil { return err } @@ -90,7 +90,7 @@ func autoConvert_v1alpha1_RuntimeClass_To_node_RuntimeClass(in *v1alpha1.Runtime func autoConvert_node_RuntimeClass_To_v1alpha1_RuntimeClass(in *node.RuntimeClass, out *v1alpha1.RuntimeClass, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta // WARNING: in.Handler requires manual conversion: does not exist in peer-type - // WARNING: in.Topology requires manual conversion: does not exist in peer-type + // WARNING: in.Scheduling requires manual conversion: does not exist in peer-type return nil } @@ -136,24 +136,24 @@ func Convert_node_RuntimeClassList_To_v1alpha1_RuntimeClassList(in *node.Runtime return autoConvert_node_RuntimeClassList_To_v1alpha1_RuntimeClassList(in, out, s) } -func autoConvert_v1alpha1_Topology_To_node_Topology(in *v1alpha1.Topology, out *node.Topology, s conversion.Scope) error { - out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector)) +func autoConvert_v1alpha1_Scheduling_To_node_Scheduling(in *v1alpha1.Scheduling, out *node.Scheduling, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations)) return nil } -// Convert_v1alpha1_Topology_To_node_Topology is an autogenerated conversion function. -func Convert_v1alpha1_Topology_To_node_Topology(in *v1alpha1.Topology, out *node.Topology, s conversion.Scope) error { - return autoConvert_v1alpha1_Topology_To_node_Topology(in, out, s) +// Convert_v1alpha1_Scheduling_To_node_Scheduling is an autogenerated conversion function. +func Convert_v1alpha1_Scheduling_To_node_Scheduling(in *v1alpha1.Scheduling, out *node.Scheduling, s conversion.Scope) error { + return autoConvert_v1alpha1_Scheduling_To_node_Scheduling(in, out, s) } -func autoConvert_node_Topology_To_v1alpha1_Topology(in *node.Topology, out *v1alpha1.Topology, s conversion.Scope) error { - out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) +func autoConvert_node_Scheduling_To_v1alpha1_Scheduling(in *node.Scheduling, out *v1alpha1.Scheduling, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) return nil } -// Convert_node_Topology_To_v1alpha1_Topology is an autogenerated conversion function. -func Convert_node_Topology_To_v1alpha1_Topology(in *node.Topology, out *v1alpha1.Topology, s conversion.Scope) error { - return autoConvert_node_Topology_To_v1alpha1_Topology(in, out, s) +// Convert_node_Scheduling_To_v1alpha1_Scheduling is an autogenerated conversion function. +func Convert_node_Scheduling_To_v1alpha1_Scheduling(in *node.Scheduling, out *v1alpha1.Scheduling, s conversion.Scope) error { + return autoConvert_node_Scheduling_To_v1alpha1_Scheduling(in, out, s) } diff --git a/pkg/apis/node/v1beta1/zz_generated.conversion.go b/pkg/apis/node/v1beta1/zz_generated.conversion.go index 8ab2ab3be6e..35f23db5762 100644 --- a/pkg/apis/node/v1beta1/zz_generated.conversion.go +++ b/pkg/apis/node/v1beta1/zz_generated.conversion.go @@ -58,13 +58,13 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1beta1.Topology)(nil), (*node.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Topology_To_node_Topology(a.(*v1beta1.Topology), b.(*node.Topology), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Scheduling)(nil), (*node.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Scheduling_To_node_Scheduling(a.(*v1beta1.Scheduling), b.(*node.Scheduling), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*node.Topology)(nil), (*v1beta1.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_node_Topology_To_v1beta1_Topology(a.(*node.Topology), b.(*v1beta1.Topology), scope) + if err := s.AddGeneratedConversionFunc((*node.Scheduling)(nil), (*v1beta1.Scheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_node_Scheduling_To_v1beta1_Scheduling(a.(*node.Scheduling), b.(*v1beta1.Scheduling), scope) }); err != nil { return err } @@ -74,7 +74,7 @@ func RegisterConversions(s *runtime.Scheme) error { func autoConvert_v1beta1_RuntimeClass_To_node_RuntimeClass(in *v1beta1.RuntimeClass, out *node.RuntimeClass, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta out.Handler = in.Handler - out.Topology = (*node.Topology)(unsafe.Pointer(in.Topology)) + out.Scheduling = (*node.Scheduling)(unsafe.Pointer(in.Scheduling)) return nil } @@ -86,7 +86,7 @@ func Convert_v1beta1_RuntimeClass_To_node_RuntimeClass(in *v1beta1.RuntimeClass, func autoConvert_node_RuntimeClass_To_v1beta1_RuntimeClass(in *node.RuntimeClass, out *v1beta1.RuntimeClass, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta out.Handler = in.Handler - out.Topology = (*v1beta1.Topology)(unsafe.Pointer(in.Topology)) + out.Scheduling = (*v1beta1.Scheduling)(unsafe.Pointer(in.Scheduling)) return nil } @@ -117,24 +117,24 @@ func Convert_node_RuntimeClassList_To_v1beta1_RuntimeClassList(in *node.RuntimeC return autoConvert_node_RuntimeClassList_To_v1beta1_RuntimeClassList(in, out, s) } -func autoConvert_v1beta1_Topology_To_node_Topology(in *v1beta1.Topology, out *node.Topology, s conversion.Scope) error { - out.NodeSelector = (*core.NodeSelector)(unsafe.Pointer(in.NodeSelector)) +func autoConvert_v1beta1_Scheduling_To_node_Scheduling(in *v1beta1.Scheduling, out *node.Scheduling, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations)) return nil } -// Convert_v1beta1_Topology_To_node_Topology is an autogenerated conversion function. -func Convert_v1beta1_Topology_To_node_Topology(in *v1beta1.Topology, out *node.Topology, s conversion.Scope) error { - return autoConvert_v1beta1_Topology_To_node_Topology(in, out, s) +// Convert_v1beta1_Scheduling_To_node_Scheduling is an autogenerated conversion function. +func Convert_v1beta1_Scheduling_To_node_Scheduling(in *v1beta1.Scheduling, out *node.Scheduling, s conversion.Scope) error { + return autoConvert_v1beta1_Scheduling_To_node_Scheduling(in, out, s) } -func autoConvert_node_Topology_To_v1beta1_Topology(in *node.Topology, out *v1beta1.Topology, s conversion.Scope) error { - out.NodeSelector = (*v1.NodeSelector)(unsafe.Pointer(in.NodeSelector)) +func autoConvert_node_Scheduling_To_v1beta1_Scheduling(in *node.Scheduling, out *v1beta1.Scheduling, s conversion.Scope) error { + out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) return nil } -// Convert_node_Topology_To_v1beta1_Topology is an autogenerated conversion function. -func Convert_node_Topology_To_v1beta1_Topology(in *node.Topology, out *v1beta1.Topology, s conversion.Scope) error { - return autoConvert_node_Topology_To_v1beta1_Topology(in, out, s) +// Convert_node_Scheduling_To_v1beta1_Scheduling is an autogenerated conversion function. +func Convert_node_Scheduling_To_v1beta1_Scheduling(in *node.Scheduling, out *v1beta1.Scheduling, s conversion.Scope) error { + return autoConvert_node_Scheduling_To_v1beta1_Scheduling(in, out, s) } diff --git a/pkg/apis/node/validation/BUILD b/pkg/apis/node/validation/BUILD index 0633424f1c6..6e28a9229ba 100644 --- a/pkg/apis/node/validation/BUILD +++ b/pkg/apis/node/validation/BUILD @@ -9,6 +9,7 @@ go_library( "//pkg/apis/core/validation:go_default_library", "//pkg/apis/node:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/api/validation:go_default_library", + "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/validation:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation/field:go_default_library", ], ) diff --git a/pkg/apis/node/zz_generated.deepcopy.go b/pkg/apis/node/zz_generated.deepcopy.go index 11349c9d1de..d1c2f921102 100644 --- a/pkg/apis/node/zz_generated.deepcopy.go +++ b/pkg/apis/node/zz_generated.deepcopy.go @@ -30,9 +30,9 @@ func (in *RuntimeClass) DeepCopyInto(out *RuntimeClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) + if in.Scheduling != nil { + in, out := &in.Scheduling, &out.Scheduling + *out = new(Scheduling) (*in).DeepCopyInto(*out) } return @@ -90,12 +90,14 @@ func (in *RuntimeClassList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { +func (in *Scheduling) DeepCopyInto(out *Scheduling) { *out = *in if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector - *out = new(core.NodeSelector) - (*in).DeepCopyInto(*out) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations @@ -107,12 +109,12 @@ func (in *Topology) DeepCopyInto(out *Topology) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. -func (in *Topology) DeepCopy() *Topology { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduling. +func (in *Scheduling) DeepCopy() *Scheduling { if in == nil { return nil } - out := new(Topology) + out := new(Scheduling) in.DeepCopyInto(out) return out } diff --git a/staging/src/k8s.io/api/node/v1alpha1/BUILD b/staging/src/k8s.io/api/node/v1alpha1/BUILD index dc2094afa44..6a176d0a913 100644 --- a/staging/src/k8s.io/api/node/v1alpha1/BUILD +++ b/staging/src/k8s.io/api/node/v1alpha1/BUILD @@ -19,6 +19,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/github.com/gogo/protobuf/proto:go_default_library", + "//vendor/github.com/gogo/protobuf/sortkeys:go_default_library", ], ) diff --git a/staging/src/k8s.io/api/node/v1alpha1/generated.pb.go b/staging/src/k8s.io/api/node/v1alpha1/generated.pb.go index fc4bc16983a..28c5e6a4371 100644 --- a/staging/src/k8s.io/api/node/v1alpha1/generated.pb.go +++ b/staging/src/k8s.io/api/node/v1alpha1/generated.pb.go @@ -27,7 +27,7 @@ limitations under the License. RuntimeClass RuntimeClassList RuntimeClassSpec - Topology + Scheduling */ package v1alpha1 @@ -37,6 +37,8 @@ import math "math" import k8s_io_api_core_v1 "k8s.io/api/core/v1" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + import strings "strings" import reflect "reflect" @@ -65,15 +67,15 @@ func (m *RuntimeClassSpec) Reset() { *m = RuntimeClassSpec{} func (*RuntimeClassSpec) ProtoMessage() {} func (*RuntimeClassSpec) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } -func (m *Topology) Reset() { *m = Topology{} } -func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } +func (m *Scheduling) Reset() { *m = Scheduling{} } +func (*Scheduling) ProtoMessage() {} +func (*Scheduling) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{3} } func init() { proto.RegisterType((*RuntimeClass)(nil), "k8s.io.api.node.v1alpha1.RuntimeClass") proto.RegisterType((*RuntimeClassList)(nil), "k8s.io.api.node.v1alpha1.RuntimeClassList") proto.RegisterType((*RuntimeClassSpec)(nil), "k8s.io.api.node.v1alpha1.RuntimeClassSpec") - proto.RegisterType((*Topology)(nil), "k8s.io.api.node.v1alpha1.Topology") + proto.RegisterType((*Scheduling)(nil), "k8s.io.api.node.v1alpha1.Scheduling") } func (m *RuntimeClass) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -166,11 +168,11 @@ func (m *RuntimeClassSpec) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.RuntimeHandler))) i += copy(dAtA[i:], m.RuntimeHandler) - if m.Topology != nil { + if m.Scheduling != nil { dAtA[i] = 0x1a i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Topology.Size())) - n4, err := m.Topology.MarshalTo(dAtA[i:]) + i = encodeVarintGenerated(dAtA, i, uint64(m.Scheduling.Size())) + n4, err := m.Scheduling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -179,7 +181,7 @@ func (m *RuntimeClassSpec) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Topology) Marshal() (dAtA []byte, err error) { +func (m *Scheduling) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -189,20 +191,32 @@ func (m *Topology) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Topology) MarshalTo(dAtA []byte) (int, error) { +func (m *Scheduling) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.NodeSelector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.NodeSelector.Size())) - n5, err := m.NodeSelector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for _, k := range keysForNodeSelector { + dAtA[i] = 0xa + i++ + v := m.NodeSelector[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) } - i += n5 } if len(m.Tolerations) > 0 { for _, msg := range m.Tolerations { @@ -257,19 +271,23 @@ func (m *RuntimeClassSpec) Size() (n int) { _ = l l = len(m.RuntimeHandler) n += 1 + l + sovGenerated(uint64(l)) - if m.Topology != nil { - l = m.Topology.Size() + if m.Scheduling != nil { + l = m.Scheduling.Size() n += 1 + l + sovGenerated(uint64(l)) } return n } -func (m *Topology) Size() (n int) { +func (m *Scheduling) Size() (n int) { var l int _ = l - if m.NodeSelector != nil { - l = m.NodeSelector.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } } if len(m.Tolerations) > 0 { for _, e := range m.Tolerations { @@ -321,17 +339,27 @@ func (this *RuntimeClassSpec) String() string { } s := strings.Join([]string{`&RuntimeClassSpec{`, `RuntimeHandler:` + fmt.Sprintf("%v", this.RuntimeHandler) + `,`, - `Topology:` + strings.Replace(fmt.Sprintf("%v", this.Topology), "Topology", "Topology", 1) + `,`, + `Scheduling:` + strings.Replace(fmt.Sprintf("%v", this.Scheduling), "Scheduling", "Scheduling", 1) + `,`, `}`, }, "") return s } -func (this *Topology) String() string { +func (this *Scheduling) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Topology{`, - `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "k8s_io_api_core_v1.NodeSelector", 1) + `,`, + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&Scheduling{`, + `NodeSelector:` + mapStringForNodeSelector + `,`, `Tolerations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Tolerations), "Toleration", "k8s_io_api_core_v1.Toleration", 1), `&`, ``, 1) + `,`, `}`, }, "") @@ -626,7 +654,7 @@ func (m *RuntimeClassSpec) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Scheduling", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -650,10 +678,10 @@ func (m *RuntimeClassSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Topology == nil { - m.Topology = &Topology{} + if m.Scheduling == nil { + m.Scheduling = &Scheduling{} } - if err := m.Topology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Scheduling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -678,7 +706,7 @@ func (m *RuntimeClassSpec) Unmarshal(dAtA []byte) error { } return nil } -func (m *Topology) Unmarshal(dAtA []byte) error { +func (m *Scheduling) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -701,10 +729,10 @@ func (m *Topology) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Topology: wiretype end group for non-group") + return fmt.Errorf("proto: Scheduling: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Topology: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Scheduling: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -734,11 +762,96 @@ func (m *Topology) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NodeSelector == nil { - m.NodeSelector = &k8s_io_api_core_v1.NodeSelector{} + m.NodeSelector = make(map[string]string) } - if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.NodeSelector[mapkey] = mapvalue iNdEx = postIndex case 2: if wireType != 2 { @@ -902,38 +1015,41 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 527 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00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0xa8, 0x7c, 0x6f, 0x2f, 0x78, 0xe2, 0x47, 0x90, 0x15, 0x29, 0xfe, 0x73, 0xee, 0x96, 0x88, 0x23, - 0xf7, 0xca, 0x53, 0x77, 0x4b, 0x6d, 0x8e, 0x70, 0x5b, 0x89, 0x54, 0x44, 0x22, 0x38, 0xb7, 0xf6, - 0x8b, 0xfc, 0xf6, 0xee, 0x25, 0xcf, 0x4a, 0xa5, 0x63, 0xe8, 0xbc, 0x55, 0xe5, 0xd6, 0x04, 0xfb, - 0x07, 0xc2, 0x75, 0xdb, 0x7c, 0x8f, 0x0d, 0x6d, 0x3f, 0x85, 0x08, 0x3c, 0x25, 0xb2, 0xf2, 0xbc, - 0x83, 0x26, 0x5e, 0x7f, 0x0a, 0xfa, 0x98, 0x6f, 0x1a, 0x3a, 0xa7, 0x9b, 0x2f, 0xfb, 0x46, 0xb3, - 0xe3, 0x5e, 0xe1, 0x98, 0xef, 0x70, 0x47, 0x89, 0x48, 0xff, 0x37, 0x43, 0x91, 0x54, 0xa7, 0x25, - 0x37, 0x61, 0xcf, 0x6a, 0x99, 0x73, 0xa7, 0xbc, 0x47, 0x67, 0xd3, 0x93, 0x6e, 0x93, 0xe3, 0xd0, - 0xc5, 0x8a, 0xb4, 0x2e, 0x56, 0xa4, 0x75, 0xb9, 0x22, 0xad, 0xaf, 0x39, 0x41, 0x8b, 0x9c, 0xa0, - 0x8b, 0x9c, 0xa0, 0xcb, 0x9c, 0xa0, 0xdf, 0x39, 0x41, 0xdf, 0xfe, 0x90, 0xd6, 0x87, 0x76, 0x75, - 0x8c, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x61, 0x6b, 0x4c, 0x0f, 0x5f, 0x04, 0x00, 0x00, + // 568 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x4c, + 0x10, 0x8e, 0xd3, 0x56, 0x4a, 0x37, 0xf9, 0xa3, 0xfc, 0x4b, 0x85, 0xa2, 0x1c, 0xdc, 0x2a, 0x42, + 0xa8, 0x42, 0x62, 0x97, 0x54, 0xa8, 0xaa, 0x38, 0x80, 0x30, 0x42, 0x02, 0x51, 0x40, 0xda, 0x94, + 0x0b, 0xe2, 0xc0, 0xc6, 0x1e, 0x1c, 0x13, 0xdb, 0x6b, 0x79, 0xd7, 0x91, 0x72, 0xe3, 0x11, 0x38, + 0xf1, 0x0c, 0xbc, 0x04, 0x9c, 0x73, 0xec, 0xb1, 0xa7, 0x8a, 0x98, 0x17, 0x41, 0x6b, 0x3b, 0x89, + 0x9b, 0x10, 0x91, 0x9b, 0x67, 0xe6, 0xfb, 0xbe, 0x99, 0x6f, 0x66, 0x8d, 0x9e, 0x8e, 0xce, 0x24, + 0xf1, 0x04, 0x1d, 0x25, 0x03, 0x88, 0x43, 0x50, 0x20, 0xe9, 0x18, 0x42, 0x47, 0xc4, 0xb4, 0x28, + 0xf0, 0xc8, 0xa3, 0xa1, 0x70, 0x80, 0x8e, 0x7b, 0xdc, 0x8f, 0x86, 0xbc, 0x47, 0x5d, 0x08, 0x21, + 0xe6, 0x0a, 0x1c, 0x12, 0xc5, 0x42, 0x09, 0xdc, 0xce, 0x91, 0x84, 0x47, 0x1e, 0xd1, 0x48, 0x32, + 0x47, 0x76, 0xee, 0xbb, 0x9e, 0x1a, 0x26, 0x03, 0x62, 0x8b, 0x80, 0xba, 0xc2, 0x15, 0x34, 0x23, + 0x0c, 0x92, 0x4f, 0x59, 0x94, 0x05, 0xd9, 0x57, 0x2e, 0xd4, 0xe9, 0x96, 0x5a, 0xda, 0x22, 0xd6, + 0x2d, 0x57, 0x9b, 0x75, 0x1e, 0x2e, 0x31, 0x01, 0xb7, 0x87, 0x5e, 0x08, 0xf1, 0x84, 0x46, 0x23, + 0x57, 0x27, 0x24, 0x0d, 0x40, 0xf1, 0xbf, 0xb1, 0xe8, 0x26, 0x56, 0x9c, 0x84, 0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x00, 0x00, } diff --git a/staging/src/k8s.io/api/node/v1alpha1/generated.proto b/staging/src/k8s.io/api/node/v1alpha1/generated.proto index ef5bae6c5c5..39d5a96b44a 100644 --- a/staging/src/k8s.io/api/node/v1alpha1/generated.proto +++ b/staging/src/k8s.io/api/node/v1alpha1/generated.proto @@ -74,28 +74,26 @@ message RuntimeClassSpec { // and is immutable. optional string runtimeHandler = 1; - // Topology describes the set of nodes in the cluster that support this - // RuntimeClass. The rules are applied applied to pods running with this - // RuntimeClass and semantically merged with other scheduling constraints on - // the pod. - // If topology is nil, this RuntimeClass is assumed to be supported by all + // Scheduling holds the scheduling constraints to ensure that pods running + // with this RuntimeClass are scheduled to nodes that support it. + // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional - optional Topology topology = 3; + optional Scheduling scheduling = 3; } -// Topology specifies the scheduling constraints for nodes supporting a +// Scheduling specifies the scheduling constraints for nodes supporting a // RuntimeClass. -message Topology { - // NodeSelector selects the set of nodes that support this RuntimeClass. - // Pods using this RuntimeClass can only be scheduled to a node matched by - // this selector. The NodeSelector is intersected (AND) with a pod's other - // NodeAffinity or NodeSelector requirements. - // A nil NodeSelector selects all nodes. +message Scheduling { + // nodeSelector lists labels that must be present on nodes that support this + // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a + // node matched by this selector. The RuntimeClass nodeSelector is merged + // with a pod's existing nodeSelector. Any conflicts will cause the pod to + // be rejected in admission. // +optional - optional k8s.io.api.core.v1.NodeSelector nodeSelector = 1; + map nodeSelector = 1; - // Tolerations are appended (excluding duplicates) to pods running with this + // tolerations are appended (excluding duplicates) to pods running with this // RuntimeClass during admission, effectively unioning the set of nodes // tolerated by the pod and the RuntimeClass. // +optional diff --git a/staging/src/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go index 5be2d04ec9a..0bcf32e16ad 100644 --- a/staging/src/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/node/v1alpha1/types_swagger_doc_generated.go @@ -50,21 +50,21 @@ func (RuntimeClassList) SwaggerDoc() map[string]string { var map_RuntimeClassSpec = map[string]string{ "": "RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters that are required to describe the RuntimeClass to the Container Runtime Interface (CRI) implementation, as well as any other components that need to understand how the pod will be run. The RuntimeClassSpec is immutable.", "runtimeHandler": "RuntimeHandler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The RuntimeHandler must conform to the DNS Label (RFC 1123) requirements and is immutable.", - "topology": "Topology describes the set of nodes in the cluster that support this RuntimeClass. The rules are applied applied to pods running with this RuntimeClass and semantically merged with other scheduling constraints on the pod. If topology is nil, this RuntimeClass is assumed to be supported by all nodes.", + "scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", } func (RuntimeClassSpec) SwaggerDoc() map[string]string { return map_RuntimeClassSpec } -var map_Topology = map[string]string{ - "": "Topology specifies the scheduling constraints for nodes supporting a RuntimeClass.", - "nodeSelector": "NodeSelector selects the set of nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The NodeSelector is intersected (AND) with a pod's other NodeAffinity or NodeSelector requirements. A nil NodeSelector selects all nodes.", - "tolerations": "Tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", +var map_Scheduling = map[string]string{ + "": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.", + "nodeSelector": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.", + "tolerations": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", } -func (Topology) SwaggerDoc() map[string]string { - return map_Topology +func (Scheduling) SwaggerDoc() map[string]string { + return map_Scheduling } // AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/api/node/v1alpha1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/node/v1alpha1/zz_generated.deepcopy.go index 30c50160d33..11e169d4fb1 100644 --- a/staging/src/k8s.io/api/node/v1alpha1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/node/v1alpha1/zz_generated.deepcopy.go @@ -88,9 +88,9 @@ func (in *RuntimeClassList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RuntimeClassSpec) DeepCopyInto(out *RuntimeClassSpec) { *out = *in - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) + if in.Scheduling != nil { + in, out := &in.Scheduling, &out.Scheduling + *out = new(Scheduling) (*in).DeepCopyInto(*out) } return @@ -107,12 +107,14 @@ func (in *RuntimeClassSpec) DeepCopy() *RuntimeClassSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { +func (in *Scheduling) DeepCopyInto(out *Scheduling) { *out = *in if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector - *out = new(v1.NodeSelector) - (*in).DeepCopyInto(*out) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations @@ -124,12 +126,12 @@ func (in *Topology) DeepCopyInto(out *Topology) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. -func (in *Topology) DeepCopy() *Topology { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduling. +func (in *Scheduling) DeepCopy() *Scheduling { if in == nil { return nil } - out := new(Topology) + out := new(Scheduling) in.DeepCopyInto(out) return out } diff --git a/staging/src/k8s.io/api/node/v1beta1/BUILD b/staging/src/k8s.io/api/node/v1beta1/BUILD index 214090d851a..db2cdbe037f 100644 --- a/staging/src/k8s.io/api/node/v1beta1/BUILD +++ b/staging/src/k8s.io/api/node/v1beta1/BUILD @@ -19,6 +19,7 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/runtime:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/github.com/gogo/protobuf/proto:go_default_library", + "//vendor/github.com/gogo/protobuf/sortkeys:go_default_library", ], ) diff --git a/staging/src/k8s.io/api/node/v1beta1/generated.pb.go b/staging/src/k8s.io/api/node/v1beta1/generated.pb.go index c9b285f99de..a2cf593923f 100644 --- a/staging/src/k8s.io/api/node/v1beta1/generated.pb.go +++ b/staging/src/k8s.io/api/node/v1beta1/generated.pb.go @@ -26,7 +26,7 @@ limitations under the License. It has these top-level messages: RuntimeClass RuntimeClassList - Topology + Scheduling */ package v1beta1 @@ -36,6 +36,8 @@ import math "math" import k8s_io_api_core_v1 "k8s.io/api/core/v1" +import github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + import strings "strings" import reflect "reflect" @@ -60,14 +62,14 @@ func (m *RuntimeClassList) Reset() { *m = RuntimeClassList{} func (*RuntimeClassList) ProtoMessage() {} func (*RuntimeClassList) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{1} } -func (m *Topology) Reset() { *m = Topology{} } -func (*Topology) ProtoMessage() {} -func (*Topology) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } +func (m *Scheduling) Reset() { *m = Scheduling{} } +func (*Scheduling) ProtoMessage() {} +func (*Scheduling) Descriptor() ([]byte, []int) { return fileDescriptorGenerated, []int{2} } func init() { proto.RegisterType((*RuntimeClass)(nil), "k8s.io.api.node.v1beta1.RuntimeClass") proto.RegisterType((*RuntimeClassList)(nil), "k8s.io.api.node.v1beta1.RuntimeClassList") - proto.RegisterType((*Topology)(nil), "k8s.io.api.node.v1beta1.Topology") + proto.RegisterType((*Scheduling)(nil), "k8s.io.api.node.v1beta1.Scheduling") } func (m *RuntimeClass) Marshal() (dAtA []byte, err error) { size := m.Size() @@ -96,11 +98,11 @@ func (m *RuntimeClass) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintGenerated(dAtA, i, uint64(len(m.Handler))) i += copy(dAtA[i:], m.Handler) - if m.Topology != nil { + if m.Scheduling != nil { dAtA[i] = 0x1a i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.Topology.Size())) - n2, err := m.Topology.MarshalTo(dAtA[i:]) + i = encodeVarintGenerated(dAtA, i, uint64(m.Scheduling.Size())) + n2, err := m.Scheduling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } @@ -147,7 +149,7 @@ func (m *RuntimeClassList) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Topology) Marshal() (dAtA []byte, err error) { +func (m *Scheduling) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalTo(dAtA) @@ -157,20 +159,32 @@ func (m *Topology) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Topology) MarshalTo(dAtA []byte) (int, error) { +func (m *Scheduling) MarshalTo(dAtA []byte) (int, error) { var i int _ = i var l int _ = l - if m.NodeSelector != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintGenerated(dAtA, i, uint64(m.NodeSelector.Size())) - n4, err := m.NodeSelector.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.NodeSelector) > 0 { + keysForNodeSelector := make([]string, 0, len(m.NodeSelector)) + for k := range m.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + for _, k := range keysForNodeSelector { + dAtA[i] = 0xa + i++ + v := m.NodeSelector[string(k)] + mapSize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + i = encodeVarintGenerated(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) } - i += n4 } if len(m.Tolerations) > 0 { for _, msg := range m.Tolerations { @@ -203,8 +217,8 @@ func (m *RuntimeClass) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Handler) n += 1 + l + sovGenerated(uint64(l)) - if m.Topology != nil { - l = m.Topology.Size() + if m.Scheduling != nil { + l = m.Scheduling.Size() n += 1 + l + sovGenerated(uint64(l)) } return n @@ -224,12 +238,16 @@ func (m *RuntimeClassList) Size() (n int) { return n } -func (m *Topology) Size() (n int) { +func (m *Scheduling) Size() (n int) { var l int _ = l - if m.NodeSelector != nil { - l = m.NodeSelector.Size() - n += 1 + l + sovGenerated(uint64(l)) + if len(m.NodeSelector) > 0 { + for k, v := range m.NodeSelector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } } if len(m.Tolerations) > 0 { for _, e := range m.Tolerations { @@ -260,7 +278,7 @@ func (this *RuntimeClass) String() string { s := strings.Join([]string{`&RuntimeClass{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "k8s_io_apimachinery_pkg_apis_meta_v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Handler:` + fmt.Sprintf("%v", this.Handler) + `,`, - `Topology:` + strings.Replace(fmt.Sprintf("%v", this.Topology), "Topology", "Topology", 1) + `,`, + `Scheduling:` + strings.Replace(fmt.Sprintf("%v", this.Scheduling), "Scheduling", "Scheduling", 1) + `,`, `}`, }, "") return s @@ -276,12 +294,22 @@ func (this *RuntimeClassList) String() string { }, "") return s } -func (this *Topology) String() string { +func (this *Scheduling) String() string { if this == nil { return "nil" } - s := strings.Join([]string{`&Topology{`, - `NodeSelector:` + strings.Replace(fmt.Sprintf("%v", this.NodeSelector), "NodeSelector", "k8s_io_api_core_v1.NodeSelector", 1) + `,`, + keysForNodeSelector := make([]string, 0, len(this.NodeSelector)) + for k := range this.NodeSelector { + keysForNodeSelector = append(keysForNodeSelector, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForNodeSelector) + mapStringForNodeSelector := "map[string]string{" + for _, k := range keysForNodeSelector { + mapStringForNodeSelector += fmt.Sprintf("%v: %v,", k, this.NodeSelector[k]) + } + mapStringForNodeSelector += "}" + s := strings.Join([]string{`&Scheduling{`, + `NodeSelector:` + mapStringForNodeSelector + `,`, `Tolerations:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Tolerations), "Toleration", "k8s_io_api_core_v1.Toleration", 1), `&`, ``, 1) + `,`, `}`, }, "") @@ -385,7 +413,7 @@ func (m *RuntimeClass) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Topology", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Scheduling", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -409,10 +437,10 @@ func (m *RuntimeClass) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Topology == nil { - m.Topology = &Topology{} + if m.Scheduling == nil { + m.Scheduling = &Scheduling{} } - if err := m.Topology.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Scheduling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -548,7 +576,7 @@ func (m *RuntimeClassList) Unmarshal(dAtA []byte) error { } return nil } -func (m *Topology) Unmarshal(dAtA []byte) error { +func (m *Scheduling) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -571,10 +599,10 @@ func (m *Topology) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Topology: wiretype end group for non-group") + return fmt.Errorf("proto: Scheduling: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Topology: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Scheduling: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -604,11 +632,96 @@ func (m *Topology) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.NodeSelector == nil { - m.NodeSelector = &k8s_io_api_core_v1.NodeSelector{} + m.NodeSelector = make(map[string]string) } - if err := m.NodeSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } } + m.NodeSelector[mapkey] = mapvalue iNdEx = postIndex case 2: if wireType != 2 { @@ -772,36 +885,39 @@ func init() { } var fileDescriptorGenerated = []byte{ - // 493 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xcf, 0x8e, 0xd3, 0x3e, - 0x18, 0x8c, 0x77, 0xb5, 0x6a, 0x7f, 0x6e, 0x7f, 0xa2, 0x0a, 0x07, 0xaa, 0x1e, 0xdc, 0x52, 0x09, - 0xa9, 0x1c, 0xd6, 0xa6, 0x2b, 0x84, 0x38, 0xa2, 0x70, 0xe1, 0x3f, 0x52, 0x58, 0x38, 0x20, 0x0e, - 0x38, 0xc9, 0x47, 0x1a, 0x9a, 0xc4, 0x51, 0xec, 0x56, 0xda, 0x1b, 0x8f, 0xc0, 0xeb, 0x20, 0xf1, - 0x00, 0x3d, 0xee, 0x71, 0x4f, 0x15, 0x0d, 0x17, 0x1e, 0x03, 0x39, 0x71, 0xd3, 0xb0, 0xbb, 0x15, - 0xdc, 0xf2, 0x8d, 0x67, 0xe6, 0x9b,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0xb5, - 0x21, 0xd6, 0xf9, 0x86, 0x58, 0x17, 0x1b, 0x62, 0x7d, 0x29, 0x08, 0x5a, 0x15, 0x04, 0x9d, 0x17, - 0x04, 0x5d, 0x14, 0x04, 0xfd, 0x28, 0x08, 0xfa, 0xfa, 0x93, 0x58, 0xef, 0x5b, 0xe6, 0x36, 0x7e, - 0x07, 0x00, 0x00, 0xff, 0xff, 0xcb, 0xb4, 0x5d, 0x60, 0xe2, 0x03, 0x00, 0x00, + // 534 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xcf, 0x8e, 0xd2, 0x40, + 0x18, 0x67, 0x20, 0x84, 0xdd, 0x01, 0x15, 0xeb, 0x26, 0x12, 0x0e, 0x5d, 0x82, 0x31, 0xc1, 0xc3, + 0xce, 0xc8, 0x46, 0xcd, 0xc6, 0x8b, 0xa6, 0xc6, 0x44, 0x8d, 0x7f, 0x92, 0xa2, 0x17, 0xe3, 0xc1, + 0xa1, 0xfd, 0x2c, 0x95, 0xb6, 0x43, 0x3a, 0x53, 0x12, 0x6e, 0x3e, 0x82, 0x17, 0xdf, 0xc6, 0x07, + 0xe0, 0xb8, 0xc7, 0x3d, 0x6d, 0xa4, 0xbe, 0x80, 0x8f, 0x60, 0xa6, 0x2d, 0x74, 0x5c, 0x24, 0xbb, + 0xb7, 0x7e, 0xdf, 0xfc, 0xfe, 0x7c, 0xbf, 0x6f, 0xa6, 0xf8, 0xe9, 0xf4, 0x44, 0x10, 0x9f, 0xd3, + 0x69, 0x32, 0x86, 0x38, 0x02, 0x09, 0x82, 0xce, 0x21, 0x72, 0x79, 0x4c, 0x8b, 0x03, 0x36, 0xf3, + 0x69, 0xc4, 0x5d, 0xa0, 0xf3, 0xe1, 0x18, 0x24, 0x1b, 0x52, 0x0f, 0x22, 0x88, 0x99, 0x04, 0x97, + 0xcc, 0x62, 0x2e, 0xb9, 0x71, 0x3b,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0xa9, 0x89, 0x96, 0xa9, 0x89, 0x4e, 0x53, 0x13, 0x9d, 0xa5, 0x26, 0xfa, 0x95, 0x9a, 0xe8, + 0xfb, 0x6f, 0xb3, 0xf2, 0xb1, 0x51, 0xec, 0xe1, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x36, 0x6a, + 0x5d, 0x42, 0x46, 0x04, 0x00, 0x00, } diff --git a/staging/src/k8s.io/api/node/v1beta1/generated.proto b/staging/src/k8s.io/api/node/v1beta1/generated.proto index ec017234715..d1124c93be9 100644 --- a/staging/src/k8s.io/api/node/v1beta1/generated.proto +++ b/staging/src/k8s.io/api/node/v1beta1/generated.proto @@ -53,14 +53,12 @@ message RuntimeClass { // immutable. optional string handler = 2; - // Topology describes the set of nodes in the cluster that support this - // RuntimeClass. The rules are applied applied to pods running with this - // RuntimeClass and semantically merged with other scheduling constraints on - // the pod. - // If topology is nil, this RuntimeClass is assumed to be supported by all + // Scheduling holds the scheduling constraints to ensure that pods running + // with this RuntimeClass are scheduled to nodes that support it. + // If scheduling is nil, this RuntimeClass is assumed to be supported by all // nodes. // +optional - optional Topology topology = 3; + optional Scheduling scheduling = 3; } // RuntimeClassList is a list of RuntimeClass objects. @@ -74,18 +72,18 @@ message RuntimeClassList { repeated RuntimeClass items = 2; } -// Topology specifies the scheduling constraints for nodes supporting a +// Scheduling specifies the scheduling constraints for nodes supporting a // RuntimeClass. -message Topology { - // NodeSelector selects the set of nodes that support this RuntimeClass. - // Pods using this RuntimeClass can only be scheduled to a node matched by - // this selector. The NodeSelector is intersected (AND) with a pod's other - // NodeAffinity or NodeSelector requirements. - // A nil NodeSelector selects all nodes. +message Scheduling { + // nodeSelector lists labels that must be present on nodes that support this + // RuntimeClass. Pods using this RuntimeClass can only be scheduled to a + // node matched by this selector. The RuntimeClass nodeSelector is merged + // with a pod's existing nodeSelector. Any conflicts will cause the pod to + // be rejected in admission. // +optional - optional k8s.io.api.core.v1.NodeSelector nodeSelector = 1; + map nodeSelector = 1; - // Tolerations are appended (excluding duplicates) to pods running with this + // tolerations are appended (excluding duplicates) to pods running with this // RuntimeClass during admission, effectively unioning the set of nodes // tolerated by the pod and the RuntimeClass. // +optional diff --git a/staging/src/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go index 3f85eb9472d..ac6e95528db 100644 --- a/staging/src/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/node/v1beta1/types_swagger_doc_generated.go @@ -28,10 +28,10 @@ package v1beta1 // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_RuntimeClass = map[string]string{ - "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", - "handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must conform to the DNS Label (RFC 1123) requirements, and is immutable.", - "topology": "Topology describes the set of nodes in the cluster that support this RuntimeClass. The rules are applied applied to pods running with this RuntimeClass and semantically merged with other scheduling constraints on the pod. If topology is nil, this RuntimeClass is assumed to be supported by all nodes.", + "": "RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md", + "metadata": "More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata", + "handler": "Handler specifies the underlying runtime and configuration that the CRI implementation will use to handle pods of this class. The possible values are specific to the node & CRI configuration. It is assumed that all handlers are available on every node, and handlers of the same name are equivalent on every node. For example, a handler called \"runc\" might specify that the runc OCI runtime (using native Linux containers) will be used to run the containers in a pod. The Handler must conform to the DNS Label (RFC 1123) requirements, and is immutable.", + "scheduling": "Scheduling holds the scheduling constraints to ensure that pods running with this RuntimeClass are scheduled to nodes that support it. If scheduling is nil, this RuntimeClass is assumed to be supported by all nodes.", } func (RuntimeClass) SwaggerDoc() map[string]string { @@ -48,14 +48,14 @@ func (RuntimeClassList) SwaggerDoc() map[string]string { return map_RuntimeClassList } -var map_Topology = map[string]string{ - "": "Topology specifies the scheduling constraints for nodes supporting a RuntimeClass.", - "nodeSelector": "NodeSelector selects the set of nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The NodeSelector is intersected (AND) with a pod's other NodeAffinity or NodeSelector requirements. A nil NodeSelector selects all nodes.", - "tolerations": "Tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", +var map_Scheduling = map[string]string{ + "": "Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.", + "nodeSelector": "nodeSelector lists labels that must be present on nodes that support this RuntimeClass. Pods using this RuntimeClass can only be scheduled to a node matched by this selector. The RuntimeClass nodeSelector is merged with a pod's existing nodeSelector. Any conflicts will cause the pod to be rejected in admission.", + "tolerations": "tolerations are appended (excluding duplicates) to pods running with this RuntimeClass during admission, effectively unioning the set of nodes tolerated by the pod and the RuntimeClass.", } -func (Topology) SwaggerDoc() map[string]string { - return map_Topology +func (Scheduling) SwaggerDoc() map[string]string { + return map_Scheduling } // AUTO-GENERATED FUNCTIONS END HERE diff --git a/staging/src/k8s.io/api/node/v1beta1/zz_generated.deepcopy.go b/staging/src/k8s.io/api/node/v1beta1/zz_generated.deepcopy.go index cccc806e89d..0e8d2d465d0 100644 --- a/staging/src/k8s.io/api/node/v1beta1/zz_generated.deepcopy.go +++ b/staging/src/k8s.io/api/node/v1beta1/zz_generated.deepcopy.go @@ -30,9 +30,9 @@ func (in *RuntimeClass) DeepCopyInto(out *RuntimeClass) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) + if in.Scheduling != nil { + in, out := &in.Scheduling, &out.Scheduling + *out = new(Scheduling) (*in).DeepCopyInto(*out) } return @@ -90,12 +90,14 @@ func (in *RuntimeClassList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { +func (in *Scheduling) DeepCopyInto(out *Scheduling) { *out = *in if in.NodeSelector != nil { in, out := &in.NodeSelector, &out.NodeSelector - *out = new(v1.NodeSelector) - (*in).DeepCopyInto(*out) + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } } if in.Tolerations != nil { in, out := &in.Tolerations, &out.Tolerations @@ -107,12 +109,12 @@ func (in *Topology) DeepCopyInto(out *Topology) { return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. -func (in *Topology) DeepCopy() *Topology { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Scheduling. +func (in *Scheduling) DeepCopy() *Scheduling { if in == nil { return nil } - out := new(Topology) + out := new(Scheduling) in.DeepCopyInto(out) return out }