diff --git a/DEVEL.md b/DEVEL.md index 49bd4181..df3e43b4 100644 --- a/DEVEL.md +++ b/DEVEL.md @@ -162,7 +162,7 @@ https://github.com/kubernetes/code-generator/blob/master/generate-groups.sh ``` $ generate-groups.sh all github.com/intel/intel-device-plugins-for-kubernetes/pkg/client \ github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis \ - fpga.intel.com:v1 + fpga.intel.com:v2 ``` Please note that the script (at least of v0.18.2-beta.0) expects the device plugins diff --git a/cmd/fpga_admissionwebhook/README.md b/cmd/fpga_admissionwebhook/README.md index a253620f..aec4a612 100644 --- a/cmd/fpga_admissionwebhook/README.md +++ b/cmd/fpga_admissionwebhook/README.md @@ -128,7 +128,7 @@ translated into actual resources provided by the cluster. For the following mapping ```yaml -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb0-preprogrammed diff --git a/cmd/fpga_admissionwebhook/controller.go b/cmd/fpga_admissionwebhook/controller.go index 543c468d..30b6b71c 100644 --- a/cmd/fpga_admissionwebhook/controller.go +++ b/cmd/fpga_admissionwebhook/controller.go @@ -29,7 +29,7 @@ import ( clientset "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" informers "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions" - listers "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v1" + listers "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2" ) const ( @@ -61,8 +61,8 @@ func newController(patcherManager patcherManager, config *rest.Config) (*control informerFactory := informers.NewSharedInformerFactory(clientset, resyncPeriod) stopCh := make(chan struct{}) - afInformer := informerFactory.Fpga().V1().AcceleratorFunctions() - regionInformer := informerFactory.Fpga().V1().FpgaRegions() + afInformer := informerFactory.Fpga().V2().AcceleratorFunctions() + regionInformer := informerFactory.Fpga().V2().FpgaRegions() controller := &controller{ patcherManager: patcherManager, diff --git a/cmd/fpga_admissionwebhook/controller_test.go b/cmd/fpga_admissionwebhook/controller_test.go index 0c44afd5..59a0dc1b 100644 --- a/cmd/fpga_admissionwebhook/controller_test.go +++ b/cmd/fpga_admissionwebhook/controller_test.go @@ -24,12 +24,12 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/rest" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" - listers "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" + listers "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2" ) type fakeAfNamespaceLister struct { - af *v1.AcceleratorFunction + af *v2.AcceleratorFunction err error } @@ -37,16 +37,16 @@ func init() { flag.Set("v", "4") ///Enable debug output } -func (nl *fakeAfNamespaceLister) Get(name string) (*v1.AcceleratorFunction, error) { +func (nl *fakeAfNamespaceLister) Get(name string) (*v2.AcceleratorFunction, error) { return nl.af, nl.err } -func (nl *fakeAfNamespaceLister) List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) { +func (nl *fakeAfNamespaceLister) List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) { return nil, nil } type fakeAfLister struct { - af *v1.AcceleratorFunction + af *v2.AcceleratorFunction err error } @@ -57,7 +57,7 @@ func (l *fakeAfLister) AcceleratorFunctions(namespace string) listers.Accelerato } } -func (l *fakeAfLister) List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) { +func (l *fakeAfLister) List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) { return nil, nil } @@ -76,11 +76,11 @@ func TestSyncAfHandler(t *testing.T) { name: "Known key", key: "default/arria10-nlb0", afLister: &fakeAfLister{ - af: &v1.AcceleratorFunction{ + af: &v2.AcceleratorFunction{ ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: v1.AcceleratorFunctionSpec{ + Spec: v2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", }, }, @@ -120,20 +120,20 @@ func TestSyncAfHandler(t *testing.T) { } type fakeRegionNamespaceLister struct { - region *v1.FpgaRegion + region *v2.FpgaRegion err error } -func (nl *fakeRegionNamespaceLister) Get(name string) (*v1.FpgaRegion, error) { +func (nl *fakeRegionNamespaceLister) Get(name string) (*v2.FpgaRegion, error) { return nl.region, nl.err } -func (nl *fakeRegionNamespaceLister) List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) { +func (nl *fakeRegionNamespaceLister) List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) { return nil, nil } type fakeRegionLister struct { - region *v1.FpgaRegion + region *v2.FpgaRegion err error } @@ -144,7 +144,7 @@ func (l *fakeRegionLister) FpgaRegions(namespace string) listers.FpgaRegionNames } } -func (l *fakeRegionLister) List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) { +func (l *fakeRegionLister) List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) { return nil, nil } @@ -163,11 +163,11 @@ func TestSyncRegionHandler(t *testing.T) { name: "Known key", key: "default/arria10", regionLister: &fakeRegionLister{ - region: &v1.FpgaRegion{ + region: &v2.FpgaRegion{ ObjectMeta: metav1.ObjectMeta{ Name: "arria10", }, - Spec: v1.FpgaRegionSpec{ + Spec: v2.FpgaRegionSpec{ InterfaceID: "ce48969398f05f33946d560708be108a", }, }, @@ -328,9 +328,9 @@ func TestProcessNextWorkItem(t *testing.T) { func TestCreateEventhandler(t *testing.T) { funcs := createEventHandler("testkind", &fakeQueue{}) - funcs.AddFunc(&v1.FpgaRegion{}) - funcs.UpdateFunc(nil, &v1.FpgaRegion{}) - funcs.DeleteFunc(&v1.FpgaRegion{}) + funcs.AddFunc(&v2.FpgaRegion{}) + funcs.UpdateFunc(nil, &v2.FpgaRegion{}) + funcs.DeleteFunc(&v2.FpgaRegion{}) } func TestRun(t *testing.T) { diff --git a/cmd/fpga_admissionwebhook/fpga_admissionwebhook_test.go b/cmd/fpga_admissionwebhook/fpga_admissionwebhook_test.go index 5a4b3d30..910207c5 100644 --- a/cmd/fpga_admissionwebhook/fpga_admissionwebhook_test.go +++ b/cmd/fpga_admissionwebhook/fpga_admissionwebhook_test.go @@ -24,7 +24,7 @@ import ( "strings" "testing" - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" "k8s.io/api/admission/v1beta1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -239,11 +239,11 @@ func TestMutatePods(t *testing.T) { for _, tcase := range tcases { t.Run(tcase.name, func(t *testing.T) { p := newPatcher() - p.addRegion(&fpgav1.FpgaRegion{ + p.addRegion(&fpgav2.FpgaRegion{ ObjectMeta: metav1.ObjectMeta{ Name: "arria10", }, - Spec: fpgav1.FpgaRegionSpec{ + Spec: fpgav2.FpgaRegionSpec{ InterfaceID: "ce48969398f05f33946d560708be108a", }, }) diff --git a/cmd/fpga_admissionwebhook/patcher.go b/cmd/fpga_admissionwebhook/patcher.go index 5dd3a47c..9b34ca95 100644 --- a/cmd/fpga_admissionwebhook/patcher.go +++ b/cmd/fpga_admissionwebhook/patcher.go @@ -26,7 +26,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/klog" - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" "github.com/intel/intel-device-plugins-for-kubernetes/pkg/fpga" ) @@ -71,20 +71,20 @@ var ( type patcher struct { sync.Mutex - afMap map[string]*fpgav1.AcceleratorFunction + afMap map[string]*fpgav2.AcceleratorFunction resourceMap map[string]string resourceModeMap map[string]string } func newPatcher() *patcher { return &patcher{ - afMap: make(map[string]*fpgav1.AcceleratorFunction), + afMap: make(map[string]*fpgav2.AcceleratorFunction), resourceMap: make(map[string]string), resourceModeMap: make(map[string]string), } } -func (p *patcher) addAf(accfunc *fpgav1.AcceleratorFunction) error { +func (p *patcher) addAf(accfunc *fpgav2.AcceleratorFunction) error { defer p.Unlock() p.Lock() @@ -104,7 +104,7 @@ func (p *patcher) addAf(accfunc *fpgav1.AcceleratorFunction) error { return nil } -func (p *patcher) addRegion(region *fpgav1.FpgaRegion) { +func (p *patcher) addRegion(region *fpgav2.FpgaRegion) { defer p.Unlock() p.Lock() diff --git a/cmd/fpga_admissionwebhook/patcher_test.go b/cmd/fpga_admissionwebhook/patcher_test.go index 401aa003..6be68b54 100644 --- a/cmd/fpga_admissionwebhook/patcher_test.go +++ b/cmd/fpga_admissionwebhook/patcher_test.go @@ -22,7 +22,7 @@ import ( "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" ) func init() { @@ -30,19 +30,19 @@ func init() { } func TestPatcherStorageFunctions(t *testing.T) { - af := &fpgav1.AcceleratorFunction{ + af := &fpgav2.AcceleratorFunction{ ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", }, } - region := &fpgav1.FpgaRegion{ + region := &fpgav2.FpgaRegion{ ObjectMeta: metav1.ObjectMeta{ Name: "arria10", }, - Spec: fpgav1.FpgaRegionSpec{ + Spec: fpgav2.FpgaRegionSpec{ InterfaceID: "ce48969398f05f33946d560708be108a", }, } @@ -74,8 +74,8 @@ func TestGetPatchOps(t *testing.T) { tcases := []struct { name string container corev1.Container - afs []*fpgav1.AcceleratorFunction - regions []*fpgav1.FpgaRegion + afs []*fpgav2.AcceleratorFunction + regions []*fpgav2.FpgaRegion expectedErr bool expectedOps int }{ @@ -101,12 +101,12 @@ func TestGetPatchOps(t *testing.T) { }, }, }, - afs: []*fpgav1.AcceleratorFunction{ + afs: []*fpgav2.AcceleratorFunction{ { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "ce48969398f05f33946d560708be108a", Mode: region, @@ -116,7 +116,7 @@ func TestGetPatchOps(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0-alias", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "ce48969398f05f33946d560708be108a", Mode: region, @@ -137,12 +137,12 @@ func TestGetPatchOps(t *testing.T) { }, }, }, - afs: []*fpgav1.AcceleratorFunction{ + afs: []*fpgav2.AcceleratorFunction{ { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "ce48969398f05f33946d560708be108a", Mode: af, @@ -163,12 +163,12 @@ func TestGetPatchOps(t *testing.T) { }, }, }, - regions: []*fpgav1.FpgaRegion{ + regions: []*fpgav2.FpgaRegion{ { ObjectMeta: metav1.ObjectMeta{ Name: "arria10", }, - Spec: fpgav1.FpgaRegionSpec{ + Spec: fpgav2.FpgaRegionSpec{ InterfaceID: "ce48969398f05f33946d560708be108a", }, }, @@ -260,12 +260,12 @@ func TestGetPatchOps(t *testing.T) { }, }, }, - afs: []*fpgav1.AcceleratorFunction{ + afs: []*fpgav2.AcceleratorFunction{ { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "ce48969398f05f33946d560708be108a", Mode: region, @@ -275,7 +275,7 @@ func TestGetPatchOps(t *testing.T) { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb3", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "f7df405cbd7acf7222f144b0b93acd18", Mode: af, @@ -296,12 +296,12 @@ func TestGetPatchOps(t *testing.T) { }, }, }, - afs: []*fpgav1.AcceleratorFunction{ + afs: []*fpgav2.AcceleratorFunction{ { ObjectMeta: metav1.ObjectMeta{ Name: "arria10-nlb0", }, - Spec: fpgav1.AcceleratorFunctionSpec{ + Spec: fpgav2.AcceleratorFunctionSpec{ AfuID: "d8424dc4a4a3c413f89e433683f9040b", InterfaceID: "ce48969398f05f33946d560708be108a", Mode: "unknown", diff --git a/deployments/fpga_admissionwebhook/af-crd.yaml b/deployments/fpga_admissionwebhook/af-crd.yaml index cdfc5072..2f6452bd 100644 --- a/deployments/fpga_admissionwebhook/af-crd.yaml +++ b/deployments/fpga_admissionwebhook/af-crd.yaml @@ -4,7 +4,7 @@ metadata: name: acceleratorfunctions.fpga.intel.com spec: group: fpga.intel.com - version: v1 + version: v2 scope: Namespaced names: plural: acceleratorfunctions diff --git a/deployments/fpga_admissionwebhook/base/acceleratorfunctions.yaml b/deployments/fpga_admissionwebhook/base/acceleratorfunctions.yaml index 39abaeb6..8eeb8b4f 100644 --- a/deployments/fpga_admissionwebhook/base/acceleratorfunctions.yaml +++ b/deployments/fpga_admissionwebhook/base/acceleratorfunctions.yaml @@ -1,12 +1,12 @@ # DCP 1.0 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.0-nlb0 spec: afuId: d8424dc4a4a3c413f89e433683f9040b --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.0-nlb3 @@ -14,14 +14,14 @@ spec: afuId: f7df405cbd7acf7222f144b0b93acd18 --- # DCP 1.1 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.1-nlb0 spec: afuId: d8424dc4a4a3c413f89e433683f9040b --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.1-nlb3 @@ -29,14 +29,14 @@ spec: afuId: f7df405cbd7acf7222f144b0b93acd18 --- # DCP 1.2 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb0 spec: afuId: d8424dc4a4a3c413f89e433683f9040b --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb3 @@ -44,14 +44,14 @@ spec: afuId: f7df405cbd7acf7222f144b0b93acd18 --- # D5005 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: d5005-nlb0 spec: afuId: d8424dc4a4a3c413f89e433683f9040b --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: d5005-nlb3 diff --git a/deployments/fpga_admissionwebhook/base/regions.yaml b/deployments/fpga_admissionwebhook/base/regions.yaml index 5fabf413..a9f84e52 100644 --- a/deployments/fpga_admissionwebhook/base/regions.yaml +++ b/deployments/fpga_admissionwebhook/base/regions.yaml @@ -1,5 +1,5 @@ # DCP 1.0 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.0 @@ -7,7 +7,7 @@ spec: interfaceId: ce48969398f05f33946d560708be108a --- # DCP 1.1 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.1 @@ -15,7 +15,7 @@ spec: interfaceId: 9926ab6d6c925a68aabca7d84c545738 --- # DCP 1.2 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.2 @@ -23,7 +23,7 @@ spec: interfaceId: 69528db6eb31577a8c3668f9faa081f6 --- # D5005 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: d5005 diff --git a/deployments/fpga_admissionwebhook/mappings-collection.yaml b/deployments/fpga_admissionwebhook/mappings-collection.yaml index 6498f3e5..68054cf9 100644 --- a/deployments/fpga_admissionwebhook/mappings-collection.yaml +++ b/deployments/fpga_admissionwebhook/mappings-collection.yaml @@ -1,12 +1,12 @@ # DCP 1.0 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.0 spec: interfaceId: ce48969398f05f33946d560708be108a --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.0-nlb0-orchestrated @@ -15,7 +15,7 @@ spec: interfaceId: ce48969398f05f33946d560708be108a mode: region --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.0-nlb3-orchestrated @@ -25,14 +25,14 @@ spec: mode: region --- # DCP 1.1 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.1 spec: interfaceId: 9926ab6d6c925a68aabca7d84c545738 --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.1-nlb0-orchestrated @@ -41,7 +41,7 @@ spec: interfaceId: 9926ab6d6c925a68aabca7d84c545738 mode: region --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.1-nlb3-orchestrated @@ -51,14 +51,14 @@ spec: mode: region --- # DCP 1.2 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: arria10.dcp1.2 spec: interfaceId: 69528db6eb31577a8c3668f9faa081f6 --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb0-orchestrated @@ -67,7 +67,7 @@ spec: interfaceId: 69528db6eb31577a8c3668f9faa081f6 mode: region --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb0-preprogrammed @@ -76,7 +76,7 @@ spec: interfaceId: 69528db6eb31577a8c3668f9faa081f6 mode: af --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: arria10.dcp1.2-nlb3-orchestrated @@ -86,14 +86,14 @@ spec: mode: region --- # D5005 -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: FpgaRegion metadata: name: d5005 spec: interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: d5005-nlb0-orchestrated @@ -102,7 +102,7 @@ spec: interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d mode: region --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: d5005-nlb3-orchestrated @@ -111,7 +111,7 @@ spec: interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d mode: region --- -apiVersion: fpga.intel.com/v1 +apiVersion: fpga.intel.com/v2 kind: AcceleratorFunction metadata: name: d5005-nlb3-preprogrammed diff --git a/deployments/fpga_admissionwebhook/region-crd.yaml b/deployments/fpga_admissionwebhook/region-crd.yaml index d8a7ab29..d5dcc8c5 100644 --- a/deployments/fpga_admissionwebhook/region-crd.yaml +++ b/deployments/fpga_admissionwebhook/region-crd.yaml @@ -4,7 +4,7 @@ metadata: name: fpgaregions.fpga.intel.com spec: group: fpga.intel.com - version: v1 + version: v2 scope: Namespaced names: plural: fpgaregions diff --git a/pkg/apis/fpga.intel.com/v1/doc.go b/pkg/apis/fpga.intel.com/v2/doc.go similarity index 86% rename from pkg/apis/fpga.intel.com/v1/doc.go rename to pkg/apis/fpga.intel.com/v2/doc.go index 4f445318..dabb3430 100644 --- a/pkg/apis/fpga.intel.com/v1/doc.go +++ b/pkg/apis/fpga.intel.com/v2/doc.go @@ -2,4 +2,4 @@ // +groupName=fpga.intel.com -package v1 +package v2 diff --git a/pkg/apis/fpga.intel.com/v1/register.go b/pkg/apis/fpga.intel.com/v2/register.go similarity index 97% rename from pkg/apis/fpga.intel.com/v1/register.go rename to pkg/apis/fpga.intel.com/v2/register.go index d6bcf793..1c464588 100644 --- a/pkg/apis/fpga.intel.com/v1/register.go +++ b/pkg/apis/fpga.intel.com/v2/register.go @@ -1,4 +1,4 @@ -package v1 +package v2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -9,7 +9,7 @@ import ( ) // SchemeGroupVersion is group version used to register these objects -var SchemeGroupVersion = schema.GroupVersion{Group: fpgaintel.GroupName, Version: "v1"} +var SchemeGroupVersion = schema.GroupVersion{Group: fpgaintel.GroupName, Version: "v2"} // Kind takes an unqualified kind and returns back a Group qualified GroupKind func Kind(kind string) schema.GroupKind { diff --git a/pkg/apis/fpga.intel.com/v1/types.go b/pkg/apis/fpga.intel.com/v2/types.go similarity index 99% rename from pkg/apis/fpga.intel.com/v1/types.go rename to pkg/apis/fpga.intel.com/v2/types.go index fbe000c9..21816843 100644 --- a/pkg/apis/fpga.intel.com/v1/types.go +++ b/pkg/apis/fpga.intel.com/v2/types.go @@ -1,4 +1,4 @@ -package v1 +package v2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/apis/fpga.intel.com/v1/zz_generated.deepcopy.go b/pkg/apis/fpga.intel.com/v2/zz_generated.deepcopy.go similarity index 99% rename from pkg/apis/fpga.intel.com/v1/zz_generated.deepcopy.go rename to pkg/apis/fpga.intel.com/v2/zz_generated.deepcopy.go index 2cc34692..50f7652d 100644 --- a/pkg/apis/fpga.intel.com/v1/zz_generated.deepcopy.go +++ b/pkg/apis/fpga.intel.com/v2/zz_generated.deepcopy.go @@ -16,7 +16,7 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1 +package v2 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 23b58ff1..4eb25ce3 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -19,7 +19,7 @@ package versioned import ( "fmt" - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v2" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -27,19 +27,19 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - FpgaV1() fpgav1.FpgaV1Interface + FpgaV2() fpgav2.FpgaV2Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - fpgaV1 *fpgav1.FpgaV1Client + fpgaV2 *fpgav2.FpgaV2Client } -// FpgaV1 retrieves the FpgaV1Client -func (c *Clientset) FpgaV1() fpgav1.FpgaV1Interface { - return c.fpgaV1 +// FpgaV2 retrieves the FpgaV2Client +func (c *Clientset) FpgaV2() fpgav2.FpgaV2Interface { + return c.fpgaV2 } // Discovery retrieves the DiscoveryClient @@ -63,7 +63,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.fpgaV1, err = fpgav1.NewForConfig(&configShallowCopy) + cs.fpgaV2, err = fpgav2.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -79,7 +79,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.fpgaV1 = fpgav1.NewForConfigOrDie(c) + cs.fpgaV2 = fpgav2.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -88,7 +88,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.fpgaV1 = fpgav1.New(c) + cs.fpgaV2 = fpgav2.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index e62f2934..8646d1ad 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -18,8 +18,8 @@ package fake import ( clientset "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v1" - fakefpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v2" + fakefpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -74,7 +74,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} -// FpgaV1 retrieves the FpgaV1Client -func (c *Clientset) FpgaV1() fpgav1.FpgaV1Interface { - return &fakefpgav1.FakeFpgaV1{Fake: &c.Fake} +// FpgaV2 retrieves the FpgaV2Client +func (c *Clientset) FpgaV2() fpgav2.FpgaV2Interface { + return &fakefpgav2.FakeFpgaV2{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 45ad3e0e..ba0255af 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -17,7 +17,7 @@ package fake import ( - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -29,7 +29,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - fpgav1.AddToScheme, + fpgav2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 2d4af422..f3523ba3 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -17,7 +17,7 @@ package scheme import ( - fpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -29,7 +29,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - fpgav1.AddToScheme, + fpgav2.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/acceleratorfunction.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/acceleratorfunction.go similarity index 71% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/acceleratorfunction.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/acceleratorfunction.go index fd00ce8b..c0faf558 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/acceleratorfunction.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/acceleratorfunction.go @@ -14,15 +14,15 @@ // Code generated by client-gen. DO NOT EDIT. -package v1 +package v2 import ( "context" "time" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" scheme "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" @@ -36,14 +36,14 @@ type AcceleratorFunctionsGetter interface { // AcceleratorFunctionInterface has methods to work with AcceleratorFunction resources. type AcceleratorFunctionInterface interface { - Create(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.CreateOptions) (*v1.AcceleratorFunction, error) - Update(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.UpdateOptions) (*v1.AcceleratorFunction, 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.AcceleratorFunction, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.AcceleratorFunctionList, 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.AcceleratorFunction, err error) + Create(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.CreateOptions) (*v2.AcceleratorFunction, error) + Update(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.UpdateOptions) (*v2.AcceleratorFunction, 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) (*v2.AcceleratorFunction, error) + List(ctx context.Context, opts v1.ListOptions) (*v2.AcceleratorFunctionList, 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 *v2.AcceleratorFunction, err error) AcceleratorFunctionExpansion } @@ -54,7 +54,7 @@ type acceleratorFunctions struct { } // newAcceleratorFunctions returns a AcceleratorFunctions -func newAcceleratorFunctions(c *FpgaV1Client, namespace string) *acceleratorFunctions { +func newAcceleratorFunctions(c *FpgaV2Client, namespace string) *acceleratorFunctions { return &acceleratorFunctions{ client: c.RESTClient(), ns: namespace, @@ -62,8 +62,8 @@ func newAcceleratorFunctions(c *FpgaV1Client, namespace string) *acceleratorFunc } // Get takes name of the acceleratorFunction, and returns the corresponding acceleratorFunction object, and an error if there is any. -func (c *acceleratorFunctions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.AcceleratorFunction, err error) { - result = &v1.AcceleratorFunction{} +func (c *acceleratorFunctions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.AcceleratorFunction, err error) { + result = &v2.AcceleratorFunction{} err = c.client.Get(). Namespace(c.ns). Resource("acceleratorfunctions"). @@ -75,12 +75,12 @@ func (c *acceleratorFunctions) Get(ctx context.Context, name string, options met } // List takes label and field selectors, and returns the list of AcceleratorFunctions that match those selectors. -func (c *acceleratorFunctions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AcceleratorFunctionList, err error) { +func (c *acceleratorFunctions) List(ctx context.Context, opts v1.ListOptions) (result *v2.AcceleratorFunctionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1.AcceleratorFunctionList{} + result = &v2.AcceleratorFunctionList{} err = c.client.Get(). Namespace(c.ns). Resource("acceleratorfunctions"). @@ -92,7 +92,7 @@ func (c *acceleratorFunctions) List(ctx context.Context, opts metav1.ListOptions } // Watch returns a watch.Interface that watches the requested acceleratorFunctions. -func (c *acceleratorFunctions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *acceleratorFunctions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -107,8 +107,8 @@ func (c *acceleratorFunctions) Watch(ctx context.Context, opts metav1.ListOption } // Create takes the representation of a acceleratorFunction and creates it. Returns the server's representation of the acceleratorFunction, and an error, if there is any. -func (c *acceleratorFunctions) Create(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.CreateOptions) (result *v1.AcceleratorFunction, err error) { - result = &v1.AcceleratorFunction{} +func (c *acceleratorFunctions) Create(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.CreateOptions) (result *v2.AcceleratorFunction, err error) { + result = &v2.AcceleratorFunction{} err = c.client.Post(). Namespace(c.ns). Resource("acceleratorfunctions"). @@ -120,8 +120,8 @@ func (c *acceleratorFunctions) Create(ctx context.Context, acceleratorFunction * } // Update takes the representation of a acceleratorFunction and updates it. Returns the server's representation of the acceleratorFunction, and an error, if there is any. -func (c *acceleratorFunctions) Update(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.UpdateOptions) (result *v1.AcceleratorFunction, err error) { - result = &v1.AcceleratorFunction{} +func (c *acceleratorFunctions) Update(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.UpdateOptions) (result *v2.AcceleratorFunction, err error) { + result = &v2.AcceleratorFunction{} err = c.client.Put(). Namespace(c.ns). Resource("acceleratorfunctions"). @@ -134,7 +134,7 @@ func (c *acceleratorFunctions) Update(ctx context.Context, acceleratorFunction * } // Delete takes name of the acceleratorFunction and deletes it. Returns an error if one occurs. -func (c *acceleratorFunctions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *acceleratorFunctions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("acceleratorfunctions"). @@ -145,7 +145,7 @@ func (c *acceleratorFunctions) Delete(ctx context.Context, name string, opts met } // DeleteCollection deletes a collection of objects. -func (c *acceleratorFunctions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *acceleratorFunctions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration if listOpts.TimeoutSeconds != nil { timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second @@ -161,8 +161,8 @@ func (c *acceleratorFunctions) DeleteCollection(ctx context.Context, opts metav1 } // Patch applies the patch and returns the patched acceleratorFunction. -func (c *acceleratorFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.AcceleratorFunction, err error) { - result = &v1.AcceleratorFunction{} +func (c *acceleratorFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.AcceleratorFunction, err error) { + result = &v2.AcceleratorFunction{} err = c.client.Patch(pt). Namespace(c.ns). Resource("acceleratorfunctions"). diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/doc.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/doc.go similarity index 98% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/doc.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/doc.go index 6bb5f79e..871f6f2e 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/doc.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/doc.go @@ -15,4 +15,4 @@ // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1 +package v2 diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/doc.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/doc.go similarity index 100% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/doc.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/doc.go diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_acceleratorfunction.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_acceleratorfunction.go similarity index 70% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_acceleratorfunction.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_acceleratorfunction.go index 3988156a..3fb37b20 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_acceleratorfunction.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_acceleratorfunction.go @@ -19,7 +19,7 @@ package fake import ( "context" - fpgaintelcomv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeAcceleratorFunctions implements AcceleratorFunctionInterface type FakeAcceleratorFunctions struct { - Fake *FakeFpgaV1 + Fake *FakeFpgaV2 ns string } -var acceleratorfunctionsResource = schema.GroupVersionResource{Group: "fpga.intel.com", Version: "v1", Resource: "acceleratorfunctions"} +var acceleratorfunctionsResource = schema.GroupVersionResource{Group: "fpga.intel.com", Version: "v2", Resource: "acceleratorfunctions"} -var acceleratorfunctionsKind = schema.GroupVersionKind{Group: "fpga.intel.com", Version: "v1", Kind: "AcceleratorFunction"} +var acceleratorfunctionsKind = schema.GroupVersionKind{Group: "fpga.intel.com", Version: "v2", Kind: "AcceleratorFunction"} // Get takes name of the acceleratorFunction, and returns the corresponding acceleratorFunction object, and an error if there is any. -func (c *FakeAcceleratorFunctions) Get(ctx context.Context, name string, options v1.GetOptions) (result *fpgaintelcomv1.AcceleratorFunction, err error) { +func (c *FakeAcceleratorFunctions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.AcceleratorFunction, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(acceleratorfunctionsResource, c.ns, name), &fpgaintelcomv1.AcceleratorFunction{}) + Invokes(testing.NewGetAction(acceleratorfunctionsResource, c.ns, name), &v2.AcceleratorFunction{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.AcceleratorFunction), err + return obj.(*v2.AcceleratorFunction), err } // List takes label and field selectors, and returns the list of AcceleratorFunctions that match those selectors. -func (c *FakeAcceleratorFunctions) List(ctx context.Context, opts v1.ListOptions) (result *fpgaintelcomv1.AcceleratorFunctionList, err error) { +func (c *FakeAcceleratorFunctions) List(ctx context.Context, opts v1.ListOptions) (result *v2.AcceleratorFunctionList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(acceleratorfunctionsResource, acceleratorfunctionsKind, c.ns, opts), &fpgaintelcomv1.AcceleratorFunctionList{}) + Invokes(testing.NewListAction(acceleratorfunctionsResource, acceleratorfunctionsKind, c.ns, opts), &v2.AcceleratorFunctionList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeAcceleratorFunctions) List(ctx context.Context, opts v1.ListOptions if label == nil { label = labels.Everything() } - list := &fpgaintelcomv1.AcceleratorFunctionList{ListMeta: obj.(*fpgaintelcomv1.AcceleratorFunctionList).ListMeta} - for _, item := range obj.(*fpgaintelcomv1.AcceleratorFunctionList).Items { + list := &v2.AcceleratorFunctionList{ListMeta: obj.(*v2.AcceleratorFunctionList).ListMeta} + for _, item := range obj.(*v2.AcceleratorFunctionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeAcceleratorFunctions) Watch(ctx context.Context, opts v1.ListOption } // Create takes the representation of a acceleratorFunction and creates it. Returns the server's representation of the acceleratorFunction, and an error, if there is any. -func (c *FakeAcceleratorFunctions) Create(ctx context.Context, acceleratorFunction *fpgaintelcomv1.AcceleratorFunction, opts v1.CreateOptions) (result *fpgaintelcomv1.AcceleratorFunction, err error) { +func (c *FakeAcceleratorFunctions) Create(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.CreateOptions) (result *v2.AcceleratorFunction, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(acceleratorfunctionsResource, c.ns, acceleratorFunction), &fpgaintelcomv1.AcceleratorFunction{}) + Invokes(testing.NewCreateAction(acceleratorfunctionsResource, c.ns, acceleratorFunction), &v2.AcceleratorFunction{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.AcceleratorFunction), err + return obj.(*v2.AcceleratorFunction), err } // Update takes the representation of a acceleratorFunction and updates it. Returns the server's representation of the acceleratorFunction, and an error, if there is any. -func (c *FakeAcceleratorFunctions) Update(ctx context.Context, acceleratorFunction *fpgaintelcomv1.AcceleratorFunction, opts v1.UpdateOptions) (result *fpgaintelcomv1.AcceleratorFunction, err error) { +func (c *FakeAcceleratorFunctions) Update(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.UpdateOptions) (result *v2.AcceleratorFunction, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(acceleratorfunctionsResource, c.ns, acceleratorFunction), &fpgaintelcomv1.AcceleratorFunction{}) + Invokes(testing.NewUpdateAction(acceleratorfunctionsResource, c.ns, acceleratorFunction), &v2.AcceleratorFunction{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.AcceleratorFunction), err + return obj.(*v2.AcceleratorFunction), err } // Delete takes name of the acceleratorFunction and deletes it. Returns an error if one occurs. func (c *FakeAcceleratorFunctions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(acceleratorfunctionsResource, c.ns, name), &fpgaintelcomv1.AcceleratorFunction{}) + Invokes(testing.NewDeleteAction(acceleratorfunctionsResource, c.ns, name), &v2.AcceleratorFunction{}) return err } @@ -112,17 +112,17 @@ func (c *FakeAcceleratorFunctions) Delete(ctx context.Context, name string, opts func (c *FakeAcceleratorFunctions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(acceleratorfunctionsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &fpgaintelcomv1.AcceleratorFunctionList{}) + _, err := c.Fake.Invokes(action, &v2.AcceleratorFunctionList{}) return err } // Patch applies the patch and returns the patched acceleratorFunction. -func (c *FakeAcceleratorFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *fpgaintelcomv1.AcceleratorFunction, err error) { +func (c *FakeAcceleratorFunctions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.AcceleratorFunction, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(acceleratorfunctionsResource, c.ns, name, pt, data, subresources...), &fpgaintelcomv1.AcceleratorFunction{}) + Invokes(testing.NewPatchSubresourceAction(acceleratorfunctionsResource, c.ns, name, pt, data, subresources...), &v2.AcceleratorFunction{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.AcceleratorFunction), err + return obj.(*v2.AcceleratorFunction), err } diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpga.intel.com_client.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpga.intel.com_client.go similarity index 76% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpga.intel.com_client.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpga.intel.com_client.go index 09fcc5c5..4bb3fbc5 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpga.intel.com_client.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpga.intel.com_client.go @@ -17,26 +17,26 @@ package fake import ( - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v2" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" ) -type FakeFpgaV1 struct { +type FakeFpgaV2 struct { *testing.Fake } -func (c *FakeFpgaV1) AcceleratorFunctions(namespace string) v1.AcceleratorFunctionInterface { +func (c *FakeFpgaV2) AcceleratorFunctions(namespace string) v2.AcceleratorFunctionInterface { return &FakeAcceleratorFunctions{c, namespace} } -func (c *FakeFpgaV1) FpgaRegions(namespace string) v1.FpgaRegionInterface { +func (c *FakeFpgaV2) FpgaRegions(namespace string) v2.FpgaRegionInterface { return &FakeFpgaRegions{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeFpgaV1) RESTClient() rest.Interface { +func (c *FakeFpgaV2) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpgaregion.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpgaregion.go similarity index 74% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpgaregion.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpgaregion.go index 4ed70dd4..d11896fd 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake/fake_fpgaregion.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fake/fake_fpgaregion.go @@ -19,7 +19,7 @@ package fake import ( "context" - fpgaintelcomv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeFpgaRegions implements FpgaRegionInterface type FakeFpgaRegions struct { - Fake *FakeFpgaV1 + Fake *FakeFpgaV2 ns string } -var fpgaregionsResource = schema.GroupVersionResource{Group: "fpga.intel.com", Version: "v1", Resource: "fpgaregions"} +var fpgaregionsResource = schema.GroupVersionResource{Group: "fpga.intel.com", Version: "v2", Resource: "fpgaregions"} -var fpgaregionsKind = schema.GroupVersionKind{Group: "fpga.intel.com", Version: "v1", Kind: "FpgaRegion"} +var fpgaregionsKind = schema.GroupVersionKind{Group: "fpga.intel.com", Version: "v2", Kind: "FpgaRegion"} // Get takes name of the fpgaRegion, and returns the corresponding fpgaRegion object, and an error if there is any. -func (c *FakeFpgaRegions) Get(ctx context.Context, name string, options v1.GetOptions) (result *fpgaintelcomv1.FpgaRegion, err error) { +func (c *FakeFpgaRegions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.FpgaRegion, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(fpgaregionsResource, c.ns, name), &fpgaintelcomv1.FpgaRegion{}) + Invokes(testing.NewGetAction(fpgaregionsResource, c.ns, name), &v2.FpgaRegion{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.FpgaRegion), err + return obj.(*v2.FpgaRegion), err } // List takes label and field selectors, and returns the list of FpgaRegions that match those selectors. -func (c *FakeFpgaRegions) List(ctx context.Context, opts v1.ListOptions) (result *fpgaintelcomv1.FpgaRegionList, err error) { +func (c *FakeFpgaRegions) List(ctx context.Context, opts v1.ListOptions) (result *v2.FpgaRegionList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(fpgaregionsResource, fpgaregionsKind, c.ns, opts), &fpgaintelcomv1.FpgaRegionList{}) + Invokes(testing.NewListAction(fpgaregionsResource, fpgaregionsKind, c.ns, opts), &v2.FpgaRegionList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeFpgaRegions) List(ctx context.Context, opts v1.ListOptions) (result if label == nil { label = labels.Everything() } - list := &fpgaintelcomv1.FpgaRegionList{ListMeta: obj.(*fpgaintelcomv1.FpgaRegionList).ListMeta} - for _, item := range obj.(*fpgaintelcomv1.FpgaRegionList).Items { + list := &v2.FpgaRegionList{ListMeta: obj.(*v2.FpgaRegionList).ListMeta} + for _, item := range obj.(*v2.FpgaRegionList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeFpgaRegions) Watch(ctx context.Context, opts v1.ListOptions) (watch } // Create takes the representation of a fpgaRegion and creates it. Returns the server's representation of the fpgaRegion, and an error, if there is any. -func (c *FakeFpgaRegions) Create(ctx context.Context, fpgaRegion *fpgaintelcomv1.FpgaRegion, opts v1.CreateOptions) (result *fpgaintelcomv1.FpgaRegion, err error) { +func (c *FakeFpgaRegions) Create(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.CreateOptions) (result *v2.FpgaRegion, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(fpgaregionsResource, c.ns, fpgaRegion), &fpgaintelcomv1.FpgaRegion{}) + Invokes(testing.NewCreateAction(fpgaregionsResource, c.ns, fpgaRegion), &v2.FpgaRegion{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.FpgaRegion), err + return obj.(*v2.FpgaRegion), err } // Update takes the representation of a fpgaRegion and updates it. Returns the server's representation of the fpgaRegion, and an error, if there is any. -func (c *FakeFpgaRegions) Update(ctx context.Context, fpgaRegion *fpgaintelcomv1.FpgaRegion, opts v1.UpdateOptions) (result *fpgaintelcomv1.FpgaRegion, err error) { +func (c *FakeFpgaRegions) Update(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.UpdateOptions) (result *v2.FpgaRegion, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(fpgaregionsResource, c.ns, fpgaRegion), &fpgaintelcomv1.FpgaRegion{}) + Invokes(testing.NewUpdateAction(fpgaregionsResource, c.ns, fpgaRegion), &v2.FpgaRegion{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.FpgaRegion), err + return obj.(*v2.FpgaRegion), err } // Delete takes name of the fpgaRegion and deletes it. Returns an error if one occurs. func (c *FakeFpgaRegions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(fpgaregionsResource, c.ns, name), &fpgaintelcomv1.FpgaRegion{}) + Invokes(testing.NewDeleteAction(fpgaregionsResource, c.ns, name), &v2.FpgaRegion{}) return err } @@ -112,17 +112,17 @@ func (c *FakeFpgaRegions) Delete(ctx context.Context, name string, opts v1.Delet func (c *FakeFpgaRegions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { action := testing.NewDeleteCollectionAction(fpgaregionsResource, c.ns, listOpts) - _, err := c.Fake.Invokes(action, &fpgaintelcomv1.FpgaRegionList{}) + _, err := c.Fake.Invokes(action, &v2.FpgaRegionList{}) return err } // Patch applies the patch and returns the patched fpgaRegion. -func (c *FakeFpgaRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *fpgaintelcomv1.FpgaRegion, err error) { +func (c *FakeFpgaRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.FpgaRegion, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(fpgaregionsResource, c.ns, name, pt, data, subresources...), &fpgaintelcomv1.FpgaRegion{}) + Invokes(testing.NewPatchSubresourceAction(fpgaregionsResource, c.ns, name, pt, data, subresources...), &v2.FpgaRegion{}) if obj == nil { return nil, err } - return obj.(*fpgaintelcomv1.FpgaRegion), err + return obj.(*v2.FpgaRegion), err } diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpga.intel.com_client.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpga.intel.com_client.go similarity index 68% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpga.intel.com_client.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpga.intel.com_client.go index 26db422e..7340b470 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpga.intel.com_client.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpga.intel.com_client.go @@ -14,35 +14,35 @@ // Code generated by client-gen. DO NOT EDIT. -package v1 +package v2 import ( - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/scheme" rest "k8s.io/client-go/rest" ) -type FpgaV1Interface interface { +type FpgaV2Interface interface { RESTClient() rest.Interface AcceleratorFunctionsGetter FpgaRegionsGetter } -// FpgaV1Client is used to interact with features provided by the fpga.intel.com group. -type FpgaV1Client struct { +// FpgaV2Client is used to interact with features provided by the fpga.intel.com group. +type FpgaV2Client struct { restClient rest.Interface } -func (c *FpgaV1Client) AcceleratorFunctions(namespace string) AcceleratorFunctionInterface { +func (c *FpgaV2Client) AcceleratorFunctions(namespace string) AcceleratorFunctionInterface { return newAcceleratorFunctions(c, namespace) } -func (c *FpgaV1Client) FpgaRegions(namespace string) FpgaRegionInterface { +func (c *FpgaV2Client) FpgaRegions(namespace string) FpgaRegionInterface { return newFpgaRegions(c, namespace) } -// NewForConfig creates a new FpgaV1Client for the given config. -func NewForConfig(c *rest.Config) (*FpgaV1Client, error) { +// NewForConfig creates a new FpgaV2Client for the given config. +func NewForConfig(c *rest.Config) (*FpgaV2Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -51,12 +51,12 @@ func NewForConfig(c *rest.Config) (*FpgaV1Client, error) { if err != nil { return nil, err } - return &FpgaV1Client{client}, nil + return &FpgaV2Client{client}, nil } -// NewForConfigOrDie creates a new FpgaV1Client for the given config and +// NewForConfigOrDie creates a new FpgaV2Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *FpgaV1Client { +func NewForConfigOrDie(c *rest.Config) *FpgaV2Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -64,13 +64,13 @@ func NewForConfigOrDie(c *rest.Config) *FpgaV1Client { return client } -// New creates a new FpgaV1Client for the given RESTClient. -func New(c rest.Interface) *FpgaV1Client { - return &FpgaV1Client{c} +// New creates a new FpgaV2Client for the given RESTClient. +func New(c rest.Interface) *FpgaV2Client { + return &FpgaV2Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1.SchemeGroupVersion + gv := v2.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -84,7 +84,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FpgaV1Client) RESTClient() rest.Interface { +func (c *FpgaV2Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpgaregion.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpgaregion.go similarity index 70% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpgaregion.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpgaregion.go index 99afa502..e068cff3 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fpgaregion.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/fpgaregion.go @@ -14,15 +14,15 @@ // Code generated by client-gen. DO NOT EDIT. -package v1 +package v2 import ( "context" "time" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" scheme "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/scheme" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" @@ -36,14 +36,14 @@ type FpgaRegionsGetter interface { // FpgaRegionInterface has methods to work with FpgaRegion resources. type FpgaRegionInterface interface { - Create(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.CreateOptions) (*v1.FpgaRegion, error) - Update(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.UpdateOptions) (*v1.FpgaRegion, 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.FpgaRegion, error) - List(ctx context.Context, opts metav1.ListOptions) (*v1.FpgaRegionList, 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.FpgaRegion, err error) + Create(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.CreateOptions) (*v2.FpgaRegion, error) + Update(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.UpdateOptions) (*v2.FpgaRegion, 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) (*v2.FpgaRegion, error) + List(ctx context.Context, opts v1.ListOptions) (*v2.FpgaRegionList, 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 *v2.FpgaRegion, err error) FpgaRegionExpansion } @@ -54,7 +54,7 @@ type fpgaRegions struct { } // newFpgaRegions returns a FpgaRegions -func newFpgaRegions(c *FpgaV1Client, namespace string) *fpgaRegions { +func newFpgaRegions(c *FpgaV2Client, namespace string) *fpgaRegions { return &fpgaRegions{ client: c.RESTClient(), ns: namespace, @@ -62,8 +62,8 @@ func newFpgaRegions(c *FpgaV1Client, namespace string) *fpgaRegions { } // Get takes name of the fpgaRegion, and returns the corresponding fpgaRegion object, and an error if there is any. -func (c *fpgaRegions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FpgaRegion, err error) { - result = &v1.FpgaRegion{} +func (c *fpgaRegions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.FpgaRegion, err error) { + result = &v2.FpgaRegion{} err = c.client.Get(). Namespace(c.ns). Resource("fpgaregions"). @@ -75,12 +75,12 @@ func (c *fpgaRegions) Get(ctx context.Context, name string, options metav1.GetOp } // List takes label and field selectors, and returns the list of FpgaRegions that match those selectors. -func (c *fpgaRegions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FpgaRegionList, err error) { +func (c *fpgaRegions) List(ctx context.Context, opts v1.ListOptions) (result *v2.FpgaRegionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1.FpgaRegionList{} + result = &v2.FpgaRegionList{} err = c.client.Get(). Namespace(c.ns). Resource("fpgaregions"). @@ -92,7 +92,7 @@ func (c *fpgaRegions) List(ctx context.Context, opts metav1.ListOptions) (result } // Watch returns a watch.Interface that watches the requested fpgaRegions. -func (c *fpgaRegions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { +func (c *fpgaRegions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -107,8 +107,8 @@ func (c *fpgaRegions) Watch(ctx context.Context, opts metav1.ListOptions) (watch } // Create takes the representation of a fpgaRegion and creates it. Returns the server's representation of the fpgaRegion, and an error, if there is any. -func (c *fpgaRegions) Create(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.CreateOptions) (result *v1.FpgaRegion, err error) { - result = &v1.FpgaRegion{} +func (c *fpgaRegions) Create(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.CreateOptions) (result *v2.FpgaRegion, err error) { + result = &v2.FpgaRegion{} err = c.client.Post(). Namespace(c.ns). Resource("fpgaregions"). @@ -120,8 +120,8 @@ func (c *fpgaRegions) Create(ctx context.Context, fpgaRegion *v1.FpgaRegion, opt } // Update takes the representation of a fpgaRegion and updates it. Returns the server's representation of the fpgaRegion, and an error, if there is any. -func (c *fpgaRegions) Update(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.UpdateOptions) (result *v1.FpgaRegion, err error) { - result = &v1.FpgaRegion{} +func (c *fpgaRegions) Update(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.UpdateOptions) (result *v2.FpgaRegion, err error) { + result = &v2.FpgaRegion{} err = c.client.Put(). Namespace(c.ns). Resource("fpgaregions"). @@ -134,7 +134,7 @@ func (c *fpgaRegions) Update(ctx context.Context, fpgaRegion *v1.FpgaRegion, opt } // Delete takes name of the fpgaRegion and deletes it. Returns an error if one occurs. -func (c *fpgaRegions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { +func (c *fpgaRegions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("fpgaregions"). @@ -145,7 +145,7 @@ func (c *fpgaRegions) Delete(ctx context.Context, name string, opts metav1.Delet } // DeleteCollection deletes a collection of objects. -func (c *fpgaRegions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { +func (c *fpgaRegions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration if listOpts.TimeoutSeconds != nil { timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second @@ -161,8 +161,8 @@ func (c *fpgaRegions) DeleteCollection(ctx context.Context, opts metav1.DeleteOp } // Patch applies the patch and returns the patched fpgaRegion. -func (c *fpgaRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FpgaRegion, err error) { - result = &v1.FpgaRegion{} +func (c *fpgaRegions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.FpgaRegion, err error) { + result = &v2.FpgaRegion{} err = c.client.Patch(pt). Namespace(c.ns). Resource("fpgaregions"). diff --git a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/generated_expansion.go b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/generated_expansion.go similarity index 98% rename from pkg/client/clientset/versioned/typed/fpga.intel.com/v1/generated_expansion.go rename to pkg/client/clientset/versioned/typed/fpga.intel.com/v2/generated_expansion.go index 6820720c..6c60e4b1 100644 --- a/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/fpga.intel.com/v2/generated_expansion.go @@ -14,7 +14,7 @@ // Code generated by client-gen. DO NOT EDIT. -package v1 +package v2 type AcceleratorFunctionExpansion interface{} diff --git a/pkg/client/informers/externalversions/fpga.intel.com/interface.go b/pkg/client/informers/externalversions/fpga.intel.com/interface.go index c6740f0f..7a02e7f2 100644 --- a/pkg/client/informers/externalversions/fpga.intel.com/interface.go +++ b/pkg/client/informers/externalversions/fpga.intel.com/interface.go @@ -17,14 +17,14 @@ package fpga import ( - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/fpga.intel.com/v2" internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1 provides access to shared informers for resources in V1. - V1() v1.Interface + // V2 provides access to shared informers for resources in V2. + V2() v2.Interface } type group struct { @@ -38,7 +38,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1 returns a new v1.Interface. -func (g *group) V1() v1.Interface { - return v1.New(g.factory, g.namespace, g.tweakListOptions) +// V2 returns a new v2.Interface. +func (g *group) V2() v2.Interface { + return v2.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/fpga.intel.com/v1/acceleratorfunction.go b/pkg/client/informers/externalversions/fpga.intel.com/v2/acceleratorfunction.go similarity index 80% rename from pkg/client/informers/externalversions/fpga.intel.com/v1/acceleratorfunction.go rename to pkg/client/informers/externalversions/fpga.intel.com/v2/acceleratorfunction.go index 962660b7..0e15292e 100644 --- a/pkg/client/informers/externalversions/fpga.intel.com/v1/acceleratorfunction.go +++ b/pkg/client/informers/externalversions/fpga.intel.com/v2/acceleratorfunction.go @@ -14,17 +14,17 @@ // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v2 import ( "context" time "time" - fpgaintelcomv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgaintelcomv2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" versioned "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" @@ -34,7 +34,7 @@ import ( // AcceleratorFunctions. type AcceleratorFunctionInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.AcceleratorFunctionLister + Lister() v2.AcceleratorFunctionLister } type acceleratorFunctionInformer struct { @@ -56,20 +56,20 @@ func NewAcceleratorFunctionInformer(client versioned.Interface, namespace string func NewFilteredAcceleratorFunctionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FpgaV1().AcceleratorFunctions(namespace).List(context.TODO(), options) + return client.FpgaV2().AcceleratorFunctions(namespace).List(context.TODO(), options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FpgaV1().AcceleratorFunctions(namespace).Watch(context.TODO(), options) + return client.FpgaV2().AcceleratorFunctions(namespace).Watch(context.TODO(), options) }, }, - &fpgaintelcomv1.AcceleratorFunction{}, + &fpgaintelcomv2.AcceleratorFunction{}, resyncPeriod, indexers, ) @@ -80,9 +80,9 @@ func (f *acceleratorFunctionInformer) defaultInformer(client versioned.Interface } func (f *acceleratorFunctionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&fpgaintelcomv1.AcceleratorFunction{}, f.defaultInformer) + return f.factory.InformerFor(&fpgaintelcomv2.AcceleratorFunction{}, f.defaultInformer) } -func (f *acceleratorFunctionInformer) Lister() v1.AcceleratorFunctionLister { - return v1.NewAcceleratorFunctionLister(f.Informer().GetIndexer()) +func (f *acceleratorFunctionInformer) Lister() v2.AcceleratorFunctionLister { + return v2.NewAcceleratorFunctionLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/fpga.intel.com/v1/fpgaregion.go b/pkg/client/informers/externalversions/fpga.intel.com/v2/fpgaregion.go similarity index 79% rename from pkg/client/informers/externalversions/fpga.intel.com/v1/fpgaregion.go rename to pkg/client/informers/externalversions/fpga.intel.com/v2/fpgaregion.go index 0c161eb8..73746dcb 100644 --- a/pkg/client/informers/externalversions/fpga.intel.com/v1/fpgaregion.go +++ b/pkg/client/informers/externalversions/fpga.intel.com/v2/fpgaregion.go @@ -14,17 +14,17 @@ // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v2 import ( "context" time "time" - fpgaintelcomv1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + fpgaintelcomv2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" versioned "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" @@ -34,7 +34,7 @@ import ( // FpgaRegions. type FpgaRegionInformer interface { Informer() cache.SharedIndexInformer - Lister() v1.FpgaRegionLister + Lister() v2.FpgaRegionLister } type fpgaRegionInformer struct { @@ -56,20 +56,20 @@ func NewFpgaRegionInformer(client versioned.Interface, namespace string, resyncP func NewFilteredFpgaRegionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { return cache.NewSharedIndexInformer( &cache.ListWatch{ - ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FpgaV1().FpgaRegions(namespace).List(context.TODO(), options) + return client.FpgaV2().FpgaRegions(namespace).List(context.TODO(), options) }, - WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FpgaV1().FpgaRegions(namespace).Watch(context.TODO(), options) + return client.FpgaV2().FpgaRegions(namespace).Watch(context.TODO(), options) }, }, - &fpgaintelcomv1.FpgaRegion{}, + &fpgaintelcomv2.FpgaRegion{}, resyncPeriod, indexers, ) @@ -80,9 +80,9 @@ func (f *fpgaRegionInformer) defaultInformer(client versioned.Interface, resyncP } func (f *fpgaRegionInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&fpgaintelcomv1.FpgaRegion{}, f.defaultInformer) + return f.factory.InformerFor(&fpgaintelcomv2.FpgaRegion{}, f.defaultInformer) } -func (f *fpgaRegionInformer) Lister() v1.FpgaRegionLister { - return v1.NewFpgaRegionLister(f.Informer().GetIndexer()) +func (f *fpgaRegionInformer) Lister() v2.FpgaRegionLister { + return v2.NewFpgaRegionLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/informers/externalversions/fpga.intel.com/v1/interface.go b/pkg/client/informers/externalversions/fpga.intel.com/v2/interface.go similarity index 99% rename from pkg/client/informers/externalversions/fpga.intel.com/v1/interface.go rename to pkg/client/informers/externalversions/fpga.intel.com/v2/interface.go index 08c89b9d..e895e357 100644 --- a/pkg/client/informers/externalversions/fpga.intel.com/v1/interface.go +++ b/pkg/client/informers/externalversions/fpga.intel.com/v2/interface.go @@ -14,7 +14,7 @@ // Code generated by informer-gen. DO NOT EDIT. -package v1 +package v2 import ( internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index 07a05f23..f040412c 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -19,7 +19,7 @@ package externalversions import ( "fmt" - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -50,11 +50,11 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=fpga.intel.com, Version=v1 - case v1.SchemeGroupVersion.WithResource("acceleratorfunctions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V1().AcceleratorFunctions().Informer()}, nil - case v1.SchemeGroupVersion.WithResource("fpgaregions"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V1().FpgaRegions().Informer()}, nil + // Group=fpga.intel.com, Version=v2 + case v2.SchemeGroupVersion.WithResource("acceleratorfunctions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V2().AcceleratorFunctions().Informer()}, nil + case v2.SchemeGroupVersion.WithResource("fpgaregions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V2().FpgaRegions().Informer()}, nil } diff --git a/pkg/client/listers/fpga.intel.com/v1/acceleratorfunction.go b/pkg/client/listers/fpga.intel.com/v2/acceleratorfunction.go similarity index 83% rename from pkg/client/listers/fpga.intel.com/v1/acceleratorfunction.go rename to pkg/client/listers/fpga.intel.com/v2/acceleratorfunction.go index 2c09ff46..8f8b8be3 100644 --- a/pkg/client/listers/fpga.intel.com/v1/acceleratorfunction.go +++ b/pkg/client/listers/fpga.intel.com/v2/acceleratorfunction.go @@ -14,10 +14,10 @@ // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v2 import ( - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -26,7 +26,7 @@ import ( // AcceleratorFunctionLister helps list AcceleratorFunctions. type AcceleratorFunctionLister interface { // List lists all AcceleratorFunctions in the indexer. - List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) + List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) // AcceleratorFunctions returns an object that can list and get AcceleratorFunctions. AcceleratorFunctions(namespace string) AcceleratorFunctionNamespaceLister AcceleratorFunctionListerExpansion @@ -43,9 +43,9 @@ func NewAcceleratorFunctionLister(indexer cache.Indexer) AcceleratorFunctionList } // List lists all AcceleratorFunctions in the indexer. -func (s *acceleratorFunctionLister) List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) { +func (s *acceleratorFunctionLister) List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AcceleratorFunction)) + ret = append(ret, m.(*v2.AcceleratorFunction)) }) return ret, err } @@ -58,9 +58,9 @@ func (s *acceleratorFunctionLister) AcceleratorFunctions(namespace string) Accel // AcceleratorFunctionNamespaceLister helps list and get AcceleratorFunctions. type AcceleratorFunctionNamespaceLister interface { // List lists all AcceleratorFunctions in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) + List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) // Get retrieves the AcceleratorFunction from the indexer for a given namespace and name. - Get(name string) (*v1.AcceleratorFunction, error) + Get(name string) (*v2.AcceleratorFunction, error) AcceleratorFunctionNamespaceListerExpansion } @@ -72,21 +72,21 @@ type acceleratorFunctionNamespaceLister struct { } // List lists all AcceleratorFunctions in the indexer for a given namespace. -func (s acceleratorFunctionNamespaceLister) List(selector labels.Selector) (ret []*v1.AcceleratorFunction, err error) { +func (s acceleratorFunctionNamespaceLister) List(selector labels.Selector) (ret []*v2.AcceleratorFunction, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.AcceleratorFunction)) + ret = append(ret, m.(*v2.AcceleratorFunction)) }) return ret, err } // Get retrieves the AcceleratorFunction from the indexer for a given namespace and name. -func (s acceleratorFunctionNamespaceLister) Get(name string) (*v1.AcceleratorFunction, error) { +func (s acceleratorFunctionNamespaceLister) Get(name string) (*v2.AcceleratorFunction, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1.Resource("acceleratorfunction"), name) + return nil, errors.NewNotFound(v2.Resource("acceleratorfunction"), name) } - return obj.(*v1.AcceleratorFunction), nil + return obj.(*v2.AcceleratorFunction), nil } diff --git a/pkg/client/listers/fpga.intel.com/v1/expansion_generated.go b/pkg/client/listers/fpga.intel.com/v2/expansion_generated.go similarity index 99% rename from pkg/client/listers/fpga.intel.com/v1/expansion_generated.go rename to pkg/client/listers/fpga.intel.com/v2/expansion_generated.go index 993fb3dc..79f3628d 100644 --- a/pkg/client/listers/fpga.intel.com/v1/expansion_generated.go +++ b/pkg/client/listers/fpga.intel.com/v2/expansion_generated.go @@ -14,7 +14,7 @@ // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v2 // AcceleratorFunctionListerExpansion allows custom methods to be added to // AcceleratorFunctionLister. diff --git a/pkg/client/listers/fpga.intel.com/v1/fpgaregion.go b/pkg/client/listers/fpga.intel.com/v2/fpgaregion.go similarity index 82% rename from pkg/client/listers/fpga.intel.com/v1/fpgaregion.go rename to pkg/client/listers/fpga.intel.com/v2/fpgaregion.go index 89805dc4..1dfc1534 100644 --- a/pkg/client/listers/fpga.intel.com/v1/fpgaregion.go +++ b/pkg/client/listers/fpga.intel.com/v2/fpgaregion.go @@ -14,10 +14,10 @@ // Code generated by lister-gen. DO NOT EDIT. -package v1 +package v2 import ( - v1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v1" + v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis/fpga.intel.com/v2" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -26,7 +26,7 @@ import ( // FpgaRegionLister helps list FpgaRegions. type FpgaRegionLister interface { // List lists all FpgaRegions in the indexer. - List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) + List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) // FpgaRegions returns an object that can list and get FpgaRegions. FpgaRegions(namespace string) FpgaRegionNamespaceLister FpgaRegionListerExpansion @@ -43,9 +43,9 @@ func NewFpgaRegionLister(indexer cache.Indexer) FpgaRegionLister { } // List lists all FpgaRegions in the indexer. -func (s *fpgaRegionLister) List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) { +func (s *fpgaRegionLister) List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FpgaRegion)) + ret = append(ret, m.(*v2.FpgaRegion)) }) return ret, err } @@ -58,9 +58,9 @@ func (s *fpgaRegionLister) FpgaRegions(namespace string) FpgaRegionNamespaceList // FpgaRegionNamespaceLister helps list and get FpgaRegions. type FpgaRegionNamespaceLister interface { // List lists all FpgaRegions in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) + List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) // Get retrieves the FpgaRegion from the indexer for a given namespace and name. - Get(name string) (*v1.FpgaRegion, error) + Get(name string) (*v2.FpgaRegion, error) FpgaRegionNamespaceListerExpansion } @@ -72,21 +72,21 @@ type fpgaRegionNamespaceLister struct { } // List lists all FpgaRegions in the indexer for a given namespace. -func (s fpgaRegionNamespaceLister) List(selector labels.Selector) (ret []*v1.FpgaRegion, err error) { +func (s fpgaRegionNamespaceLister) List(selector labels.Selector) (ret []*v2.FpgaRegion, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1.FpgaRegion)) + ret = append(ret, m.(*v2.FpgaRegion)) }) return ret, err } // Get retrieves the FpgaRegion from the indexer for a given namespace and name. -func (s fpgaRegionNamespaceLister) Get(name string) (*v1.FpgaRegion, error) { +func (s fpgaRegionNamespaceLister) Get(name string) (*v2.FpgaRegion, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1.Resource("fpgaregion"), name) + return nil, errors.NewNotFound(v2.Resource("fpgaregion"), name) } - return obj.(*v1.FpgaRegion), nil + return obj.(*v2.FpgaRegion), nil } diff --git a/scripts/update-generated-code.sh b/scripts/update-generated-code.sh index e6d11256..ddcaf8fe 100755 --- a/scripts/update-generated-code.sh +++ b/scripts/update-generated-code.sh @@ -28,6 +28,6 @@ PKG_PATH="github.com/intel/intel-device-plugins-for-kubernetes/pkg" # instead of the $GOPATH directly. For normal projects this can be dropped. ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ ${PKG_PATH}/client ${PKG_PATH}/apis \ - fpga.intel.com:v1 \ + fpga.intel.com:v2 \ --output-base "$(dirname ${BASH_SOURCE})/../../../.." \ --go-header-file ${SCRIPT_ROOT}/build/boilerplate/boilerplate.go.txt