diff --git a/go.mod b/go.mod index ca0569622..9952da201 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.17 require ( github.com/fsnotify/fsnotify v1.4.9 github.com/ghodss/yaml v1.0.0 + github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 github.com/google/go-cmp v0.5.5 github.com/jaypipes/ghw v0.8.1-0.20210827132705-c7224150a17e diff --git a/hack/boilerplate.go.txt b/hack/boilerplate.go.txt new file mode 100644 index 000000000..59e740c1e --- /dev/null +++ b/hack/boilerplate.go.txt @@ -0,0 +1,16 @@ +/* +Copyright YEAR The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + diff --git a/pkg/api/feature/generate.sh b/pkg/api/feature/generate.sh new file mode 100755 index 000000000..a9785cafe --- /dev/null +++ b/pkg/api/feature/generate.sh @@ -0,0 +1,16 @@ +#!/bin/sh -ex + +# go-to-protobuf seems unable to run in the package directory -> move to parent dir +cd .. +go-to-protobuf \ + --output-base=. \ + --go-header-file ../../hack/boilerplate.go.txt \ + --proto-import ../../vendor \ + --packages ./feature=feature \ + --keep-gogoproto=false \ + --apimachinery-packages "-k8s.io/apimachinery/pkg/util/intstr" +cd - + +# Mangle the go_package option to comply with newer versions protoc-gen-go +sed s',go_package =.*,go_package = "sigs.k8s.io/node-feature-discovery/pkg/api/feature";,' \ + -i generated.proto diff --git a/pkg/api/feature/generated.pb.go b/pkg/api/feature/generated.pb.go new file mode 100644 index 000000000..33df143cc --- /dev/null +++ b/pkg/api/feature/generated.pb.go @@ -0,0 +1,2033 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: feature/generated.proto + +package feature + +import ( + fmt "fmt" + + io "io" + math "math" + math_bits "math/bits" + reflect "reflect" + strings "strings" + + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +func (m *DomainFeatures) Reset() { *m = DomainFeatures{} } +func (*DomainFeatures) ProtoMessage() {} +func (*DomainFeatures) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{0} +} +func (m *DomainFeatures) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DomainFeatures) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *DomainFeatures) XXX_Merge(src proto.Message) { + xxx_messageInfo_DomainFeatures.Merge(m, src) +} +func (m *DomainFeatures) XXX_Size() int { + return m.Size() +} +func (m *DomainFeatures) XXX_DiscardUnknown() { + xxx_messageInfo_DomainFeatures.DiscardUnknown(m) +} + +var xxx_messageInfo_DomainFeatures proto.InternalMessageInfo + +func (m *InstanceFeature) Reset() { *m = InstanceFeature{} } +func (*InstanceFeature) ProtoMessage() {} +func (*InstanceFeature) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{1} +} +func (m *InstanceFeature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InstanceFeature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *InstanceFeature) XXX_Merge(src proto.Message) { + xxx_messageInfo_InstanceFeature.Merge(m, src) +} +func (m *InstanceFeature) XXX_Size() int { + return m.Size() +} +func (m *InstanceFeature) XXX_DiscardUnknown() { + xxx_messageInfo_InstanceFeature.DiscardUnknown(m) +} + +var xxx_messageInfo_InstanceFeature proto.InternalMessageInfo + +func (m *InstanceFeatureSet) Reset() { *m = InstanceFeatureSet{} } +func (*InstanceFeatureSet) ProtoMessage() {} +func (*InstanceFeatureSet) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{2} +} +func (m *InstanceFeatureSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InstanceFeatureSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *InstanceFeatureSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_InstanceFeatureSet.Merge(m, src) +} +func (m *InstanceFeatureSet) XXX_Size() int { + return m.Size() +} +func (m *InstanceFeatureSet) XXX_DiscardUnknown() { + xxx_messageInfo_InstanceFeatureSet.DiscardUnknown(m) +} + +var xxx_messageInfo_InstanceFeatureSet proto.InternalMessageInfo + +func (m *KeyFeatureSet) Reset() { *m = KeyFeatureSet{} } +func (*KeyFeatureSet) ProtoMessage() {} +func (*KeyFeatureSet) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{3} +} +func (m *KeyFeatureSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyFeatureSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *KeyFeatureSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyFeatureSet.Merge(m, src) +} +func (m *KeyFeatureSet) XXX_Size() int { + return m.Size() +} +func (m *KeyFeatureSet) XXX_DiscardUnknown() { + xxx_messageInfo_KeyFeatureSet.DiscardUnknown(m) +} + +var xxx_messageInfo_KeyFeatureSet proto.InternalMessageInfo + +func (m *Nil) Reset() { *m = Nil{} } +func (*Nil) ProtoMessage() {} +func (*Nil) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{4} +} +func (m *Nil) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Nil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *Nil) XXX_Merge(src proto.Message) { + xxx_messageInfo_Nil.Merge(m, src) +} +func (m *Nil) XXX_Size() int { + return m.Size() +} +func (m *Nil) XXX_DiscardUnknown() { + xxx_messageInfo_Nil.DiscardUnknown(m) +} + +var xxx_messageInfo_Nil proto.InternalMessageInfo + +func (m *ValueFeatureSet) Reset() { *m = ValueFeatureSet{} } +func (*ValueFeatureSet) ProtoMessage() {} +func (*ValueFeatureSet) Descriptor() ([]byte, []int) { + return fileDescriptor_870e6eafce4d2482, []int{5} +} +func (m *ValueFeatureSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValueFeatureSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *ValueFeatureSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValueFeatureSet.Merge(m, src) +} +func (m *ValueFeatureSet) XXX_Size() int { + return m.Size() +} +func (m *ValueFeatureSet) XXX_DiscardUnknown() { + xxx_messageInfo_ValueFeatureSet.DiscardUnknown(m) +} + +var xxx_messageInfo_ValueFeatureSet proto.InternalMessageInfo + +func init() { + proto.RegisterType((*DomainFeatures)(nil), "feature.DomainFeatures") + proto.RegisterMapType((map[string]InstanceFeatureSet)(nil), "feature.DomainFeatures.InstancesEntry") + proto.RegisterMapType((map[string]KeyFeatureSet)(nil), "feature.DomainFeatures.KeysEntry") + proto.RegisterMapType((map[string]ValueFeatureSet)(nil), "feature.DomainFeatures.ValuesEntry") + proto.RegisterType((*InstanceFeature)(nil), "feature.InstanceFeature") + proto.RegisterMapType((map[string]string)(nil), "feature.InstanceFeature.AttributesEntry") + proto.RegisterType((*InstanceFeatureSet)(nil), "feature.InstanceFeatureSet") + proto.RegisterType((*KeyFeatureSet)(nil), "feature.KeyFeatureSet") + proto.RegisterMapType((map[string]Nil)(nil), "feature.KeyFeatureSet.ElementsEntry") + proto.RegisterType((*Nil)(nil), "feature.Nil") + proto.RegisterType((*ValueFeatureSet)(nil), "feature.ValueFeatureSet") + proto.RegisterMapType((map[string]string)(nil), "feature.ValueFeatureSet.ElementsEntry") +} + +func init() { proto.RegisterFile("feature/generated.proto", fileDescriptor_870e6eafce4d2482) } + +var fileDescriptor_870e6eafce4d2482 = []byte{ + // 503 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0xbd, 0x71, 0x5b, 0xea, 0x49, 0x9b, 0x94, 0x15, 0x02, 0xcb, 0x48, 0xdb, 0x10, 0x50, + 0x95, 0x03, 0x75, 0x44, 0x4f, 0x08, 0xc4, 0x81, 0x40, 0x2b, 0x55, 0x91, 0x8a, 0xe4, 0x22, 0x10, + 0xa8, 0x17, 0xa7, 0x4c, 0x83, 0x55, 0xc7, 0x46, 0xf6, 0x1a, 0xc9, 0x37, 0x1e, 0x81, 0x87, 0xe0, + 0xcc, 0x73, 0xe4, 0xd8, 0x63, 0x4f, 0x15, 0x31, 0xaf, 0xc1, 0x01, 0x65, 0xbd, 0x76, 0xed, 0xc4, + 0x06, 0xf5, 0xe6, 0xdd, 0xfd, 0xff, 0x6f, 0xff, 0x99, 0x1d, 0x19, 0xee, 0x9d, 0xa1, 0xcd, 0xa3, + 0x00, 0xfb, 0x63, 0xf4, 0x30, 0xb0, 0x39, 0x7e, 0x32, 0xbf, 0x04, 0x3e, 0xf7, 0xe9, 0x2d, 0x79, + 0x60, 0xec, 0x8e, 0x1d, 0xfe, 0x39, 0x1a, 0x99, 0xa7, 0xfe, 0xa4, 0x3f, 0xf6, 0xc7, 0x7e, 0x5f, + 0x9c, 0x8f, 0xa2, 0x33, 0xb1, 0x12, 0x0b, 0xf1, 0x95, 0xfa, 0xba, 0x7f, 0x54, 0x68, 0xbd, 0xf6, + 0x27, 0xb6, 0xe3, 0x1d, 0xa4, 0x80, 0x90, 0xbe, 0x82, 0x95, 0x73, 0x8c, 0x43, 0x9d, 0x74, 0xd4, + 0x5e, 0x73, 0xef, 0x81, 0x29, 0xc9, 0x66, 0x59, 0x66, 0x0e, 0x31, 0x0e, 0xf7, 0x3d, 0x1e, 0xc4, + 0x83, 0x8d, 0xe9, 0xd5, 0xb6, 0x92, 0x5c, 0x6d, 0xaf, 0xcc, 0xb7, 0x2c, 0x61, 0xa6, 0x43, 0x58, + 0xfb, 0x6a, 0xbb, 0x11, 0x86, 0x7a, 0x43, 0x60, 0x1e, 0xd6, 0x61, 0xde, 0x09, 0x55, 0x0a, 0x6a, + 0x49, 0xd0, 0x5a, 0xba, 0x69, 0x49, 0x04, 0x7d, 0x0f, 0x9a, 0xe3, 0x85, 0xdc, 0xf6, 0x4e, 0x31, + 0xd4, 0x55, 0xc1, 0xdb, 0xa9, 0xe3, 0x1d, 0x66, 0xc2, 0x14, 0x79, 0x5b, 0x22, 0xb5, 0x7c, 0xdf, + 0xba, 0x66, 0x19, 0x6f, 0x40, 0xcb, 0xcb, 0xa0, 0x5b, 0xa0, 0x9e, 0x63, 0xac, 0x93, 0x0e, 0xe9, + 0x69, 0xd6, 0xfc, 0x93, 0x3e, 0x86, 0x55, 0x91, 0x40, 0x6f, 0x74, 0x48, 0xaf, 0xb9, 0x77, 0x37, + 0xbf, 0x73, 0x88, 0xb1, 0xbc, 0xf0, 0x18, 0xb9, 0x95, 0x8a, 0x9e, 0x35, 0x9e, 0x12, 0xe3, 0x18, + 0x9a, 0x85, 0x82, 0x2a, 0x90, 0x66, 0x19, 0xa9, 0xe7, 0x48, 0x61, 0xab, 0x86, 0x7e, 0x80, 0x56, + 0xb9, 0xaa, 0x0a, 0xee, 0x93, 0x32, 0xf7, 0x7e, 0xce, 0xcd, 0x9c, 0x95, 0xe8, 0xee, 0x4f, 0x02, + 0xed, 0x05, 0x05, 0x3d, 0x01, 0xb0, 0x39, 0x0f, 0x9c, 0x51, 0xc4, 0x31, 0x9b, 0x82, 0x5e, 0x1d, + 0xcf, 0x7c, 0x99, 0x4b, 0xd3, 0x86, 0x53, 0xd9, 0x70, 0xb8, 0x3e, 0xb0, 0x0a, 0x3c, 0xe3, 0x05, + 0xb4, 0x17, 0x2c, 0x15, 0xd5, 0xdc, 0x29, 0x56, 0xa3, 0x15, 0x03, 0x9f, 0x00, 0x5d, 0xae, 0x88, + 0x1e, 0xc0, 0x3a, 0xba, 0x38, 0x41, 0x8f, 0x67, 0x81, 0xf5, 0xba, 0xc0, 0x83, 0x2d, 0x19, 0x70, + 0x7d, 0x5f, 0x3a, 0xac, 0xdc, 0x3b, 0x6f, 0xc7, 0x66, 0xe9, 0x6d, 0xa9, 0xb5, 0x44, 0x7e, 0x54, + 0x3d, 0x05, 0x66, 0x86, 0x4b, 0xdb, 0xf0, 0x8f, 0x5b, 0x8c, 0x43, 0xd8, 0x2c, 0x89, 0x2b, 0x1a, + 0xd0, 0x2d, 0x3f, 0xe7, 0x46, 0x7e, 0xe7, 0x91, 0xe3, 0x16, 0xdb, 0xb1, 0x0a, 0xea, 0x91, 0xe3, + 0x76, 0x7f, 0x10, 0x68, 0x2f, 0x0c, 0x10, 0x7d, 0xbb, 0x94, 0x7c, 0xa7, 0x6e, 0xd8, 0x6e, 0x90, + 0xfd, 0xf9, 0xff, 0xb3, 0xd7, 0x3e, 0xde, 0x60, 0x77, 0x3a, 0x63, 0xca, 0xc5, 0x8c, 0x29, 0x97, + 0x33, 0xa6, 0x7c, 0x4b, 0x18, 0x99, 0x26, 0x8c, 0x5c, 0x24, 0x8c, 0x5c, 0x26, 0x8c, 0xfc, 0x4a, + 0x18, 0xf9, 0xfe, 0x9b, 0x29, 0x1f, 0xb3, 0x5f, 0xd9, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1f, + 0x6e, 0x71, 0x14, 0xed, 0x04, 0x00, 0x00, +} + +func (m *DomainFeatures) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DomainFeatures) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DomainFeatures) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Instances) > 0 { + keysForInstances := make([]string, 0, len(m.Instances)) + for k := range m.Instances { + keysForInstances = append(keysForInstances, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInstances) + for iNdEx := len(keysForInstances) - 1; iNdEx >= 0; iNdEx-- { + v := m.Instances[string(keysForInstances[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForInstances[iNdEx]) + copy(dAtA[i:], keysForInstances[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForInstances[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Values) > 0 { + keysForValues := make([]string, 0, len(m.Values)) + for k := range m.Values { + keysForValues = append(keysForValues, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForValues) + for iNdEx := len(keysForValues) - 1; iNdEx >= 0; iNdEx-- { + v := m.Values[string(keysForValues[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForValues[iNdEx]) + copy(dAtA[i:], keysForValues[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForValues[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Keys) > 0 { + keysForKeys := make([]string, 0, len(m.Keys)) + for k := range m.Keys { + keysForKeys = append(keysForKeys, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKeys) + for iNdEx := len(keysForKeys) - 1; iNdEx >= 0; iNdEx-- { + v := m.Keys[string(keysForKeys[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForKeys[iNdEx]) + copy(dAtA[i:], keysForKeys[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForKeys[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *InstanceFeature) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InstanceFeature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InstanceFeature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attributes) > 0 { + keysForAttributes := make([]string, 0, len(m.Attributes)) + for k := range m.Attributes { + keysForAttributes = append(keysForAttributes, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes) + for iNdEx := len(keysForAttributes) - 1; iNdEx >= 0; iNdEx-- { + v := m.Attributes[string(keysForAttributes[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForAttributes[iNdEx]) + copy(dAtA[i:], keysForAttributes[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForAttributes[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *InstanceFeatureSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InstanceFeatureSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InstanceFeatureSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Elements) > 0 { + for iNdEx := len(m.Elements) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Elements[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *KeyFeatureSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *KeyFeatureSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *KeyFeatureSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Elements) > 0 { + keysForElements := make([]string, 0, len(m.Elements)) + for k := range m.Elements { + keysForElements = append(keysForElements, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForElements) + for iNdEx := len(keysForElements) - 1; iNdEx >= 0; iNdEx-- { + v := m.Elements[string(keysForElements[iNdEx])] + baseI := i + { + size, err := (&v).MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + i -= len(keysForElements[iNdEx]) + copy(dAtA[i:], keysForElements[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForElements[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Nil) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Nil) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Nil) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ValueFeatureSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValueFeatureSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValueFeatureSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Elements) > 0 { + keysForElements := make([]string, 0, len(m.Elements)) + for k := range m.Elements { + keysForElements = append(keysForElements, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForElements) + for iNdEx := len(keysForElements) - 1; iNdEx >= 0; iNdEx-- { + v := m.Elements[string(keysForElements[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForElements[iNdEx]) + copy(dAtA[i:], keysForElements[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForElements[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { + offset -= sovGenerated(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DomainFeatures) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Keys) > 0 { + for k, v := range m.Keys { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Values) > 0 { + for k, v := range m.Values { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + if len(m.Instances) > 0 { + for k, v := range m.Instances { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *InstanceFeature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Attributes) > 0 { + for k, v := range m.Attributes { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *InstanceFeatureSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Elements) > 0 { + for _, e := range m.Elements { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + return n +} + +func (m *KeyFeatureSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Elements) > 0 { + for k, v := range m.Elements { + _ = k + _ = v + l = v.Size() + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + l + sovGenerated(uint64(l)) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func (m *Nil) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ValueFeatureSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Elements) > 0 { + for k, v := range m.Elements { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + +func sovGenerated(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenerated(x uint64) (n int) { + return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *DomainFeatures) String() string { + if this == nil { + return "nil" + } + keysForKeys := make([]string, 0, len(this.Keys)) + for k := range this.Keys { + keysForKeys = append(keysForKeys, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForKeys) + mapStringForKeys := "map[string]KeyFeatureSet{" + for _, k := range keysForKeys { + mapStringForKeys += fmt.Sprintf("%v: %v,", k, this.Keys[k]) + } + mapStringForKeys += "}" + keysForValues := make([]string, 0, len(this.Values)) + for k := range this.Values { + keysForValues = append(keysForValues, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForValues) + mapStringForValues := "map[string]ValueFeatureSet{" + for _, k := range keysForValues { + mapStringForValues += fmt.Sprintf("%v: %v,", k, this.Values[k]) + } + mapStringForValues += "}" + keysForInstances := make([]string, 0, len(this.Instances)) + for k := range this.Instances { + keysForInstances = append(keysForInstances, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForInstances) + mapStringForInstances := "map[string]InstanceFeatureSet{" + for _, k := range keysForInstances { + mapStringForInstances += fmt.Sprintf("%v: %v,", k, this.Instances[k]) + } + mapStringForInstances += "}" + s := strings.Join([]string{`&DomainFeatures{`, + `Keys:` + mapStringForKeys + `,`, + `Values:` + mapStringForValues + `,`, + `Instances:` + mapStringForInstances + `,`, + `}`, + }, "") + return s +} +func (this *InstanceFeature) String() string { + if this == nil { + return "nil" + } + keysForAttributes := make([]string, 0, len(this.Attributes)) + for k := range this.Attributes { + keysForAttributes = append(keysForAttributes, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForAttributes) + mapStringForAttributes := "map[string]string{" + for _, k := range keysForAttributes { + mapStringForAttributes += fmt.Sprintf("%v: %v,", k, this.Attributes[k]) + } + mapStringForAttributes += "}" + s := strings.Join([]string{`&InstanceFeature{`, + `Attributes:` + mapStringForAttributes + `,`, + `}`, + }, "") + return s +} +func (this *InstanceFeatureSet) String() string { + if this == nil { + return "nil" + } + repeatedStringForElements := "[]InstanceFeature{" + for _, f := range this.Elements { + repeatedStringForElements += strings.Replace(strings.Replace(f.String(), "InstanceFeature", "InstanceFeature", 1), `&`, ``, 1) + "," + } + repeatedStringForElements += "}" + s := strings.Join([]string{`&InstanceFeatureSet{`, + `Elements:` + repeatedStringForElements + `,`, + `}`, + }, "") + return s +} +func (this *KeyFeatureSet) String() string { + if this == nil { + return "nil" + } + keysForElements := make([]string, 0, len(this.Elements)) + for k := range this.Elements { + keysForElements = append(keysForElements, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForElements) + mapStringForElements := "map[string]Nil{" + for _, k := range keysForElements { + mapStringForElements += fmt.Sprintf("%v: %v,", k, this.Elements[k]) + } + mapStringForElements += "}" + s := strings.Join([]string{`&KeyFeatureSet{`, + `Elements:` + mapStringForElements + `,`, + `}`, + }, "") + return s +} +func (this *Nil) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Nil{`, + `}`, + }, "") + return s +} +func (this *ValueFeatureSet) String() string { + if this == nil { + return "nil" + } + keysForElements := make([]string, 0, len(this.Elements)) + for k := range this.Elements { + keysForElements = append(keysForElements, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForElements) + mapStringForElements := "map[string]string{" + for _, k := range keysForElements { + mapStringForElements += fmt.Sprintf("%v: %v,", k, this.Elements[k]) + } + mapStringForElements += "}" + s := strings.Join([]string{`&ValueFeatureSet{`, + `Elements:` + mapStringForElements + `,`, + `}`, + }, "") + return s +} +func valueToStringGenerated(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *DomainFeatures) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DomainFeatures: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DomainFeatures: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Keys == nil { + m.Keys = make(map[string]KeyFeatureSet) + } + var mapkey string + mapvalue := &KeyFeatureSet{} + 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 < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &KeyFeatureSet{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Keys[mapkey] = *mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Values == nil { + m.Values = make(map[string]ValueFeatureSet) + } + var mapkey string + mapvalue := &ValueFeatureSet{} + 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 < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &ValueFeatureSet{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Values[mapkey] = *mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Instances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Instances == nil { + m.Instances = make(map[string]InstanceFeatureSet) + } + var mapkey string + mapvalue := &InstanceFeatureSet{} + 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 < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &InstanceFeatureSet{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Instances[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InstanceFeature) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InstanceFeature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InstanceFeature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Attributes == nil { + m.Attributes = make(map[string]string) + } + 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 < 0 { + return ErrInvalidLengthGenerated + } + 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 < 0 { + return ErrInvalidLengthGenerated + } + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Attributes[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *InstanceFeatureSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: InstanceFeatureSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InstanceFeatureSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Elements", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Elements = append(m.Elements, InstanceFeature{}) + if err := m.Elements[len(m.Elements)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KeyFeatureSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyFeatureSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyFeatureSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Elements", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Elements == nil { + m.Elements = make(map[string]Nil) + } + var mapkey string + mapvalue := &Nil{} + 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 < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthGenerated + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthGenerated + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &Nil{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Elements[mapkey] = *mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Nil) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Nil: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Nil: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValueFeatureSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := 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) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValueFeatureSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueFeatureSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Elements", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Elements == nil { + m.Elements = make(map[string]string) + } + 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 < 0 { + return ErrInvalidLengthGenerated + } + 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 < 0 { + return ErrInvalidLengthGenerated + } + 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) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Elements[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenerated(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenerated + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenerated + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") +) diff --git a/pkg/api/feature/generated.proto b/pkg/api/feature/generated.proto new file mode 100644 index 000000000..c3ae18b33 --- /dev/null +++ b/pkg/api/feature/generated.proto @@ -0,0 +1,59 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package feature; + +// Package-wide variables from generator "generated". +option go_package = "sigs.k8s.io/node-feature-discovery/pkg/api/feature"; + +// DomainFeatures is the collection of all discovered features of one domain. +message DomainFeatures { + map keys = 1; + + map values = 2; + + map instances = 3; +} + +// InstanceFeature represents one instance of a complex features, e.g. a device. +message InstanceFeature { + map attributes = 1; +} + +// InstanceFeatureSet is a set of features each of which is an instance having multiple attributes. +message InstanceFeatureSet { + repeated InstanceFeature elements = 1; +} + +// KeyFeatureSet is a set of simple features only containing names without values. +message KeyFeatureSet { + map elements = 1; +} + +// Nil is a dummy empty struct for protobuf compatibility +message Nil { +} + +// ValueFeatureSet is a set of features having string value. +message ValueFeatureSet { + map elements = 1; +} + diff --git a/pkg/api/feature/types.go b/pkg/api/feature/types.go index dbcf6655a..4665ad63d 100644 --- a/pkg/api/feature/types.go +++ b/pkg/api/feature/types.go @@ -16,6 +16,8 @@ limitations under the License. package feature +//go:generate ./generate.sh + // Features is a collection of all features of the system, arranged by domain. // +protobuf type Features map[string]*DomainFeatures diff --git a/pkg/labeler/doc.go b/pkg/labeler/doc.go index d66c1a096..bc4774157 100644 --- a/pkg/labeler/doc.go +++ b/pkg/labeler/doc.go @@ -16,5 +16,5 @@ limitations under the License. package labeler -//go:generate protoc --go_opt=paths=source_relative --go_out=plugins=grpc:. labeler.proto +//go:generate protoc --go_opt=paths=source_relative --go_out=plugins=grpc:. -I . -I ../.. -I ../../vendor labeler.proto //go:generate mockery --name=LabelerClient --inpkg diff --git a/pkg/labeler/labeler.pb.go b/pkg/labeler/labeler.pb.go index 4a32dca37..c167403ca 100644 --- a/pkg/labeler/labeler.pb.go +++ b/pkg/labeler/labeler.pb.go @@ -30,6 +30,7 @@ import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" + feature "sigs.k8s.io/node-feature-discovery/pkg/api/feature" sync "sync" ) @@ -49,9 +50,10 @@ type SetLabelsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NfdVersion string `protobuf:"bytes,1,opt,name=nfd_version,json=nfdVersion,proto3" json:"nfd_version,omitempty"` - NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` - Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + NfdVersion string `protobuf:"bytes,1,opt,name=nfd_version,json=nfdVersion,proto3" json:"nfd_version,omitempty"` + NodeName string `protobuf:"bytes,2,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Features map[string]*feature.DomainFeatures `protobuf:"bytes,4,rep,name=features,proto3" json:"features,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (x *SetLabelsRequest) Reset() { @@ -107,6 +109,13 @@ func (x *SetLabelsRequest) GetLabels() map[string]string { return nil } +func (x *SetLabelsRequest) GetFeatures() map[string]*feature.DomainFeatures { + if x != nil { + return x.Features + } + return nil +} + type SetLabelsReply struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -149,29 +158,41 @@ var File_labeler_proto protoreflect.FileDescriptor var file_labeler_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x07, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x22, 0xca, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x6e, 0x66, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x66, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1b, - 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x6c, - 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6c, 0x61, + 0x07, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x1a, 0x1f, 0x70, 0x6b, 0x67, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x02, 0x0a, 0x10, 0x53, 0x65, + 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, + 0x0a, 0x0b, 0x6e, 0x66, 0x64, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x66, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, + 0x1b, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x43, 0x0a, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, + 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x54, 0x0a, 0x0d, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2d, + 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x32, 0x4c, 0x0a, 0x07, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x12, 0x41, + 0x0a, 0x09, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x19, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x32, 0x4c, 0x0a, 0x07, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x65, 0x72, 0x12, 0x41, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, - 0x19, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x65, 0x72, 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x30, 0x5a, 0x2e, 0x73, 0x69, 0x67, 0x73, 0x2e, 0x6b, 0x38, - 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, - 0x65, 0x2d, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, - 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x65, 0x72, + 0x2e, 0x53, 0x65, 0x74, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, + 0x00, 0x42, 0x30, 0x5a, 0x2e, 0x73, 0x69, 0x67, 0x73, 0x2e, 0x6b, 0x38, 0x73, 0x2e, 0x69, 0x6f, + 0x2f, 0x6e, 0x6f, 0x64, 0x65, 0x2d, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x2d, 0x64, 0x69, + 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -186,21 +207,25 @@ func file_labeler_proto_rawDescGZIP() []byte { return file_labeler_proto_rawDescData } -var file_labeler_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_labeler_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_labeler_proto_goTypes = []interface{}{ - (*SetLabelsRequest)(nil), // 0: labeler.SetLabelsRequest - (*SetLabelsReply)(nil), // 1: labeler.SetLabelsReply - nil, // 2: labeler.SetLabelsRequest.LabelsEntry + (*SetLabelsRequest)(nil), // 0: labeler.SetLabelsRequest + (*SetLabelsReply)(nil), // 1: labeler.SetLabelsReply + nil, // 2: labeler.SetLabelsRequest.LabelsEntry + nil, // 3: labeler.SetLabelsRequest.FeaturesEntry + (*feature.DomainFeatures)(nil), // 4: feature.DomainFeatures } var file_labeler_proto_depIdxs = []int32{ 2, // 0: labeler.SetLabelsRequest.labels:type_name -> labeler.SetLabelsRequest.LabelsEntry - 0, // 1: labeler.Labeler.SetLabels:input_type -> labeler.SetLabelsRequest - 1, // 2: labeler.Labeler.SetLabels:output_type -> labeler.SetLabelsReply - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 3, // 1: labeler.SetLabelsRequest.features:type_name -> labeler.SetLabelsRequest.FeaturesEntry + 4, // 2: labeler.SetLabelsRequest.FeaturesEntry.value:type_name -> feature.DomainFeatures + 0, // 3: labeler.Labeler.SetLabels:input_type -> labeler.SetLabelsRequest + 1, // 4: labeler.Labeler.SetLabels:output_type -> labeler.SetLabelsReply + 4, // [4:5] is the sub-list for method output_type + 3, // [3:4] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_labeler_proto_init() } @@ -240,7 +265,7 @@ func file_labeler_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_labeler_proto_rawDesc, NumEnums: 0, - NumMessages: 3, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/labeler/labeler.proto b/pkg/labeler/labeler.proto index 889cc3b78..6448e6044 100644 --- a/pkg/labeler/labeler.proto +++ b/pkg/labeler/labeler.proto @@ -18,6 +18,8 @@ syntax = "proto3"; option go_package = "sigs.k8s.io/node-feature-discovery/pkg/labeler"; +import "pkg/api/feature/generated.proto"; + package labeler; service Labeler{ @@ -28,8 +30,8 @@ message SetLabelsRequest { string nfd_version = 1; string node_name = 2; map labels = 3; + map features = 4; } message SetLabelsReply { } -