diff --git a/api/versioned/clientset.go b/api/versioned/clientset.go index 539960f0f..304e39896 100644 --- a/api/versioned/clientset.go +++ b/api/versioned/clientset.go @@ -19,8 +19,8 @@ package versioned import ( - "fmt" - "net/http" + fmt "fmt" + http "net/http" nvidiav1 "github.com/NVIDIA/gpu-operator/api/versioned/typed/nvidia/v1" nvidiav1alpha1 "github.com/NVIDIA/gpu-operator/api/versioned/typed/nvidia/v1alpha1" diff --git a/api/versioned/typed/nvidia/v1/clusterpolicy.go b/api/versioned/typed/nvidia/v1/clusterpolicy.go index 29d5aa390..b99170526 100644 --- a/api/versioned/typed/nvidia/v1/clusterpolicy.go +++ b/api/versioned/typed/nvidia/v1/clusterpolicy.go @@ -19,9 +19,9 @@ package v1 import ( - "context" + context "context" - v1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1" + nvidiav1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1" scheme "github.com/NVIDIA/gpu-operator/api/versioned/scheme" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,33 +37,34 @@ type ClusterPoliciesGetter interface { // ClusterPolicyInterface has methods to work with ClusterPolicy resources. type ClusterPolicyInterface interface { - Create(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.CreateOptions) (*v1.ClusterPolicy, error) - Update(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.UpdateOptions) (*v1.ClusterPolicy, error) + Create(ctx context.Context, clusterPolicy *nvidiav1.ClusterPolicy, opts metav1.CreateOptions) (*nvidiav1.ClusterPolicy, error) + Update(ctx context.Context, clusterPolicy *nvidiav1.ClusterPolicy, opts metav1.UpdateOptions) (*nvidiav1.ClusterPolicy, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.UpdateOptions) (*v1.ClusterPolicy, error) + UpdateStatus(ctx context.Context, clusterPolicy *nvidiav1.ClusterPolicy, opts metav1.UpdateOptions) (*nvidiav1.ClusterPolicy, error) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error - Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterPolicy, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterPolicyList, error) + Get(ctx context.Context, name string, opts metav1.GetOptions) (*nvidiav1.ClusterPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*nvidiav1.ClusterPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) - Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterPolicy, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *nvidiav1.ClusterPolicy, err error) ClusterPolicyExpansion } // clusterPolicies implements ClusterPolicyInterface type clusterPolicies struct { - *gentype.ClientWithList[*v1.ClusterPolicy, *v1.ClusterPolicyList] + *gentype.ClientWithList[*nvidiav1.ClusterPolicy, *nvidiav1.ClusterPolicyList] } // newClusterPolicies returns a ClusterPolicies func newClusterPolicies(c *NvidiaV1Client) *clusterPolicies { return &clusterPolicies{ - gentype.NewClientWithList[*v1.ClusterPolicy, *v1.ClusterPolicyList]( + gentype.NewClientWithList[*nvidiav1.ClusterPolicy, *nvidiav1.ClusterPolicyList]( "clusterpolicies", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1.ClusterPolicy { return &v1.ClusterPolicy{} }, - func() *v1.ClusterPolicyList { return &v1.ClusterPolicyList{} }), + func() *nvidiav1.ClusterPolicy { return &nvidiav1.ClusterPolicy{} }, + func() *nvidiav1.ClusterPolicyList { return &nvidiav1.ClusterPolicyList{} }, + ), } } diff --git a/api/versioned/typed/nvidia/v1/fake/fake_clusterpolicy.go b/api/versioned/typed/nvidia/v1/fake/fake_clusterpolicy.go index e7bb37f19..b1b5b628e 100644 --- a/api/versioned/typed/nvidia/v1/fake/fake_clusterpolicy.go +++ b/api/versioned/typed/nvidia/v1/fake/fake_clusterpolicy.go @@ -19,120 +19,32 @@ package fake import ( - "context" - v1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1" - metav1 "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" + nvidiav1 "github.com/NVIDIA/gpu-operator/api/versioned/typed/nvidia/v1" + gentype "k8s.io/client-go/gentype" ) -// FakeClusterPolicies implements ClusterPolicyInterface -type FakeClusterPolicies struct { +// fakeClusterPolicies implements ClusterPolicyInterface +type fakeClusterPolicies struct { + *gentype.FakeClientWithList[*v1.ClusterPolicy, *v1.ClusterPolicyList] Fake *FakeNvidiaV1 } -var clusterpoliciesResource = v1.SchemeGroupVersion.WithResource("clusterpolicies") - -var clusterpoliciesKind = v1.SchemeGroupVersion.WithKind("ClusterPolicy") - -// Get takes name of the clusterPolicy, and returns the corresponding clusterPolicy object, and an error if there is any. -func (c *FakeClusterPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterPolicy, err error) { - emptyResult := &v1.ClusterPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(clusterpoliciesResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterPolicy), err -} - -// List takes label and field selectors, and returns the list of ClusterPolicies that match those selectors. -func (c *FakeClusterPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterPolicyList, err error) { - emptyResult := &v1.ClusterPolicyList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(clusterpoliciesResource, clusterpoliciesKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1.ClusterPolicyList{ListMeta: obj.(*v1.ClusterPolicyList).ListMeta} - for _, item := range obj.(*v1.ClusterPolicyList).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 clusterPolicies. -func (c *FakeClusterPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(clusterpoliciesResource, opts)) -} - -// Create takes the representation of a clusterPolicy and creates it. Returns the server's representation of the clusterPolicy, and an error, if there is any. -func (c *FakeClusterPolicies) Create(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.CreateOptions) (result *v1.ClusterPolicy, err error) { - emptyResult := &v1.ClusterPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(clusterpoliciesResource, clusterPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterPolicy), err -} - -// Update takes the representation of a clusterPolicy and updates it. Returns the server's representation of the clusterPolicy, and an error, if there is any. -func (c *FakeClusterPolicies) Update(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.UpdateOptions) (result *v1.ClusterPolicy, err error) { - emptyResult := &v1.ClusterPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(clusterpoliciesResource, clusterPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterPolicy), 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 *FakeClusterPolicies) UpdateStatus(ctx context.Context, clusterPolicy *v1.ClusterPolicy, opts metav1.UpdateOptions) (result *v1.ClusterPolicy, err error) { - emptyResult := &v1.ClusterPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(clusterpoliciesResource, "status", clusterPolicy, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1.ClusterPolicy), err -} - -// Delete takes name of the clusterPolicy and deletes it. Returns an error if one occurs. -func (c *FakeClusterPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(clusterpoliciesResource, name, opts), &v1.ClusterPolicy{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeClusterPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(clusterpoliciesResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1.ClusterPolicyList{}) - return err -} - -// Patch applies the patch and returns the patched clusterPolicy. -func (c *FakeClusterPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterPolicy, err error) { - emptyResult := &v1.ClusterPolicy{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(clusterpoliciesResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeClusterPolicies(fake *FakeNvidiaV1) nvidiav1.ClusterPolicyInterface { + return &fakeClusterPolicies{ + gentype.NewFakeClientWithList[*v1.ClusterPolicy, *v1.ClusterPolicyList]( + fake.Fake, + "", + v1.SchemeGroupVersion.WithResource("clusterpolicies"), + v1.SchemeGroupVersion.WithKind("ClusterPolicy"), + func() *v1.ClusterPolicy { return &v1.ClusterPolicy{} }, + func() *v1.ClusterPolicyList { return &v1.ClusterPolicyList{} }, + func(dst, src *v1.ClusterPolicyList) { dst.ListMeta = src.ListMeta }, + func(list *v1.ClusterPolicyList) []*v1.ClusterPolicy { return gentype.ToPointerSlice(list.Items) }, + func(list *v1.ClusterPolicyList, items []*v1.ClusterPolicy) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1.ClusterPolicy), err } diff --git a/api/versioned/typed/nvidia/v1/fake/fake_nvidia_client.go b/api/versioned/typed/nvidia/v1/fake/fake_nvidia_client.go index aca78400a..e3cad223a 100644 --- a/api/versioned/typed/nvidia/v1/fake/fake_nvidia_client.go +++ b/api/versioned/typed/nvidia/v1/fake/fake_nvidia_client.go @@ -29,7 +29,7 @@ type FakeNvidiaV1 struct { } func (c *FakeNvidiaV1) ClusterPolicies() v1.ClusterPolicyInterface { - return &FakeClusterPolicies{c} + return newFakeClusterPolicies(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/api/versioned/typed/nvidia/v1/nvidia_client.go b/api/versioned/typed/nvidia/v1/nvidia_client.go index 15d235390..20078e71b 100644 --- a/api/versioned/typed/nvidia/v1/nvidia_client.go +++ b/api/versioned/typed/nvidia/v1/nvidia_client.go @@ -19,10 +19,10 @@ package v1 import ( - "net/http" + http "net/http" - v1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1" - "github.com/NVIDIA/gpu-operator/api/versioned/scheme" + nvidiav1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1" + scheme "github.com/NVIDIA/gpu-operator/api/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -85,10 +85,10 @@ func New(c rest.Interface) *NvidiaV1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := nvidiav1.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/versioned/typed/nvidia/v1alpha1/fake/fake_nvidia_client.go b/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidia_client.go index 05c071875..f91c593a0 100644 --- a/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidia_client.go +++ b/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidia_client.go @@ -29,7 +29,7 @@ type FakeNvidiaV1alpha1 struct { } func (c *FakeNvidiaV1alpha1) NVIDIADrivers() v1alpha1.NVIDIADriverInterface { - return &FakeNVIDIADrivers{c} + return newFakeNVIDIADrivers(c) } // RESTClient returns a RESTClient that is used to communicate diff --git a/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidiadriver.go b/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidiadriver.go index ef5fd04e6..39be6fa25 100644 --- a/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidiadriver.go +++ b/api/versioned/typed/nvidia/v1alpha1/fake/fake_nvidiadriver.go @@ -19,120 +19,34 @@ package fake import ( - "context" - v1alpha1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1alpha1" - 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" + nvidiav1alpha1 "github.com/NVIDIA/gpu-operator/api/versioned/typed/nvidia/v1alpha1" + gentype "k8s.io/client-go/gentype" ) -// FakeNVIDIADrivers implements NVIDIADriverInterface -type FakeNVIDIADrivers struct { +// fakeNVIDIADrivers implements NVIDIADriverInterface +type fakeNVIDIADrivers struct { + *gentype.FakeClientWithList[*v1alpha1.NVIDIADriver, *v1alpha1.NVIDIADriverList] Fake *FakeNvidiaV1alpha1 } -var nvidiadriversResource = v1alpha1.SchemeGroupVersion.WithResource("nvidiadrivers") - -var nvidiadriversKind = v1alpha1.SchemeGroupVersion.WithKind("NVIDIADriver") - -// Get takes name of the nVIDIADriver, and returns the corresponding nVIDIADriver object, and an error if there is any. -func (c *FakeNVIDIADrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NVIDIADriver, err error) { - emptyResult := &v1alpha1.NVIDIADriver{} - obj, err := c.Fake. - Invokes(testing.NewRootGetActionWithOptions(nvidiadriversResource, name, options), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NVIDIADriver), err -} - -// List takes label and field selectors, and returns the list of NVIDIADrivers that match those selectors. -func (c *FakeNVIDIADrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NVIDIADriverList, err error) { - emptyResult := &v1alpha1.NVIDIADriverList{} - obj, err := c.Fake. - Invokes(testing.NewRootListActionWithOptions(nvidiadriversResource, nvidiadriversKind, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.NVIDIADriverList{ListMeta: obj.(*v1alpha1.NVIDIADriverList).ListMeta} - for _, item := range obj.(*v1alpha1.NVIDIADriverList).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 nVIDIADrivers. -func (c *FakeNVIDIADrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchActionWithOptions(nvidiadriversResource, opts)) -} - -// Create takes the representation of a nVIDIADriver and creates it. Returns the server's representation of the nVIDIADriver, and an error, if there is any. -func (c *FakeNVIDIADrivers) Create(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.CreateOptions) (result *v1alpha1.NVIDIADriver, err error) { - emptyResult := &v1alpha1.NVIDIADriver{} - obj, err := c.Fake. - Invokes(testing.NewRootCreateActionWithOptions(nvidiadriversResource, nVIDIADriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NVIDIADriver), err -} - -// Update takes the representation of a nVIDIADriver and updates it. Returns the server's representation of the nVIDIADriver, and an error, if there is any. -func (c *FakeNVIDIADrivers) Update(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.UpdateOptions) (result *v1alpha1.NVIDIADriver, err error) { - emptyResult := &v1alpha1.NVIDIADriver{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateActionWithOptions(nvidiadriversResource, nVIDIADriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NVIDIADriver), 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 *FakeNVIDIADrivers) UpdateStatus(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.UpdateOptions) (result *v1alpha1.NVIDIADriver, err error) { - emptyResult := &v1alpha1.NVIDIADriver{} - obj, err := c.Fake. - Invokes(testing.NewRootUpdateSubresourceActionWithOptions(nvidiadriversResource, "status", nVIDIADriver, opts), emptyResult) - if obj == nil { - return emptyResult, err - } - return obj.(*v1alpha1.NVIDIADriver), err -} - -// Delete takes name of the nVIDIADriver and deletes it. Returns an error if one occurs. -func (c *FakeNVIDIADrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteActionWithOptions(nvidiadriversResource, name, opts), &v1alpha1.NVIDIADriver{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeNVIDIADrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { - action := testing.NewRootDeleteCollectionActionWithOptions(nvidiadriversResource, opts, listOpts) - - _, err := c.Fake.Invokes(action, &v1alpha1.NVIDIADriverList{}) - return err -} - -// Patch applies the patch and returns the patched nVIDIADriver. -func (c *FakeNVIDIADrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NVIDIADriver, err error) { - emptyResult := &v1alpha1.NVIDIADriver{} - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceActionWithOptions(nvidiadriversResource, name, pt, data, opts, subresources...), emptyResult) - if obj == nil { - return emptyResult, err +func newFakeNVIDIADrivers(fake *FakeNvidiaV1alpha1) nvidiav1alpha1.NVIDIADriverInterface { + return &fakeNVIDIADrivers{ + gentype.NewFakeClientWithList[*v1alpha1.NVIDIADriver, *v1alpha1.NVIDIADriverList]( + fake.Fake, + "", + v1alpha1.SchemeGroupVersion.WithResource("nvidiadrivers"), + v1alpha1.SchemeGroupVersion.WithKind("NVIDIADriver"), + func() *v1alpha1.NVIDIADriver { return &v1alpha1.NVIDIADriver{} }, + func() *v1alpha1.NVIDIADriverList { return &v1alpha1.NVIDIADriverList{} }, + func(dst, src *v1alpha1.NVIDIADriverList) { dst.ListMeta = src.ListMeta }, + func(list *v1alpha1.NVIDIADriverList) []*v1alpha1.NVIDIADriver { + return gentype.ToPointerSlice(list.Items) + }, + func(list *v1alpha1.NVIDIADriverList, items []*v1alpha1.NVIDIADriver) { + list.Items = gentype.FromPointerSlice(items) + }, + ), + fake, } - return obj.(*v1alpha1.NVIDIADriver), err } diff --git a/api/versioned/typed/nvidia/v1alpha1/nvidia_client.go b/api/versioned/typed/nvidia/v1alpha1/nvidia_client.go index 1fa172e04..53d81bb46 100644 --- a/api/versioned/typed/nvidia/v1alpha1/nvidia_client.go +++ b/api/versioned/typed/nvidia/v1alpha1/nvidia_client.go @@ -19,10 +19,10 @@ package v1alpha1 import ( - "net/http" + http "net/http" - v1alpha1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1alpha1" - "github.com/NVIDIA/gpu-operator/api/versioned/scheme" + nvidiav1alpha1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1alpha1" + scheme "github.com/NVIDIA/gpu-operator/api/versioned/scheme" rest "k8s.io/client-go/rest" ) @@ -85,10 +85,10 @@ func New(c rest.Interface) *NvidiaV1alpha1Client { } func setConfigDefaults(config *rest.Config) error { - gv := v1alpha1.SchemeGroupVersion + gv := nvidiav1alpha1.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/versioned/typed/nvidia/v1alpha1/nvidiadriver.go b/api/versioned/typed/nvidia/v1alpha1/nvidiadriver.go index 21ae61bf5..bf73e4f9c 100644 --- a/api/versioned/typed/nvidia/v1alpha1/nvidiadriver.go +++ b/api/versioned/typed/nvidia/v1alpha1/nvidiadriver.go @@ -19,9 +19,9 @@ package v1alpha1 import ( - "context" + context "context" - v1alpha1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1alpha1" + nvidiav1alpha1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1alpha1" scheme "github.com/NVIDIA/gpu-operator/api/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,33 +37,34 @@ type NVIDIADriversGetter interface { // NVIDIADriverInterface has methods to work with NVIDIADriver resources. type NVIDIADriverInterface interface { - Create(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.CreateOptions) (*v1alpha1.NVIDIADriver, error) - Update(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.UpdateOptions) (*v1alpha1.NVIDIADriver, error) + Create(ctx context.Context, nVIDIADriver *nvidiav1alpha1.NVIDIADriver, opts v1.CreateOptions) (*nvidiav1alpha1.NVIDIADriver, error) + Update(ctx context.Context, nVIDIADriver *nvidiav1alpha1.NVIDIADriver, opts v1.UpdateOptions) (*nvidiav1alpha1.NVIDIADriver, error) // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - UpdateStatus(ctx context.Context, nVIDIADriver *v1alpha1.NVIDIADriver, opts v1.UpdateOptions) (*v1alpha1.NVIDIADriver, error) + UpdateStatus(ctx context.Context, nVIDIADriver *nvidiav1alpha1.NVIDIADriver, opts v1.UpdateOptions) (*nvidiav1alpha1.NVIDIADriver, 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.NVIDIADriver, error) - List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NVIDIADriverList, error) + Get(ctx context.Context, name string, opts v1.GetOptions) (*nvidiav1alpha1.NVIDIADriver, error) + List(ctx context.Context, opts v1.ListOptions) (*nvidiav1alpha1.NVIDIADriverList, 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.NVIDIADriver, err error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *nvidiav1alpha1.NVIDIADriver, err error) NVIDIADriverExpansion } // nVIDIADrivers implements NVIDIADriverInterface type nVIDIADrivers struct { - *gentype.ClientWithList[*v1alpha1.NVIDIADriver, *v1alpha1.NVIDIADriverList] + *gentype.ClientWithList[*nvidiav1alpha1.NVIDIADriver, *nvidiav1alpha1.NVIDIADriverList] } // newNVIDIADrivers returns a NVIDIADrivers func newNVIDIADrivers(c *NvidiaV1alpha1Client) *nVIDIADrivers { return &nVIDIADrivers{ - gentype.NewClientWithList[*v1alpha1.NVIDIADriver, *v1alpha1.NVIDIADriverList]( + gentype.NewClientWithList[*nvidiav1alpha1.NVIDIADriver, *nvidiav1alpha1.NVIDIADriverList]( "nvidiadrivers", c.RESTClient(), scheme.ParameterCodec, "", - func() *v1alpha1.NVIDIADriver { return &v1alpha1.NVIDIADriver{} }, - func() *v1alpha1.NVIDIADriverList { return &v1alpha1.NVIDIADriverList{} }), + func() *nvidiav1alpha1.NVIDIADriver { return &nvidiav1alpha1.NVIDIADriver{} }, + func() *nvidiav1alpha1.NVIDIADriverList { return &nvidiav1alpha1.NVIDIADriverList{} }, + ), } }