diff --git a/Dockerfile_generator b/Dockerfile_generator index ece1fa44c0..cc874bd572 100644 --- a/Dockerfile_generator +++ b/Dockerfile_generator @@ -5,18 +5,7 @@ FROM ${BUILDER_IMAGE} as builder RUN --mount=type=cache,target=/go/pkg/mod/ \ go install github.com/vektra/mockery/v2@v2.42.0 && \ go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.3 && \ - go install golang.org/x/tools/cmd/goimports@v0.25.0 && \ - go install github.com/golang/protobuf/protoc-gen-go@v1.4.3 - -RUN apt-get update && apt-get install unzip - -RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip && \ - unzip protoc-25.3-linux-x86_64.zip -d /usr/local && \ - rm protoc-25.3-linux-x86_64.zip && \ - chmod a+x /usr/local/bin/protoc && \ - find /usr/local -type d | xargs chmod 755 && \ - find /usr/local -type f | xargs chmod a+r - + go install golang.org/x/tools/cmd/goimports@v0.25.0 # Expect to be working with nfd WORKDIR /go/node-feature-discovery diff --git a/api/generated/clientset/versioned/clientset.go b/api/generated/clientset/versioned/clientset.go index 9891a34369..44f1292010 100644 --- a/api/generated/clientset/versioned/clientset.go +++ b/api/generated/clientset/versioned/clientset.go @@ -19,8 +19,8 @@ limitations under the License. package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nfd_client.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nfd_client.go index 282a6e717b..e84e6e3e13 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nfd_client.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nfd_client.go @@ -29,15 +29,15 @@ type FakeNfdV1alpha1 struct { } func (c *FakeNfdV1alpha1) NodeFeatures(namespace string) v1alpha1.NodeFeatureInterface { - return &FakeNodeFeatures{c, namespace} + return newFakeNodeFeatures(c, namespace) } func (c *FakeNfdV1alpha1) NodeFeatureGroups(namespace string) v1alpha1.NodeFeatureGroupInterface { - return &FakeNodeFeatureGroups{c, namespace} + return newFakeNodeFeatureGroups(c, namespace) } func (c *FakeNfdV1alpha1) NodeFeatureRules() v1alpha1.NodeFeatureRuleInterface { - return &FakeNodeFeatureRules{c} + return newFakeNodeFeatureRules(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeature.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeature.go index 186ce23882..a7356c9c8c 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeature.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeature.go @@ -19,116 +19,34 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/typed/nfd/v1alpha1" v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) -// FakeNodeFeatures implements NodeFeatureInterface -type FakeNodeFeatures struct { +// fakeNodeFeatures implements NodeFeatureInterface +type fakeNodeFeatures struct { + *gentype.FakeClientWithList[*v1alpha1.NodeFeature, *v1alpha1.NodeFeatureList] Fake *FakeNfdV1alpha1 - ns string -} - -var nodefeaturesResource = v1alpha1.SchemeGroupVersion.WithResource("nodefeatures") - -var nodefeaturesKind = v1alpha1.SchemeGroupVersion.WithKind("NodeFeature") - -// Get takes name of the nodeFeature, and returns the corresponding nodeFeature object, and an error if there is any. -func (c *FakeNodeFeatures) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeFeature, err error) { - emptyResult := &v1alpha1.NodeFeature{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(nodefeaturesResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeature), err -} - -// List takes label and field selectors, and returns the list of NodeFeatures that match those selectors. -func (c *FakeNodeFeatures) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeFeatureList, err error) { - emptyResult := &v1alpha1.NodeFeatureList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(nodefeaturesResource, nodefeaturesKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.NodeFeatureList{ListMeta: obj.(*v1alpha1.NodeFeatureList).ListMeta} - for _, item := range obj.(*v1alpha1.NodeFeatureList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested nodeFeatures. -func (c *FakeNodeFeatures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(nodefeaturesResource, c.ns, opts)) - -} - -// Create takes the representation of a nodeFeature and creates it. Returns the server's representation of the nodeFeature, and an error, if there is any. -func (c *FakeNodeFeatures) Create(ctx context.Context, nodeFeature *v1alpha1.NodeFeature, opts v1.CreateOptions) (result *v1alpha1.NodeFeature, err error) { - emptyResult := &v1alpha1.NodeFeature{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(nodefeaturesResource, c.ns, nodeFeature, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeature), err -} - -// Update takes the representation of a nodeFeature and updates it. Returns the server's representation of the nodeFeature, and an error, if there is any. -func (c *FakeNodeFeatures) Update(ctx context.Context, nodeFeature *v1alpha1.NodeFeature, opts v1.UpdateOptions) (result *v1alpha1.NodeFeature, err error) { - emptyResult := &v1alpha1.NodeFeature{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(nodefeaturesResource, c.ns, nodeFeature, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeature), err -} - -// Delete takes name of the nodeFeature and deletes it. Returns an error if one occurs. -func (c *FakeNodeFeatures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(nodefeaturesResource, c.ns, name, opts), &v1alpha1.NodeFeature{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeFeatures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(nodefeaturesResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.NodeFeatureList{}) - return err -} - -// Patch applies the patch and returns the patched nodeFeature. -func (c *FakeNodeFeatures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeature, err error) { - emptyResult := &v1alpha1.NodeFeature{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(nodefeaturesResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeNodeFeatures(fake *FakeNfdV1alpha1, namespace string) nfdv1alpha1.NodeFeatureInterface { + return &fakeNodeFeatures{ + gentype.NewFakeClientWithList[*v1alpha1.NodeFeature, *v1alpha1.NodeFeatureList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("nodefeatures"), + v1alpha1.SchemeGroupVersion.WithKind("NodeFeature"), + func() *v1alpha1.NodeFeature { return &v1alpha1.NodeFeature{} }, + func() *v1alpha1.NodeFeatureList { return &v1alpha1.NodeFeatureList{} }, + func(dst, src *v1alpha1.NodeFeatureList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.NodeFeatureList) []*v1alpha1.NodeFeature { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.NodeFeatureList, items []*v1alpha1.NodeFeature) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.NodeFeature), err } diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturegroup.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturegroup.go index fdcacc9686..cc4ae10706 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturegroup.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturegroup.go @@ -19,129 +19,34 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/typed/nfd/v1alpha1" v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) -// FakeNodeFeatureGroups implements NodeFeatureGroupInterface -type FakeNodeFeatureGroups struct { +// fakeNodeFeatureGroups implements NodeFeatureGroupInterface +type fakeNodeFeatureGroups struct { + *gentype.FakeClientWithList[*v1alpha1.NodeFeatureGroup, *v1alpha1.NodeFeatureGroupList] Fake *FakeNfdV1alpha1 - ns string -} - -var nodefeaturegroupsResource = v1alpha1.SchemeGroupVersion.WithResource("nodefeaturegroups") - -var nodefeaturegroupsKind = v1alpha1.SchemeGroupVersion.WithKind("NodeFeatureGroup") - -// Get takes name of the nodeFeatureGroup, and returns the corresponding nodeFeatureGroup object, and an error if there is any. -func (c *FakeNodeFeatureGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeFeatureGroup, err error) { - emptyResult := &v1alpha1.NodeFeatureGroup{} - obj, err := c.Fake. - Invokes(testing.NewGetActionWithOptions(nodefeaturegroupsResource, c.ns, name, options), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureGroup), err -} - -// List takes label and field selectors, and returns the list of NodeFeatureGroups that match those selectors. -func (c *FakeNodeFeatureGroups) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeFeatureGroupList, err error) { - emptyResult := &v1alpha1.NodeFeatureGroupList{} - obj, err := c.Fake. - Invokes(testing.NewListActionWithOptions(nodefeaturegroupsResource, nodefeaturegroupsKind, c.ns, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.NodeFeatureGroupList{ListMeta: obj.(*v1alpha1.NodeFeatureGroupList).ListMeta} - for _, item := range obj.(*v1alpha1.NodeFeatureGroupList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested nodeFeatureGroups. -func (c *FakeNodeFeatureGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewWatchActionWithOptions(nodefeaturegroupsResource, c.ns, opts)) - -} - -// Create takes the representation of a nodeFeatureGroup and creates it. Returns the server's representation of the nodeFeatureGroup, and an error, if there is any. -func (c *FakeNodeFeatureGroups) Create(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.CreateOptions) (result *v1alpha1.NodeFeatureGroup, err error) { - emptyResult := &v1alpha1.NodeFeatureGroup{} - obj, err := c.Fake. - Invokes(testing.NewCreateActionWithOptions(nodefeaturegroupsResource, c.ns, nodeFeatureGroup, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureGroup), err -} - -// Update takes the representation of a nodeFeatureGroup and updates it. Returns the server's representation of the nodeFeatureGroup, and an error, if there is any. -func (c *FakeNodeFeatureGroups) Update(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (result *v1alpha1.NodeFeatureGroup, err error) { - emptyResult := &v1alpha1.NodeFeatureGroup{} - obj, err := c.Fake. - Invokes(testing.NewUpdateActionWithOptions(nodefeaturegroupsResource, c.ns, nodeFeatureGroup, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureGroup), err -} - -// UpdateStatus was generated because the type contains a Status member. -// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeNodeFeatureGroups) UpdateStatus(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (result *v1alpha1.NodeFeatureGroup, err error) { - emptyResult := &v1alpha1.NodeFeatureGroup{} - obj, err := c.Fake. - Invokes(testing.NewUpdateSubresourceActionWithOptions(nodefeaturegroupsResource, "status", c.ns, nodeFeatureGroup, opts), emptyResult) - - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureGroup), err -} - -// Delete takes name of the nodeFeatureGroup and deletes it. Returns an error if one occurs. -func (c *FakeNodeFeatureGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewDeleteActionWithOptions(nodefeaturegroupsResource, c.ns, name, opts), &v1alpha1.NodeFeatureGroup{}) - - return err } -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeFeatureGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewDeleteCollectionActionWithOptions(nodefeaturegroupsResource, c.ns, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.NodeFeatureGroupList{}) - return err -} - -// Patch applies the patch and returns the patched nodeFeatureGroup. -func (c *FakeNodeFeatureGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeatureGroup, err error) { - emptyResult := &v1alpha1.NodeFeatureGroup{} - obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceActionWithOptions(nodefeaturegroupsResource, c.ns, name, pt, data, opts, subresources...), emptyResult) - - if obj == nil { - return emptyResult, err +func newFakeNodeFeatureGroups(fake *FakeNfdV1alpha1, namespace string) nfdv1alpha1.NodeFeatureGroupInterface { + return &fakeNodeFeatureGroups{ + gentype.NewFakeClientWithList[*v1alpha1.NodeFeatureGroup, *v1alpha1.NodeFeatureGroupList]( + fake.Fake, + namespace, + v1alpha1.SchemeGroupVersion.WithResource("nodefeaturegroups"), + v1alpha1.SchemeGroupVersion.WithKind("NodeFeatureGroup"), + func() *v1alpha1.NodeFeatureGroup { return &v1alpha1.NodeFeatureGroup{} }, + func() *v1alpha1.NodeFeatureGroupList { return &v1alpha1.NodeFeatureGroupList{} }, + func(dst, src *v1alpha1.NodeFeatureGroupList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.NodeFeatureGroupList) []*v1alpha1.NodeFeatureGroup { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.NodeFeatureGroupList, items []*v1alpha1.NodeFeatureGroup) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.NodeFeatureGroup), err } diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturerule.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturerule.go index b2916717ca..6986116dc9 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturerule.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/fake/fake_nodefeaturerule.go @@ -19,108 +19,34 @@ limitations under the License. package fake import ( - "context" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" + gentype "k8s.io/client-go/gentype" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/typed/nfd/v1alpha1" v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) -// FakeNodeFeatureRules implements NodeFeatureRuleInterface -type FakeNodeFeatureRules struct { +// fakeNodeFeatureRules implements NodeFeatureRuleInterface +type fakeNodeFeatureRules struct { + *gentype.FakeClientWithList[*v1alpha1.NodeFeatureRule, *v1alpha1.NodeFeatureRuleList] Fake *FakeNfdV1alpha1 } -var nodefeaturerulesResource = v1alpha1.SchemeGroupVersion.WithResource("nodefeaturerules") - -var nodefeaturerulesKind = v1alpha1.SchemeGroupVersion.WithKind("NodeFeatureRule") - -// Get takes name of the nodeFeatureRule, and returns the corresponding nodeFeatureRule object, and an error if there is any. -func (c *FakeNodeFeatureRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NodeFeatureRule, err error) { - emptyResult := &v1alpha1.NodeFeatureRule{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(nodefeaturerulesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureRule), err -} - -// List takes label and field selectors, and returns the list of NodeFeatureRules that match those selectors. -func (c *FakeNodeFeatureRules) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NodeFeatureRuleList, err error) { - emptyResult := &v1alpha1.NodeFeatureRuleList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(nodefeaturerulesResource, nodefeaturerulesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.NodeFeatureRuleList{ListMeta: obj.(*v1alpha1.NodeFeatureRuleList).ListMeta} - for _, item := range obj.(*v1alpha1.NodeFeatureRuleList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested nodeFeatureRules. -func (c *FakeNodeFeatureRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(nodefeaturerulesResource, opts)) -} - -// Create takes the representation of a nodeFeatureRule and creates it. Returns the server's representation of the nodeFeatureRule, and an error, if there is any. -func (c *FakeNodeFeatureRules) Create(ctx context.Context, nodeFeatureRule *v1alpha1.NodeFeatureRule, opts v1.CreateOptions) (result *v1alpha1.NodeFeatureRule, err error) { - emptyResult := &v1alpha1.NodeFeatureRule{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(nodefeaturerulesResource, nodeFeatureRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureRule), err -} - -// Update takes the representation of a nodeFeatureRule and updates it. Returns the server's representation of the nodeFeatureRule, and an error, if there is any. -func (c *FakeNodeFeatureRules) Update(ctx context.Context, nodeFeatureRule *v1alpha1.NodeFeatureRule, opts v1.UpdateOptions) (result *v1alpha1.NodeFeatureRule, err error) { - emptyResult := &v1alpha1.NodeFeatureRule{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(nodefeaturerulesResource, nodeFeatureRule, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NodeFeatureRule), err -} - -// Delete takes name of the nodeFeatureRule and deletes it. Returns an error if one occurs. -func (c *FakeNodeFeatureRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(nodefeaturerulesResource, name, opts), &v1alpha1.NodeFeatureRule{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNodeFeatureRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(nodefeaturerulesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.NodeFeatureRuleList{}) - return err -} - -// Patch applies the patch and returns the patched nodeFeatureRule. -func (c *FakeNodeFeatureRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeatureRule, err error) { - emptyResult := &v1alpha1.NodeFeatureRule{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(nodefeaturerulesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeNodeFeatureRules(fake *FakeNfdV1alpha1) nfdv1alpha1.NodeFeatureRuleInterface { + return &fakeNodeFeatureRules{ + gentype.NewFakeClientWithList[*v1alpha1.NodeFeatureRule, *v1alpha1.NodeFeatureRuleList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("nodefeaturerules"), + v1alpha1.SchemeGroupVersion.WithKind("NodeFeatureRule"), + func() *v1alpha1.NodeFeatureRule { return &v1alpha1.NodeFeatureRule{} }, + func() *v1alpha1.NodeFeatureRuleList { return &v1alpha1.NodeFeatureRuleList{} }, + func(dst, src *v1alpha1.NodeFeatureRuleList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.NodeFeatureRuleList) []*v1alpha1.NodeFeatureRule { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.NodeFeatureRuleList, items []*v1alpha1.NodeFeatureRule) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.NodeFeatureRule), err } diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nfd_client.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nfd_client.go index 37a6f340aa..4776a6c83c 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nfd_client.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nfd_client.go @@ -19,11 +19,11 @@ limitations under the License. package v1alpha1 import ( - "net/http" + http "net/http" rest "k8s.io/client-go/rest" - "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + scheme "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) type NfdV1alpha1Interface interface { @@ -95,10 +95,10 @@ func New(c rest.Interface) *NfdV1alpha1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := nfdv1alpha1.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" - config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() if config.UserAgent == "" { config.UserAgent = rest.DefaultKubernetesUserAgent() diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeature.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeature.go index 15e4e70138..70b8540467 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeature.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeature.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" scheme "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeaturesGetter has a method to return a NodeFeatureInterface. @@ -37,31 +37,32 @@ type NodeFeaturesGetter interface { // NodeFeatureInterface has methods to work with NodeFeature resources. type NodeFeatureInterface interface { - Create(ctx context.Context, nodeFeature *v1alpha1.NodeFeature, opts v1.CreateOptions) (*v1alpha1.NodeFeature, error) - Update(ctx context.Context, nodeFeature *v1alpha1.NodeFeature, opts v1.UpdateOptions) (*v1alpha1.NodeFeature, error) + Create(ctx context.Context, nodeFeature *nfdv1alpha1.NodeFeature, opts v1.CreateOptions) (*nfdv1alpha1.NodeFeature, error) + Update(ctx context.Context, nodeFeature *nfdv1alpha1.NodeFeature, opts v1.UpdateOptions) (*nfdv1alpha1.NodeFeature, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.NodeFeature, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NodeFeatureList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*nfdv1alpha1.NodeFeature, error) + List(ctx context.Context, opts v1.ListOptions) (*nfdv1alpha1.NodeFeatureList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeature, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nfdv1alpha1.NodeFeature, err error) NodeFeatureExpansion } // nodeFeatures implements NodeFeatureInterface type nodeFeatures struct { - *gentype.ClientWithList[*v1alpha1.NodeFeature, *v1alpha1.NodeFeatureList] + *gentype.ClientWithList[*nfdv1alpha1.NodeFeature, *nfdv1alpha1.NodeFeatureList] } // newNodeFeatures returns a NodeFeatures func newNodeFeatures(c *NfdV1alpha1Client, namespace string) *nodeFeatures { return &nodeFeatures{ - gentype.NewClientWithList[*v1alpha1.NodeFeature, *v1alpha1.NodeFeatureList]( + gentype.NewClientWithList[*nfdv1alpha1.NodeFeature, *nfdv1alpha1.NodeFeatureList]( "nodefeatures", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.NodeFeature { return &v1alpha1.NodeFeature{} }, - func() *v1alpha1.NodeFeatureList { return &v1alpha1.NodeFeatureList{} }), + func() *nfdv1alpha1.NodeFeature { return &nfdv1alpha1.NodeFeature{} }, + func() *nfdv1alpha1.NodeFeatureList { return &nfdv1alpha1.NodeFeatureList{} }, + ), } } diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturegroup.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturegroup.go index 7d7e186c20..cdee1eb7b9 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturegroup.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturegroup.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" scheme "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureGroupsGetter has a method to return a NodeFeatureGroupInterface. @@ -37,33 +37,34 @@ type NodeFeatureGroupsGetter interface { // NodeFeatureGroupInterface has methods to work with NodeFeatureGroup resources. type NodeFeatureGroupInterface interface { - Create(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.CreateOptions) (*v1alpha1.NodeFeatureGroup, error) - Update(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (*v1alpha1.NodeFeatureGroup, error) + Create(ctx context.Context, nodeFeatureGroup *nfdv1alpha1.NodeFeatureGroup, opts v1.CreateOptions) (*nfdv1alpha1.NodeFeatureGroup, error) + Update(ctx context.Context, nodeFeatureGroup *nfdv1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (*nfdv1alpha1.NodeFeatureGroup, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, nodeFeatureGroup *v1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (*v1alpha1.NodeFeatureGroup, error) + UpdateStatus(ctx context.Context, nodeFeatureGroup *nfdv1alpha1.NodeFeatureGroup, opts v1.UpdateOptions) (*nfdv1alpha1.NodeFeatureGroup, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.NodeFeatureGroup, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NodeFeatureGroupList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*nfdv1alpha1.NodeFeatureGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*nfdv1alpha1.NodeFeatureGroupList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeatureGroup, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nfdv1alpha1.NodeFeatureGroup, err error) NodeFeatureGroupExpansion } // nodeFeatureGroups implements NodeFeatureGroupInterface type nodeFeatureGroups struct { - *gentype.ClientWithList[*v1alpha1.NodeFeatureGroup, *v1alpha1.NodeFeatureGroupList] + *gentype.ClientWithList[*nfdv1alpha1.NodeFeatureGroup, *nfdv1alpha1.NodeFeatureGroupList] } // newNodeFeatureGroups returns a NodeFeatureGroups func newNodeFeatureGroups(c *NfdV1alpha1Client, namespace string) *nodeFeatureGroups { return &nodeFeatureGroups{ - gentype.NewClientWithList[*v1alpha1.NodeFeatureGroup, *v1alpha1.NodeFeatureGroupList]( + gentype.NewClientWithList[*nfdv1alpha1.NodeFeatureGroup, *nfdv1alpha1.NodeFeatureGroupList]( "nodefeaturegroups", c.RESTClient(), scheme.ParameterCodec, namespace, - func() *v1alpha1.NodeFeatureGroup { return &v1alpha1.NodeFeatureGroup{} }, - func() *v1alpha1.NodeFeatureGroupList { return &v1alpha1.NodeFeatureGroupList{} }), + func() *nfdv1alpha1.NodeFeatureGroup { return &nfdv1alpha1.NodeFeatureGroup{} }, + func() *nfdv1alpha1.NodeFeatureGroupList { return &nfdv1alpha1.NodeFeatureGroupList{} }, + ), } } diff --git a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturerule.go b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturerule.go index e4a5007328..cf0719ad17 100644 --- a/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturerule.go +++ b/api/generated/clientset/versioned/typed/nfd/v1alpha1/nodefeaturerule.go @@ -19,14 +19,14 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" gentype "k8s.io/client-go/gentype" scheme "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned/scheme" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureRulesGetter has a method to return a NodeFeatureRuleInterface. @@ -37,31 +37,32 @@ type NodeFeatureRulesGetter interface { // NodeFeatureRuleInterface has methods to work with NodeFeatureRule resources. type NodeFeatureRuleInterface interface { - Create(ctx context.Context, nodeFeatureRule *v1alpha1.NodeFeatureRule, opts v1.CreateOptions) (*v1alpha1.NodeFeatureRule, error) - Update(ctx context.Context, nodeFeatureRule *v1alpha1.NodeFeatureRule, opts v1.UpdateOptions) (*v1alpha1.NodeFeatureRule, error) + Create(ctx context.Context, nodeFeatureRule *nfdv1alpha1.NodeFeatureRule, opts v1.CreateOptions) (*nfdv1alpha1.NodeFeatureRule, error) + Update(ctx context.Context, nodeFeatureRule *nfdv1alpha1.NodeFeatureRule, opts v1.UpdateOptions) (*nfdv1alpha1.NodeFeatureRule, error) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error - Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.NodeFeatureRule, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NodeFeatureRuleList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*nfdv1alpha1.NodeFeatureRule, error) + List(ctx context.Context, opts v1.ListOptions) (*nfdv1alpha1.NodeFeatureRuleList, error) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NodeFeatureRule, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nfdv1alpha1.NodeFeatureRule, err error) NodeFeatureRuleExpansion } // nodeFeatureRules implements NodeFeatureRuleInterface type nodeFeatureRules struct { - *gentype.ClientWithList[*v1alpha1.NodeFeatureRule, *v1alpha1.NodeFeatureRuleList] + *gentype.ClientWithList[*nfdv1alpha1.NodeFeatureRule, *nfdv1alpha1.NodeFeatureRuleList] } // newNodeFeatureRules returns a NodeFeatureRules func newNodeFeatureRules(c *NfdV1alpha1Client) *nodeFeatureRules { return &nodeFeatureRules{ - gentype.NewClientWithList[*v1alpha1.NodeFeatureRule, *v1alpha1.NodeFeatureRuleList]( + gentype.NewClientWithList[*nfdv1alpha1.NodeFeatureRule, *nfdv1alpha1.NodeFeatureRuleList]( "nodefeaturerules", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha1.NodeFeatureRule { return &v1alpha1.NodeFeatureRule{} }, - func() *v1alpha1.NodeFeatureRuleList { return &v1alpha1.NodeFeatureRuleList{} }), + func() *nfdv1alpha1.NodeFeatureRule { return &nfdv1alpha1.NodeFeatureRule{} }, + func() *nfdv1alpha1.NodeFeatureRuleList { return &nfdv1alpha1.NodeFeatureRuleList{} }, + ), } } diff --git a/api/generated/informers/externalversions/generic.go b/api/generated/informers/externalversions/generic.go index 86577fff52..1422eb95cf 100644 --- a/api/generated/informers/externalversions/generic.go +++ b/api/generated/informers/externalversions/generic.go @@ -19,7 +19,7 @@ limitations under the License. package externalversions import ( - "fmt" + fmt "fmt" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" diff --git a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go index 570a73114d..34e14e4340 100644 --- a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go +++ b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -28,15 +28,15 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned" internalinterfaces "sigs.k8s.io/node-feature-discovery/api/generated/informers/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" - nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" + apinfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureInformer provides access to a shared informer and lister for // NodeFeatures. type NodeFeatureInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.NodeFeatureLister + Lister() nfdv1alpha1.NodeFeatureLister } type nodeFeatureInformer struct { @@ -71,7 +71,7 @@ func NewFilteredNodeFeatureInformer(client versioned.Interface, namespace string return client.NfdV1alpha1().NodeFeatures(namespace).Watch(context.TODO(), options) }, }, - &nfdv1alpha1.NodeFeature{}, + &apinfdv1alpha1.NodeFeature{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *nodeFeatureInformer) defaultInformer(client versioned.Interface, resync } func (f *nodeFeatureInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&nfdv1alpha1.NodeFeature{}, f.defaultInformer) + return f.factory.InformerFor(&apinfdv1alpha1.NodeFeature{}, f.defaultInformer) } -func (f *nodeFeatureInformer) Lister() v1alpha1.NodeFeatureLister { - return v1alpha1.NewNodeFeatureLister(f.Informer().GetIndexer()) +func (f *nodeFeatureInformer) Lister() nfdv1alpha1.NodeFeatureLister { + return nfdv1alpha1.NewNodeFeatureLister(f.Informer().GetIndexer()) } diff --git a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturegroup.go b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturegroup.go index deebcae1f4..30559f5cee 100644 --- a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturegroup.go +++ b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturegroup.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -28,15 +28,15 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned" internalinterfaces "sigs.k8s.io/node-feature-discovery/api/generated/informers/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" - nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" + apinfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureGroupInformer provides access to a shared informer and lister for // NodeFeatureGroups. type NodeFeatureGroupInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.NodeFeatureGroupLister + Lister() nfdv1alpha1.NodeFeatureGroupLister } type nodeFeatureGroupInformer struct { @@ -71,7 +71,7 @@ func NewFilteredNodeFeatureGroupInformer(client versioned.Interface, namespace s return client.NfdV1alpha1().NodeFeatureGroups(namespace).Watch(context.TODO(), options) }, }, - &nfdv1alpha1.NodeFeatureGroup{}, + &apinfdv1alpha1.NodeFeatureGroup{}, resyncPeriod, indexers, ) @@ -82,9 +82,9 @@ func (f *nodeFeatureGroupInformer) defaultInformer(client versioned.Interface, r } func (f *nodeFeatureGroupInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&nfdv1alpha1.NodeFeatureGroup{}, f.defaultInformer) + return f.factory.InformerFor(&apinfdv1alpha1.NodeFeatureGroup{}, f.defaultInformer) } -func (f *nodeFeatureGroupInformer) Lister() v1alpha1.NodeFeatureGroupLister { - return v1alpha1.NewNodeFeatureGroupLister(f.Informer().GetIndexer()) +func (f *nodeFeatureGroupInformer) Lister() nfdv1alpha1.NodeFeatureGroupLister { + return nfdv1alpha1.NewNodeFeatureGroupLister(f.Informer().GetIndexer()) } diff --git a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturerule.go b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturerule.go index 47fae6dfb7..37ad15dce8 100644 --- a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturerule.go +++ b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeaturerule.go @@ -19,7 +19,7 @@ limitations under the License. package v1alpha1 import ( - "context" + context "context" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -28,15 +28,15 @@ import ( cache "k8s.io/client-go/tools/cache" versioned "sigs.k8s.io/node-feature-discovery/api/generated/clientset/versioned" internalinterfaces "sigs.k8s.io/node-feature-discovery/api/generated/informers/externalversions/internalinterfaces" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" - nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/generated/listers/nfd/v1alpha1" + apinfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureRuleInformer provides access to a shared informer and lister for // NodeFeatureRules. type NodeFeatureRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1alpha1.NodeFeatureRuleLister + Lister() nfdv1alpha1.NodeFeatureRuleLister } type nodeFeatureRuleInformer struct { @@ -70,7 +70,7 @@ func NewFilteredNodeFeatureRuleInformer(client versioned.Interface, resyncPeriod return client.NfdV1alpha1().NodeFeatureRules().Watch(context.TODO(), options) }, }, - &nfdv1alpha1.NodeFeatureRule{}, + &apinfdv1alpha1.NodeFeatureRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *nodeFeatureRuleInformer) defaultInformer(client versioned.Interface, re } func (f *nodeFeatureRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&nfdv1alpha1.NodeFeatureRule{}, f.defaultInformer) + return f.factory.InformerFor(&apinfdv1alpha1.NodeFeatureRule{}, f.defaultInformer) } -func (f *nodeFeatureRuleInformer) Lister() v1alpha1.NodeFeatureRuleLister { - return v1alpha1.NewNodeFeatureRuleLister(f.Informer().GetIndexer()) +func (f *nodeFeatureRuleInformer) Lister() nfdv1alpha1.NodeFeatureRuleLister { + return nfdv1alpha1.NewNodeFeatureRuleLister(f.Informer().GetIndexer()) } diff --git a/api/generated/listers/nfd/v1alpha1/nodefeature.go b/api/generated/listers/nfd/v1alpha1/nodefeature.go index e1badec179..f670b6e8ae 100644 --- a/api/generated/listers/nfd/v1alpha1/nodefeature.go +++ b/api/generated/listers/nfd/v1alpha1/nodefeature.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureLister helps list NodeFeatures. @@ -30,7 +30,7 @@ import ( type NodeFeatureLister interface { // List lists all NodeFeatures in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.NodeFeature, err error) + List(selector labels.Selector) (ret []*nfdv1alpha1.NodeFeature, err error) // NodeFeatures returns an object that can list and get NodeFeatures. NodeFeatures(namespace string) NodeFeatureNamespaceLister NodeFeatureListerExpansion @@ -38,17 +38,17 @@ type NodeFeatureLister interface { // nodeFeatureLister implements the NodeFeatureLister interface. type nodeFeatureLister struct { - listers.ResourceIndexer[*v1alpha1.NodeFeature] + listers.ResourceIndexer[*nfdv1alpha1.NodeFeature] } // NewNodeFeatureLister returns a new NodeFeatureLister. func NewNodeFeatureLister(indexer cache.Indexer) NodeFeatureLister { - return &nodeFeatureLister{listers.New[*v1alpha1.NodeFeature](indexer, v1alpha1.Resource("nodefeature"))} + return &nodeFeatureLister{listers.New[*nfdv1alpha1.NodeFeature](indexer, nfdv1alpha1.Resource("nodefeature"))} } // NodeFeatures returns an object that can list and get NodeFeatures. func (s *nodeFeatureLister) NodeFeatures(namespace string) NodeFeatureNamespaceLister { - return nodeFeatureNamespaceLister{listers.NewNamespaced[*v1alpha1.NodeFeature](s.ResourceIndexer, namespace)} + return nodeFeatureNamespaceLister{listers.NewNamespaced[*nfdv1alpha1.NodeFeature](s.ResourceIndexer, namespace)} } // NodeFeatureNamespaceLister helps list and get NodeFeatures. @@ -56,15 +56,15 @@ func (s *nodeFeatureLister) NodeFeatures(namespace string) NodeFeatureNamespaceL type NodeFeatureNamespaceLister interface { // List lists all NodeFeatures in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.NodeFeature, err error) + List(selector labels.Selector) (ret []*nfdv1alpha1.NodeFeature, err error) // Get retrieves the NodeFeature from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.NodeFeature, error) + Get(name string) (*nfdv1alpha1.NodeFeature, error) NodeFeatureNamespaceListerExpansion } // nodeFeatureNamespaceLister implements the NodeFeatureNamespaceLister // interface. type nodeFeatureNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.NodeFeature] + listers.ResourceIndexer[*nfdv1alpha1.NodeFeature] } diff --git a/api/generated/listers/nfd/v1alpha1/nodefeaturegroup.go b/api/generated/listers/nfd/v1alpha1/nodefeaturegroup.go index 6315f9ef56..a59e53684d 100644 --- a/api/generated/listers/nfd/v1alpha1/nodefeaturegroup.go +++ b/api/generated/listers/nfd/v1alpha1/nodefeaturegroup.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureGroupLister helps list NodeFeatureGroups. @@ -30,7 +30,7 @@ import ( type NodeFeatureGroupLister interface { // List lists all NodeFeatureGroups in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.NodeFeatureGroup, err error) + List(selector labels.Selector) (ret []*nfdv1alpha1.NodeFeatureGroup, err error) // NodeFeatureGroups returns an object that can list and get NodeFeatureGroups. NodeFeatureGroups(namespace string) NodeFeatureGroupNamespaceLister NodeFeatureGroupListerExpansion @@ -38,17 +38,17 @@ type NodeFeatureGroupLister interface { // nodeFeatureGroupLister implements the NodeFeatureGroupLister interface. type nodeFeatureGroupLister struct { - listers.ResourceIndexer[*v1alpha1.NodeFeatureGroup] + listers.ResourceIndexer[*nfdv1alpha1.NodeFeatureGroup] } // NewNodeFeatureGroupLister returns a new NodeFeatureGroupLister. func NewNodeFeatureGroupLister(indexer cache.Indexer) NodeFeatureGroupLister { - return &nodeFeatureGroupLister{listers.New[*v1alpha1.NodeFeatureGroup](indexer, v1alpha1.Resource("nodefeaturegroup"))} + return &nodeFeatureGroupLister{listers.New[*nfdv1alpha1.NodeFeatureGroup](indexer, nfdv1alpha1.Resource("nodefeaturegroup"))} } // NodeFeatureGroups returns an object that can list and get NodeFeatureGroups. func (s *nodeFeatureGroupLister) NodeFeatureGroups(namespace string) NodeFeatureGroupNamespaceLister { - return nodeFeatureGroupNamespaceLister{listers.NewNamespaced[*v1alpha1.NodeFeatureGroup](s.ResourceIndexer, namespace)} + return nodeFeatureGroupNamespaceLister{listers.NewNamespaced[*nfdv1alpha1.NodeFeatureGroup](s.ResourceIndexer, namespace)} } // NodeFeatureGroupNamespaceLister helps list and get NodeFeatureGroups. @@ -56,15 +56,15 @@ func (s *nodeFeatureGroupLister) NodeFeatureGroups(namespace string) NodeFeature type NodeFeatureGroupNamespaceLister interface { // List lists all NodeFeatureGroups in the indexer for a given namespace. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.NodeFeatureGroup, err error) + List(selector labels.Selector) (ret []*nfdv1alpha1.NodeFeatureGroup, err error) // Get retrieves the NodeFeatureGroup from the indexer for a given namespace and name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.NodeFeatureGroup, error) + Get(name string) (*nfdv1alpha1.NodeFeatureGroup, error) NodeFeatureGroupNamespaceListerExpansion } // nodeFeatureGroupNamespaceLister implements the NodeFeatureGroupNamespaceLister // interface. type nodeFeatureGroupNamespaceLister struct { - listers.ResourceIndexer[*v1alpha1.NodeFeatureGroup] + listers.ResourceIndexer[*nfdv1alpha1.NodeFeatureGroup] } diff --git a/api/generated/listers/nfd/v1alpha1/nodefeaturerule.go b/api/generated/listers/nfd/v1alpha1/nodefeaturerule.go index 15ecdd8112..77cdcf0cb3 100644 --- a/api/generated/listers/nfd/v1alpha1/nodefeaturerule.go +++ b/api/generated/listers/nfd/v1alpha1/nodefeaturerule.go @@ -19,10 +19,10 @@ limitations under the License. package v1alpha1 import ( - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/listers" - "k8s.io/client-go/tools/cache" - v1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" + labels "k8s.io/apimachinery/pkg/labels" + listers "k8s.io/client-go/listers" + cache "k8s.io/client-go/tools/cache" + nfdv1alpha1 "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1" ) // NodeFeatureRuleLister helps list NodeFeatureRules. @@ -30,19 +30,19 @@ import ( type NodeFeatureRuleLister interface { // List lists all NodeFeatureRules in the indexer. // Objects returned here must be treated as read-only. - List(selector labels.Selector) (ret []*v1alpha1.NodeFeatureRule, err error) + List(selector labels.Selector) (ret []*nfdv1alpha1.NodeFeatureRule, err error) // Get retrieves the NodeFeatureRule from the index for a given name. // Objects returned here must be treated as read-only. - Get(name string) (*v1alpha1.NodeFeatureRule, error) + Get(name string) (*nfdv1alpha1.NodeFeatureRule, error) NodeFeatureRuleListerExpansion } // nodeFeatureRuleLister implements the NodeFeatureRuleLister interface. type nodeFeatureRuleLister struct { - listers.ResourceIndexer[*v1alpha1.NodeFeatureRule] + listers.ResourceIndexer[*nfdv1alpha1.NodeFeatureRule] } // NewNodeFeatureRuleLister returns a new NodeFeatureRuleLister. func NewNodeFeatureRuleLister(indexer cache.Indexer) NodeFeatureRuleLister { - return &nodeFeatureRuleLister{listers.New[*v1alpha1.NodeFeatureRule](indexer, v1alpha1.Resource("nodefeaturerule"))} + return &nodeFeatureRuleLister{listers.New[*nfdv1alpha1.NodeFeatureRule](indexer, nfdv1alpha1.Resource("nodefeaturerule"))} } diff --git a/api/nfd/v1alpha1/doc.go b/api/nfd/v1alpha1/doc.go index 17b8fc5851..32b425965b 100644 --- a/api/nfd/v1alpha1/doc.go +++ b/api/nfd/v1alpha1/doc.go @@ -19,5 +19,3 @@ limitations under the License. // +kubebuilder:object:generate=true // +groupName=nfd.k8s-sigs.io package v1alpha1 - -//go:generate ./generate.sh diff --git a/api/nfd/v1alpha1/generate.sh b/api/nfd/v1alpha1/generate.sh deleted file mode 100755 index d4fe85392e..0000000000 --- a/api/nfd/v1alpha1/generate.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -ex - -go-to-protobuf \ - --output-base=. \ - --go-header-file ../../../../hack/boilerplate.go.txt \ - --proto-import ../../../../vendor/ \ - --packages +sigs.k8s.io/node-feature-discovery/pkg/apis/nfd/v1alpha1=v1alpha1 \ - --keep-gogoproto=false \ - --apimachinery-packages "-k8s.io/apimachinery/pkg/util/intstr" - -mv sigs.k8s.io/node-feature-discovery/pkg/apis/nfd/v1alpha1/* . -rm -rf sigs.k8s.io diff --git a/api/nfd/v1alpha1/generated.pb.go b/api/nfd/v1alpha1/generated.pb.go deleted file mode 100644 index 4231691e48..0000000000 --- a/api/nfd/v1alpha1/generated.pb.go +++ /dev/null @@ -1,2037 +0,0 @@ -/* -Copyright 2024 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: sigs.k8s.io/node-feature-discovery/pkg/apis/nfd/v1alpha1/generated.proto - -package v1alpha1 - -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 *AttributeFeatureSet) Reset() { *m = AttributeFeatureSet{} } -func (*AttributeFeatureSet) ProtoMessage() {} -func (*AttributeFeatureSet) Descriptor() ([]byte, []int) { - return fileDescriptor_6f67d44e41cfe439, []int{0} -} -func (m *AttributeFeatureSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AttributeFeatureSet) 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 *AttributeFeatureSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_AttributeFeatureSet.Merge(m, src) -} -func (m *AttributeFeatureSet) XXX_Size() int { - return m.Size() -} -func (m *AttributeFeatureSet) XXX_DiscardUnknown() { - xxx_messageInfo_AttributeFeatureSet.DiscardUnknown(m) -} - -var xxx_messageInfo_AttributeFeatureSet proto.InternalMessageInfo - -func (m *Features) Reset() { *m = Features{} } -func (*Features) ProtoMessage() {} -func (*Features) Descriptor() ([]byte, []int) { - return fileDescriptor_6f67d44e41cfe439, []int{1} -} -func (m *Features) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Features) 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 *Features) XXX_Merge(src proto.Message) { - xxx_messageInfo_Features.Merge(m, src) -} -func (m *Features) XXX_Size() int { - return m.Size() -} -func (m *Features) XXX_DiscardUnknown() { - xxx_messageInfo_Features.DiscardUnknown(m) -} - -var xxx_messageInfo_Features proto.InternalMessageInfo - -func (m *FlagFeatureSet) Reset() { *m = FlagFeatureSet{} } -func (*FlagFeatureSet) ProtoMessage() {} -func (*FlagFeatureSet) Descriptor() ([]byte, []int) { - return fileDescriptor_6f67d44e41cfe439, []int{2} -} -func (m *FlagFeatureSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FlagFeatureSet) 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 *FlagFeatureSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_FlagFeatureSet.Merge(m, src) -} -func (m *FlagFeatureSet) XXX_Size() int { - return m.Size() -} -func (m *FlagFeatureSet) XXX_DiscardUnknown() { - xxx_messageInfo_FlagFeatureSet.DiscardUnknown(m) -} - -var xxx_messageInfo_FlagFeatureSet proto.InternalMessageInfo - -func (m *InstanceFeature) Reset() { *m = InstanceFeature{} } -func (*InstanceFeature) ProtoMessage() {} -func (*InstanceFeature) Descriptor() ([]byte, []int) { - return fileDescriptor_6f67d44e41cfe439, []int{3} -} -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_6f67d44e41cfe439, []int{4} -} -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 *Nil) Reset() { *m = Nil{} } -func (*Nil) ProtoMessage() {} -func (*Nil) Descriptor() ([]byte, []int) { - return fileDescriptor_6f67d44e41cfe439, []int{5} -} -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 init() { - proto.RegisterType((*AttributeFeatureSet)(nil), "v1alpha1.AttributeFeatureSet") - proto.RegisterMapType((map[string]string)(nil), "v1alpha1.AttributeFeatureSet.ElementsEntry") - proto.RegisterType((*Features)(nil), "v1alpha1.Features") - proto.RegisterMapType((map[string]FlagFeatureSet)(nil), "v1alpha1.Features.FlagsEntry") - proto.RegisterMapType((map[string]InstanceFeatureSet)(nil), "v1alpha1.Features.InstancesEntry") - proto.RegisterMapType((map[string]AttributeFeatureSet)(nil), "v1alpha1.Features.VattributesEntry") - proto.RegisterType((*FlagFeatureSet)(nil), "v1alpha1.FlagFeatureSet") - proto.RegisterMapType((map[string]Nil)(nil), "v1alpha1.FlagFeatureSet.ElementsEntry") - proto.RegisterType((*InstanceFeature)(nil), "v1alpha1.InstanceFeature") - proto.RegisterMapType((map[string]string)(nil), "v1alpha1.InstanceFeature.AttributesEntry") - proto.RegisterType((*InstanceFeatureSet)(nil), "v1alpha1.InstanceFeatureSet") - proto.RegisterType((*Nil)(nil), "v1alpha1.Nil") -} - -func init() { - proto.RegisterFile("sigs.k8s.io/node-feature-discovery/pkg/apis/nfd/v1alpha1/generated.proto", fileDescriptor_6f67d44e41cfe439) -} - -var fileDescriptor_6f67d44e41cfe439 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xcd, 0x6e, 0xda, 0x40, - 0x10, 0xc7, 0xbd, 0x50, 0x24, 0x18, 0x44, 0x42, 0xb7, 0x3d, 0xb8, 0x56, 0xe3, 0xa4, 0x44, 0xaa, - 0x52, 0x55, 0xd8, 0x0a, 0xbd, 0xa0, 0x56, 0x3d, 0x04, 0x29, 0xe9, 0xc7, 0x21, 0x07, 0xb7, 0xaa, - 0x94, 0x48, 0x54, 0x5a, 0x60, 0x71, 0x56, 0x38, 0x36, 0xf2, 0xae, 0x91, 0xb8, 0xf5, 0x01, 0x7a, - 0xe8, 0x8b, 0x54, 0x95, 0xfa, 0x14, 0x1c, 0x73, 0xcc, 0x29, 0x2a, 0xee, 0x8b, 0x54, 0xf1, 0x07, - 0xb6, 0x83, 0x01, 0x35, 0x37, 0xef, 0xec, 0xcc, 0x6f, 0xe6, 0xff, 0xdf, 0x01, 0x78, 0xcf, 0x99, - 0xc9, 0xb5, 0x51, 0x9b, 0x6b, 0xcc, 0xd1, 0x6d, 0x67, 0x40, 0x9b, 0x43, 0x4a, 0x84, 0xe7, 0xd2, - 0xe6, 0x80, 0xf1, 0xbe, 0x33, 0xa1, 0xee, 0x54, 0x1f, 0x8f, 0x4c, 0x9d, 0x8c, 0x19, 0xd7, 0xed, - 0xe1, 0x40, 0x9f, 0x1c, 0x12, 0x6b, 0x7c, 0x41, 0x0e, 0x75, 0x93, 0xda, 0xd4, 0x25, 0x82, 0x0e, - 0xb4, 0xb1, 0xeb, 0x08, 0x07, 0x97, 0xe3, 0x1b, 0xa5, 0x69, 0x32, 0x71, 0xe1, 0xf5, 0xb4, 0xbe, - 0x73, 0xa9, 0x9b, 0x8e, 0xe9, 0xe8, 0x41, 0x42, 0xcf, 0x1b, 0x06, 0xa7, 0xe0, 0x10, 0x7c, 0x85, - 0x85, 0x8d, 0x9f, 0x08, 0x1e, 0x1d, 0x09, 0xe1, 0xb2, 0x9e, 0x27, 0xe8, 0x49, 0xd8, 0xfd, 0x13, - 0x15, 0xf8, 0x0c, 0xca, 0xd4, 0xa2, 0x97, 0xd4, 0x16, 0x5c, 0x46, 0x7b, 0xc5, 0x83, 0x6a, 0xeb, - 0xa5, 0x16, 0xf7, 0xd0, 0x72, 0x0a, 0xb4, 0xe3, 0x28, 0xfb, 0xd8, 0x16, 0xee, 0xb4, 0x53, 0x9f, - 0xdd, 0xec, 0x4a, 0xfe, 0xcd, 0x6e, 0x39, 0x0e, 0x1b, 0x0b, 0x9c, 0xf2, 0x06, 0x6a, 0x99, 0x64, - 0x5c, 0x87, 0xe2, 0x88, 0x4e, 0x65, 0xb4, 0x87, 0x0e, 0x2a, 0xc6, 0xed, 0x27, 0x7e, 0x0c, 0xa5, - 0x09, 0xb1, 0x3c, 0x2a, 0x17, 0x82, 0x58, 0x78, 0x78, 0x5d, 0x68, 0xa3, 0xc6, 0xf7, 0x07, 0x50, - 0x8e, 0xba, 0x72, 0xdc, 0x81, 0xd2, 0xd0, 0x22, 0x66, 0x3c, 0xe1, 0x4e, 0x32, 0x61, 0x9c, 0xa2, - 0x9d, 0xdc, 0xde, 0x87, 0x33, 0xd5, 0xa2, 0x99, 0x4a, 0x41, 0xcc, 0x08, 0x4b, 0xf1, 0x19, 0x54, - 0x27, 0x24, 0xd6, 0xc3, 0xe5, 0x42, 0x40, 0xda, 0xcf, 0x21, 0x7d, 0x49, 0xb2, 0x42, 0x1e, 0x8e, - 0x78, 0xb0, 0xb0, 0x83, 0x1b, 0x69, 0x16, 0x36, 0xa0, 0xc2, 0x6c, 0x2e, 0x88, 0xdd, 0xa7, 0x5c, - 0x2e, 0x06, 0xe0, 0x67, 0x39, 0xe0, 0x0f, 0x71, 0x4e, 0x88, 0x7d, 0x18, 0x61, 0x2b, 0x8b, 0xb8, - 0x91, 0x60, 0x14, 0x03, 0x20, 0x91, 0x94, 0xe3, 0x9c, 0x96, 0x76, 0xae, 0xda, 0x92, 0x53, 0xfd, - 0x2c, 0x62, 0x26, 0xef, 0x95, 0xf2, 0x54, 0xe9, 0x42, 0xfd, 0xae, 0xb8, 0x1c, 0xf2, 0xab, 0x2c, - 0x79, 0x67, 0xed, 0x3a, 0xa4, 0xf1, 0xe7, 0xb0, 0x95, 0x95, 0x98, 0x03, 0x6f, 0x65, 0xe1, 0x4f, - 0x13, 0x78, 0x5c, 0x9a, 0xcb, 0x6e, 0xfc, 0x46, 0xb0, 0x95, 0x15, 0x86, 0x3f, 0x2f, 0x6d, 0xee, - 0xf3, 0x55, 0x26, 0xfc, 0xc7, 0xd2, 0x7e, 0xdc, 0xbc, 0xb4, 0xfb, 0x59, 0x0d, 0xb5, 0xa4, 0xeb, - 0x29, 0xb3, 0xd2, 0x43, 0xff, 0x42, 0xb0, 0x7d, 0x47, 0x16, 0xee, 0x02, 0xa4, 0xb6, 0x30, 0x9c, - 0xfb, 0xc5, 0x4a, 0x17, 0x12, 0xcb, 0xd7, 0xec, 0x62, 0x0a, 0xa8, 0xbc, 0x85, 0xed, 0xa3, 0x8d, - 0x2f, 0xbc, 0xfa, 0x57, 0xd7, 0x05, 0xbc, 0xfc, 0x0e, 0xf8, 0xdd, 0x92, 0xd3, 0x4f, 0x56, 0x4e, - 0xbc, 0xce, 0xdc, 0x46, 0x09, 0x8a, 0xa7, 0xcc, 0xea, 0x7c, 0x9d, 0xcd, 0x55, 0xe9, 0x6a, 0xae, - 0x4a, 0xd7, 0x73, 0x55, 0xfa, 0xe6, 0xab, 0x68, 0xe6, 0xab, 0xe8, 0xca, 0x57, 0xd1, 0xb5, 0xaf, - 0xa2, 0x3f, 0xbe, 0x8a, 0x7e, 0xfc, 0x55, 0xa5, 0xf3, 0xf6, 0x7d, 0xff, 0x34, 0xff, 0x05, 0x00, - 0x00, 0xff, 0xff, 0xa9, 0x81, 0xcf, 0x6d, 0x6f, 0x05, 0x00, 0x00, -} - -func (m *AttributeFeatureSet) 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 *AttributeFeatureSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AttributeFeatureSet) 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 (m *Features) 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 *Features) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Features) 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.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 - { - 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(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] = 0x12 - } - } - if len(m.Flags) > 0 { - keysForFlags := make([]string, 0, len(m.Flags)) - for k := range m.Flags { - keysForFlags = append(keysForFlags, string(k)) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForFlags) - for iNdEx := len(keysForFlags) - 1; iNdEx >= 0; iNdEx-- { - v := m.Flags[string(keysForFlags[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(keysForFlags[iNdEx]) - copy(dAtA[i:], keysForFlags[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(keysForFlags[iNdEx]))) - i-- - dAtA[i] = 0xa - i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *FlagFeatureSet) 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 *FlagFeatureSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FlagFeatureSet) 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 *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 *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 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 *AttributeFeatureSet) 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 (m *Features) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Flags) > 0 { - for k, v := range m.Flags { - _ = 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.Attributes) > 0 { - for k, v := range m.Attributes { - _ = 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 *FlagFeatureSet) 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 *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 *Nil) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - 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 *AttributeFeatureSet) 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{`&AttributeFeatureSet{`, - `Elements:` + mapStringForElements + `,`, - `}`, - }, "") - return s -} -func (this *Features) String() string { - if this == nil { - return "nil" - } - keysForFlags := make([]string, 0, len(this.Flags)) - for k := range this.Flags { - keysForFlags = append(keysForFlags, k) - } - github_com_gogo_protobuf_sortkeys.Strings(keysForFlags) - mapStringForFlags := "map[string]FlagFeatureSet{" - for _, k := range keysForFlags { - mapStringForFlags += fmt.Sprintf("%v: %v,", k, this.Flags[k]) - } - mapStringForFlags += "}" - 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]AttributeFeatureSet{" - for _, k := range keysForAttributes { - mapStringForAttributes += fmt.Sprintf("%v: %v,", k, this.Attributes[k]) - } - mapStringForAttributes += "}" - 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{`&Features{`, - `Flags:` + mapStringForFlags + `,`, - `Attributes:` + mapStringForAttributes + `,`, - `Instances:` + mapStringForInstances + `,`, - `}`, - }, "") - return s -} -func (this *FlagFeatureSet) 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{`&FlagFeatureSet{`, - `Elements:` + mapStringForElements + `,`, - `}`, - }, "") - 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 *Nil) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Nil{`, - `}`, - }, "") - 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 *AttributeFeatureSet) 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: AttributeFeatureSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AttributeFeatureSet: 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 (m *Features) 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: Features: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Features: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Flags", 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.Flags == nil { - m.Flags = make(map[string]FlagFeatureSet) - } - var mapkey string - mapvalue := &FlagFeatureSet{} - 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 = &FlagFeatureSet{} - 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.Flags[mapkey] = *mapvalue - iNdEx = postIndex - case 2: - 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]AttributeFeatureSet) - } - var mapkey string - mapvalue := &AttributeFeatureSet{} - 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 = &AttributeFeatureSet{} - 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.Attributes[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 *FlagFeatureSet) 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: FlagFeatureSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FlagFeatureSet: 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 *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 *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 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/api/nfd/v1alpha1/generated.proto b/api/nfd/v1alpha1/generated.proto deleted file mode 100644 index dab35a16aa..0000000000 --- a/api/nfd/v1alpha1/generated.proto +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2024 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 v1alpha1; - -// Package-wide variables from generator "generated". -option go_package = "sigs.k8s.io/node-feature-discovery/api/nfd/v1alpha1"; - -// AttributeFeatureSet is a set of features having string value. -// -// +protobuf=true -message AttributeFeatureSet { - map elements = 1; -} - -// Features is the collection of all discovered features. -// -// +protobuf=true -message Features { - // Flags contains all the flag-type features of the node. - // +optional - map flags = 1; - - // Attributes contains all the attribute-type features of the node. - // +optional - map vattributes = 2; - - // Instances contains all the instance-type features of the node. - // +optional - map instances = 3; -} - -// FlagFeatureSet is a set of simple features only containing names without values. -// -// +protobuf=true -message FlagFeatureSet { - map elements = 1; -} - -// InstanceFeature represents one instance of a complex features, e.g. a device. -// -// +protobuf=true -message InstanceFeature { - map attributes = 1; -} - -// InstanceFeatureSet is a set of features each of which is an instance having multiple attributes. -// -// +protobuf=true -message InstanceFeatureSet { - repeated InstanceFeature elements = 1; -} - -// Nil is a dummy empty struct for protobuf compatibility -// -// +protobuf=true -message Nil { -} - diff --git a/api/nfd/v1alpha1/types.go b/api/nfd/v1alpha1/types.go index c89efd8185..67dfc1b06c 100644 --- a/api/nfd/v1alpha1/types.go +++ b/api/nfd/v1alpha1/types.go @@ -56,55 +56,44 @@ type NodeFeatureSpec struct { } // Features is the collection of all discovered features. -// -// +protobuf=true type Features struct { // Flags contains all the flag-type features of the node. // +optional - Flags map[string]FlagFeatureSet `json:"flags" protobuf:"bytes,1,rep,name=flags"` + Flags map[string]FlagFeatureSet `json:"flags"` // Attributes contains all the attribute-type features of the node. // +optional - Attributes map[string]AttributeFeatureSet `json:"attributes" protobuf:"bytes,2,rep,name=vattributes"` + Attributes map[string]AttributeFeatureSet `json:"attributes"` // Instances contains all the instance-type features of the node. // +optional - Instances map[string]InstanceFeatureSet `json:"instances" protobuf:"bytes,3,rep,name=instances"` + Instances map[string]InstanceFeatureSet `json:"instances"` } // FlagFeatureSet is a set of simple features only containing names without values. -// -// +protobuf=true type FlagFeatureSet struct { // Individual features of the feature set. - Elements map[string]Nil `json:"elements" protobuf:"bytes,1,rep,name=elements"` + Elements map[string]Nil `json:"elements"` } // AttributeFeatureSet is a set of features having string value. -// -// +protobuf=true type AttributeFeatureSet struct { // Individual features of the feature set. - Elements map[string]string `json:"elements" protobuf:"bytes,1,rep,name=elements"` + Elements map[string]string `json:"elements"` } // InstanceFeatureSet is a set of features each of which is an instance having multiple attributes. -// -// +protobuf=true type InstanceFeatureSet struct { // Individual features of the feature set. - Elements []InstanceFeature `json:"elements" protobuf:"bytes,1,rep,name=elements"` + Elements []InstanceFeature `json:"elements"` } // InstanceFeature represents one instance of a complex features, e.g. a device. -// -// +protobuf=true type InstanceFeature struct { // Attributes of the instance feature. - Attributes map[string]string `json:"attributes" protobuf:"bytes,1,rep,name=attributes"` + Attributes map[string]string `json:"attributes"` } -// Nil is a dummy empty struct for protobuf compatibility -// -// +protobuf=true +// Nil is a dummy empty struct for protobuf compatibility. +// NOTE: protobuf definitions have been removed but this is kept for API compatibility. type Nil struct{} // NodeFeatureRuleList contains a list of NodeFeatureRule objects. diff --git a/deployment/base/nfd-crds/nfd-api-crds.yaml b/deployment/base/nfd-crds/nfd-api-crds.yaml index 56142c6ce1..9f62da6f6c 100644 --- a/deployment/base/nfd-crds/nfd-api-crds.yaml +++ b/deployment/base/nfd-crds/nfd-api-crds.yaml @@ -69,8 +69,9 @@ spec: properties: elements: additionalProperties: - description: Nil is a dummy empty struct for protobuf - compatibility + description: |- + Nil is a dummy empty struct for protobuf compatibility. + NOTE: protobuf definitions have been removed but this is kept for API compatibility. type: object description: Individual features of the feature set. type: object diff --git a/deployment/helm/node-feature-discovery/crds/nfd-api-crds.yaml b/deployment/helm/node-feature-discovery/crds/nfd-api-crds.yaml index 56142c6ce1..9f62da6f6c 100644 --- a/deployment/helm/node-feature-discovery/crds/nfd-api-crds.yaml +++ b/deployment/helm/node-feature-discovery/crds/nfd-api-crds.yaml @@ -69,8 +69,9 @@ spec: properties: elements: additionalProperties: - description: Nil is a dummy empty struct for protobuf - compatibility + description: |- + Nil is a dummy empty struct for protobuf compatibility. + NOTE: protobuf definitions have been removed but this is kept for API compatibility. type: object description: Individual features of the feature set. type: object