fpgawebhook: move to v2 API of fpga.intel.com group

This commit is contained in:
Dmitry Rozhkov 2020-05-04 15:03:52 +03:00
parent 8d6afae23d
commit c63dbf61b8
38 changed files with 285 additions and 285 deletions

View File

@ -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 \ $ generate-groups.sh all github.com/intel/intel-device-plugins-for-kubernetes/pkg/client \
github.com/intel/intel-device-plugins-for-kubernetes/pkg/apis \ 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 Please note that the script (at least of v0.18.2-beta.0) expects the device plugins

View File

@ -128,7 +128,7 @@ translated into actual resources provided by the cluster.
For the following mapping For the following mapping
```yaml ```yaml
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb0-preprogrammed name: arria10.dcp1.2-nlb0-preprogrammed

View File

@ -29,7 +29,7 @@ import (
clientset "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" 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" 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 ( const (
@ -61,8 +61,8 @@ func newController(patcherManager patcherManager, config *rest.Config) (*control
informerFactory := informers.NewSharedInformerFactory(clientset, resyncPeriod) informerFactory := informers.NewSharedInformerFactory(clientset, resyncPeriod)
stopCh := make(chan struct{}) stopCh := make(chan struct{})
afInformer := informerFactory.Fpga().V1().AcceleratorFunctions() afInformer := informerFactory.Fpga().V2().AcceleratorFunctions()
regionInformer := informerFactory.Fpga().V1().FpgaRegions() regionInformer := informerFactory.Fpga().V2().FpgaRegions()
controller := &controller{ controller := &controller{
patcherManager: patcherManager, patcherManager: patcherManager,

View File

@ -24,12 +24,12 @@ import (
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/rest" "k8s.io/client-go/rest"
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"
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"
) )
type fakeAfNamespaceLister struct { type fakeAfNamespaceLister struct {
af *v1.AcceleratorFunction af *v2.AcceleratorFunction
err error err error
} }
@ -37,16 +37,16 @@ func init() {
flag.Set("v", "4") ///Enable debug output 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 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 return nil, nil
} }
type fakeAfLister struct { type fakeAfLister struct {
af *v1.AcceleratorFunction af *v2.AcceleratorFunction
err error 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 return nil, nil
} }
@ -76,11 +76,11 @@ func TestSyncAfHandler(t *testing.T) {
name: "Known key", name: "Known key",
key: "default/arria10-nlb0", key: "default/arria10-nlb0",
afLister: &fakeAfLister{ afLister: &fakeAfLister{
af: &v1.AcceleratorFunction{ af: &v2.AcceleratorFunction{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: v1.AcceleratorFunctionSpec{ Spec: v2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
}, },
}, },
@ -120,20 +120,20 @@ func TestSyncAfHandler(t *testing.T) {
} }
type fakeRegionNamespaceLister struct { type fakeRegionNamespaceLister struct {
region *v1.FpgaRegion region *v2.FpgaRegion
err error 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 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 return nil, nil
} }
type fakeRegionLister struct { type fakeRegionLister struct {
region *v1.FpgaRegion region *v2.FpgaRegion
err error 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 return nil, nil
} }
@ -163,11 +163,11 @@ func TestSyncRegionHandler(t *testing.T) {
name: "Known key", name: "Known key",
key: "default/arria10", key: "default/arria10",
regionLister: &fakeRegionLister{ regionLister: &fakeRegionLister{
region: &v1.FpgaRegion{ region: &v2.FpgaRegion{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10", Name: "arria10",
}, },
Spec: v1.FpgaRegionSpec{ Spec: v2.FpgaRegionSpec{
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
}, },
}, },
@ -328,9 +328,9 @@ func TestProcessNextWorkItem(t *testing.T) {
func TestCreateEventhandler(t *testing.T) { func TestCreateEventhandler(t *testing.T) {
funcs := createEventHandler("testkind", &fakeQueue{}) funcs := createEventHandler("testkind", &fakeQueue{})
funcs.AddFunc(&v1.FpgaRegion{}) funcs.AddFunc(&v2.FpgaRegion{})
funcs.UpdateFunc(nil, &v1.FpgaRegion{}) funcs.UpdateFunc(nil, &v2.FpgaRegion{})
funcs.DeleteFunc(&v1.FpgaRegion{}) funcs.DeleteFunc(&v2.FpgaRegion{})
} }
func TestRun(t *testing.T) { func TestRun(t *testing.T) {

View File

@ -24,7 +24,7 @@ import (
"strings" "strings"
"testing" "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" "k8s.io/api/admission/v1beta1"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
@ -239,11 +239,11 @@ func TestMutatePods(t *testing.T) {
for _, tcase := range tcases { for _, tcase := range tcases {
t.Run(tcase.name, func(t *testing.T) { t.Run(tcase.name, func(t *testing.T) {
p := newPatcher() p := newPatcher()
p.addRegion(&fpgav1.FpgaRegion{ p.addRegion(&fpgav2.FpgaRegion{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10", Name: "arria10",
}, },
Spec: fpgav1.FpgaRegionSpec{ Spec: fpgav2.FpgaRegionSpec{
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
}, },
}) })

View File

@ -26,7 +26,7 @@ import (
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
"k8s.io/klog" "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" "github.com/intel/intel-device-plugins-for-kubernetes/pkg/fpga"
) )
@ -71,20 +71,20 @@ var (
type patcher struct { type patcher struct {
sync.Mutex sync.Mutex
afMap map[string]*fpgav1.AcceleratorFunction afMap map[string]*fpgav2.AcceleratorFunction
resourceMap map[string]string resourceMap map[string]string
resourceModeMap map[string]string resourceModeMap map[string]string
} }
func newPatcher() *patcher { func newPatcher() *patcher {
return &patcher{ return &patcher{
afMap: make(map[string]*fpgav1.AcceleratorFunction), afMap: make(map[string]*fpgav2.AcceleratorFunction),
resourceMap: make(map[string]string), resourceMap: make(map[string]string),
resourceModeMap: 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() defer p.Unlock()
p.Lock() p.Lock()
@ -104,7 +104,7 @@ func (p *patcher) addAf(accfunc *fpgav1.AcceleratorFunction) error {
return nil return nil
} }
func (p *patcher) addRegion(region *fpgav1.FpgaRegion) { func (p *patcher) addRegion(region *fpgav2.FpgaRegion) {
defer p.Unlock() defer p.Unlock()
p.Lock() p.Lock()

View File

@ -22,7 +22,7 @@ import (
"k8s.io/apimachinery/pkg/api/resource" "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 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() { func init() {
@ -30,19 +30,19 @@ func init() {
} }
func TestPatcherStorageFunctions(t *testing.T) { func TestPatcherStorageFunctions(t *testing.T) {
af := &fpgav1.AcceleratorFunction{ af := &fpgav2.AcceleratorFunction{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
}, },
} }
region := &fpgav1.FpgaRegion{ region := &fpgav2.FpgaRegion{
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10", Name: "arria10",
}, },
Spec: fpgav1.FpgaRegionSpec{ Spec: fpgav2.FpgaRegionSpec{
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
}, },
} }
@ -74,8 +74,8 @@ func TestGetPatchOps(t *testing.T) {
tcases := []struct { tcases := []struct {
name string name string
container corev1.Container container corev1.Container
afs []*fpgav1.AcceleratorFunction afs []*fpgav2.AcceleratorFunction
regions []*fpgav1.FpgaRegion regions []*fpgav2.FpgaRegion
expectedErr bool expectedErr bool
expectedOps int expectedOps int
}{ }{
@ -101,12 +101,12 @@ func TestGetPatchOps(t *testing.T) {
}, },
}, },
}, },
afs: []*fpgav1.AcceleratorFunction{ afs: []*fpgav2.AcceleratorFunction{
{ {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
Mode: region, Mode: region,
@ -116,7 +116,7 @@ func TestGetPatchOps(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0-alias", Name: "arria10-nlb0-alias",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
Mode: region, Mode: region,
@ -137,12 +137,12 @@ func TestGetPatchOps(t *testing.T) {
}, },
}, },
}, },
afs: []*fpgav1.AcceleratorFunction{ afs: []*fpgav2.AcceleratorFunction{
{ {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
Mode: af, Mode: af,
@ -163,12 +163,12 @@ func TestGetPatchOps(t *testing.T) {
}, },
}, },
}, },
regions: []*fpgav1.FpgaRegion{ regions: []*fpgav2.FpgaRegion{
{ {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10", Name: "arria10",
}, },
Spec: fpgav1.FpgaRegionSpec{ Spec: fpgav2.FpgaRegionSpec{
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
}, },
}, },
@ -260,12 +260,12 @@ func TestGetPatchOps(t *testing.T) {
}, },
}, },
}, },
afs: []*fpgav1.AcceleratorFunction{ afs: []*fpgav2.AcceleratorFunction{
{ {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
Mode: region, Mode: region,
@ -275,7 +275,7 @@ func TestGetPatchOps(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb3", Name: "arria10-nlb3",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "f7df405cbd7acf7222f144b0b93acd18", InterfaceID: "f7df405cbd7acf7222f144b0b93acd18",
Mode: af, Mode: af,
@ -296,12 +296,12 @@ func TestGetPatchOps(t *testing.T) {
}, },
}, },
}, },
afs: []*fpgav1.AcceleratorFunction{ afs: []*fpgav2.AcceleratorFunction{
{ {
ObjectMeta: metav1.ObjectMeta{ ObjectMeta: metav1.ObjectMeta{
Name: "arria10-nlb0", Name: "arria10-nlb0",
}, },
Spec: fpgav1.AcceleratorFunctionSpec{ Spec: fpgav2.AcceleratorFunctionSpec{
AfuID: "d8424dc4a4a3c413f89e433683f9040b", AfuID: "d8424dc4a4a3c413f89e433683f9040b",
InterfaceID: "ce48969398f05f33946d560708be108a", InterfaceID: "ce48969398f05f33946d560708be108a",
Mode: "unknown", Mode: "unknown",

View File

@ -4,7 +4,7 @@ metadata:
name: acceleratorfunctions.fpga.intel.com name: acceleratorfunctions.fpga.intel.com
spec: spec:
group: fpga.intel.com group: fpga.intel.com
version: v1 version: v2
scope: Namespaced scope: Namespaced
names: names:
plural: acceleratorfunctions plural: acceleratorfunctions

View File

@ -1,12 +1,12 @@
# DCP 1.0 # DCP 1.0
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.0-nlb0 name: arria10.dcp1.0-nlb0
spec: spec:
afuId: d8424dc4a4a3c413f89e433683f9040b afuId: d8424dc4a4a3c413f89e433683f9040b
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.0-nlb3 name: arria10.dcp1.0-nlb3
@ -14,14 +14,14 @@ spec:
afuId: f7df405cbd7acf7222f144b0b93acd18 afuId: f7df405cbd7acf7222f144b0b93acd18
--- ---
# DCP 1.1 # DCP 1.1
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.1-nlb0 name: arria10.dcp1.1-nlb0
spec: spec:
afuId: d8424dc4a4a3c413f89e433683f9040b afuId: d8424dc4a4a3c413f89e433683f9040b
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.1-nlb3 name: arria10.dcp1.1-nlb3
@ -29,14 +29,14 @@ spec:
afuId: f7df405cbd7acf7222f144b0b93acd18 afuId: f7df405cbd7acf7222f144b0b93acd18
--- ---
# DCP 1.2 # DCP 1.2
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb0 name: arria10.dcp1.2-nlb0
spec: spec:
afuId: d8424dc4a4a3c413f89e433683f9040b afuId: d8424dc4a4a3c413f89e433683f9040b
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb3 name: arria10.dcp1.2-nlb3
@ -44,14 +44,14 @@ spec:
afuId: f7df405cbd7acf7222f144b0b93acd18 afuId: f7df405cbd7acf7222f144b0b93acd18
--- ---
# D5005 # D5005
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: d5005-nlb0 name: d5005-nlb0
spec: spec:
afuId: d8424dc4a4a3c413f89e433683f9040b afuId: d8424dc4a4a3c413f89e433683f9040b
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: d5005-nlb3 name: d5005-nlb3

View File

@ -1,5 +1,5 @@
# DCP 1.0 # DCP 1.0
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.0 name: arria10.dcp1.0
@ -7,7 +7,7 @@ spec:
interfaceId: ce48969398f05f33946d560708be108a interfaceId: ce48969398f05f33946d560708be108a
--- ---
# DCP 1.1 # DCP 1.1
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.1 name: arria10.dcp1.1
@ -15,7 +15,7 @@ spec:
interfaceId: 9926ab6d6c925a68aabca7d84c545738 interfaceId: 9926ab6d6c925a68aabca7d84c545738
--- ---
# DCP 1.2 # DCP 1.2
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.2 name: arria10.dcp1.2
@ -23,7 +23,7 @@ spec:
interfaceId: 69528db6eb31577a8c3668f9faa081f6 interfaceId: 69528db6eb31577a8c3668f9faa081f6
--- ---
# D5005 # D5005
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: d5005 name: d5005

View File

@ -1,12 +1,12 @@
# DCP 1.0 # DCP 1.0
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.0 name: arria10.dcp1.0
spec: spec:
interfaceId: ce48969398f05f33946d560708be108a interfaceId: ce48969398f05f33946d560708be108a
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.0-nlb0-orchestrated name: arria10.dcp1.0-nlb0-orchestrated
@ -15,7 +15,7 @@ spec:
interfaceId: ce48969398f05f33946d560708be108a interfaceId: ce48969398f05f33946d560708be108a
mode: region mode: region
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.0-nlb3-orchestrated name: arria10.dcp1.0-nlb3-orchestrated
@ -25,14 +25,14 @@ spec:
mode: region mode: region
--- ---
# DCP 1.1 # DCP 1.1
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.1 name: arria10.dcp1.1
spec: spec:
interfaceId: 9926ab6d6c925a68aabca7d84c545738 interfaceId: 9926ab6d6c925a68aabca7d84c545738
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.1-nlb0-orchestrated name: arria10.dcp1.1-nlb0-orchestrated
@ -41,7 +41,7 @@ spec:
interfaceId: 9926ab6d6c925a68aabca7d84c545738 interfaceId: 9926ab6d6c925a68aabca7d84c545738
mode: region mode: region
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.1-nlb3-orchestrated name: arria10.dcp1.1-nlb3-orchestrated
@ -51,14 +51,14 @@ spec:
mode: region mode: region
--- ---
# DCP 1.2 # DCP 1.2
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: arria10.dcp1.2 name: arria10.dcp1.2
spec: spec:
interfaceId: 69528db6eb31577a8c3668f9faa081f6 interfaceId: 69528db6eb31577a8c3668f9faa081f6
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb0-orchestrated name: arria10.dcp1.2-nlb0-orchestrated
@ -67,7 +67,7 @@ spec:
interfaceId: 69528db6eb31577a8c3668f9faa081f6 interfaceId: 69528db6eb31577a8c3668f9faa081f6
mode: region mode: region
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb0-preprogrammed name: arria10.dcp1.2-nlb0-preprogrammed
@ -76,7 +76,7 @@ spec:
interfaceId: 69528db6eb31577a8c3668f9faa081f6 interfaceId: 69528db6eb31577a8c3668f9faa081f6
mode: af mode: af
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: arria10.dcp1.2-nlb3-orchestrated name: arria10.dcp1.2-nlb3-orchestrated
@ -86,14 +86,14 @@ spec:
mode: region mode: region
--- ---
# D5005 # D5005
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: FpgaRegion kind: FpgaRegion
metadata: metadata:
name: d5005 name: d5005
spec: spec:
interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: d5005-nlb0-orchestrated name: d5005-nlb0-orchestrated
@ -102,7 +102,7 @@ spec:
interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d
mode: region mode: region
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: d5005-nlb3-orchestrated name: d5005-nlb3-orchestrated
@ -111,7 +111,7 @@ spec:
interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d interfaceId: bfac4d851ee856fe8c95865ce1bbaa2d
mode: region mode: region
--- ---
apiVersion: fpga.intel.com/v1 apiVersion: fpga.intel.com/v2
kind: AcceleratorFunction kind: AcceleratorFunction
metadata: metadata:
name: d5005-nlb3-preprogrammed name: d5005-nlb3-preprogrammed

View File

@ -4,7 +4,7 @@ metadata:
name: fpgaregions.fpga.intel.com name: fpgaregions.fpga.intel.com
spec: spec:
group: fpga.intel.com group: fpga.intel.com
version: v1 version: v2
scope: Namespaced scope: Namespaced
names: names:
plural: fpgaregions plural: fpgaregions

View File

@ -2,4 +2,4 @@
// +groupName=fpga.intel.com // +groupName=fpga.intel.com
package v1 package v2

View File

@ -1,4 +1,4 @@
package v1 package v2
import ( import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -9,7 +9,7 @@ import (
) )
// SchemeGroupVersion is group version used to register these objects // 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 // Kind takes an unqualified kind and returns back a Group qualified GroupKind
func Kind(kind string) schema.GroupKind { func Kind(kind string) schema.GroupKind {

View File

@ -1,4 +1,4 @@
package v1 package v2
import ( import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

View File

@ -16,7 +16,7 @@
// Code generated by deepcopy-gen. DO NOT EDIT. // Code generated by deepcopy-gen. DO NOT EDIT.
package v1 package v2
import ( import (
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"

View File

@ -19,7 +19,7 @@ package versioned
import ( import (
"fmt" "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" discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol" flowcontrol "k8s.io/client-go/util/flowcontrol"
@ -27,19 +27,19 @@ import (
type Interface interface { type Interface interface {
Discovery() discovery.DiscoveryInterface Discovery() discovery.DiscoveryInterface
FpgaV1() fpgav1.FpgaV1Interface FpgaV2() fpgav2.FpgaV2Interface
} }
// Clientset contains the clients for groups. Each group has exactly one // Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset. // version included in a Clientset.
type Clientset struct { type Clientset struct {
*discovery.DiscoveryClient *discovery.DiscoveryClient
fpgaV1 *fpgav1.FpgaV1Client fpgaV2 *fpgav2.FpgaV2Client
} }
// FpgaV1 retrieves the FpgaV1Client // FpgaV2 retrieves the FpgaV2Client
func (c *Clientset) FpgaV1() fpgav1.FpgaV1Interface { func (c *Clientset) FpgaV2() fpgav2.FpgaV2Interface {
return c.fpgaV1 return c.fpgaV2
} }
// Discovery retrieves the DiscoveryClient // Discovery retrieves the DiscoveryClient
@ -63,7 +63,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
} }
var cs Clientset var cs Clientset
var err error var err error
cs.fpgaV1, err = fpgav1.NewForConfig(&configShallowCopy) cs.fpgaV2, err = fpgav2.NewForConfig(&configShallowCopy)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -79,7 +79,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
// panics if there is an error in the config. // panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset { func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset var cs Clientset
cs.fpgaV1 = fpgav1.NewForConfigOrDie(c) cs.fpgaV2 = fpgav2.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs return &cs
@ -88,7 +88,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
// New creates a new Clientset for the given RESTClient. // New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset { func New(c rest.Interface) *Clientset {
var cs Clientset var cs Clientset
cs.fpgaV1 = fpgav1.New(c) cs.fpgaV2 = fpgav2.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs return &cs

View File

@ -18,8 +18,8 @@ package fake
import ( import (
clientset "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned" 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" fpgav2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v2"
fakefpgav1 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/typed/fpga.intel.com/v1/fake" 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/runtime"
"k8s.io/apimachinery/pkg/watch" "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery" "k8s.io/client-go/discovery"
@ -74,7 +74,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker {
var _ clientset.Interface = &Clientset{} var _ clientset.Interface = &Clientset{}
// FpgaV1 retrieves the FpgaV1Client // FpgaV2 retrieves the FpgaV2Client
func (c *Clientset) FpgaV1() fpgav1.FpgaV1Interface { func (c *Clientset) FpgaV2() fpgav2.FpgaV2Interface {
return &fakefpgav1.FakeFpgaV1{Fake: &c.Fake} return &fakefpgav2.FakeFpgaV2{Fake: &c.Fake}
} }

View File

@ -17,7 +17,7 @@
package fake package fake
import ( 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" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -29,7 +29,7 @@ var scheme = runtime.NewScheme()
var codecs = serializer.NewCodecFactory(scheme) var codecs = serializer.NewCodecFactory(scheme)
var parameterCodec = runtime.NewParameterCodec(scheme) var parameterCodec = runtime.NewParameterCodec(scheme)
var localSchemeBuilder = runtime.SchemeBuilder{ var localSchemeBuilder = runtime.SchemeBuilder{
fpgav1.AddToScheme, fpgav2.AddToScheme,
} }
// AddToScheme adds all types of this clientset into the given scheme. This allows composition // AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -17,7 +17,7 @@
package scheme package scheme
import ( 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" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -29,7 +29,7 @@ var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme) var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{ var localSchemeBuilder = runtime.SchemeBuilder{
fpgav1.AddToScheme, fpgav2.AddToScheme,
} }
// AddToScheme adds all types of this clientset into the given scheme. This allows composition // AddToScheme adds all types of this clientset into the given scheme. This allows composition

View File

@ -14,15 +14,15 @@
// Code generated by client-gen. DO NOT EDIT. // Code generated by client-gen. DO NOT EDIT.
package v1 package v2
import ( import (
"context" "context"
"time" "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" 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" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
@ -36,14 +36,14 @@ type AcceleratorFunctionsGetter interface {
// AcceleratorFunctionInterface has methods to work with AcceleratorFunction resources. // AcceleratorFunctionInterface has methods to work with AcceleratorFunction resources.
type AcceleratorFunctionInterface interface { type AcceleratorFunctionInterface interface {
Create(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.CreateOptions) (*v1.AcceleratorFunction, error) Create(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.CreateOptions) (*v2.AcceleratorFunction, error)
Update(ctx context.Context, acceleratorFunction *v1.AcceleratorFunction, opts metav1.UpdateOptions) (*v1.AcceleratorFunction, error) Update(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.UpdateOptions) (*v2.AcceleratorFunction, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.AcceleratorFunction, error) Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.AcceleratorFunction, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.AcceleratorFunctionList, error) List(ctx context.Context, opts v1.ListOptions) (*v2.AcceleratorFunctionList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Watch(ctx context.Context, opts v1.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) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.AcceleratorFunction, err error)
AcceleratorFunctionExpansion AcceleratorFunctionExpansion
} }
@ -54,7 +54,7 @@ type acceleratorFunctions struct {
} }
// newAcceleratorFunctions returns a AcceleratorFunctions // newAcceleratorFunctions returns a AcceleratorFunctions
func newAcceleratorFunctions(c *FpgaV1Client, namespace string) *acceleratorFunctions { func newAcceleratorFunctions(c *FpgaV2Client, namespace string) *acceleratorFunctions {
return &acceleratorFunctions{ return &acceleratorFunctions{
client: c.RESTClient(), client: c.RESTClient(),
ns: namespace, 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. // 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) { func (c *acceleratorFunctions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.AcceleratorFunction, err error) {
result = &v1.AcceleratorFunction{} result = &v2.AcceleratorFunction{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). 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. // 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 var timeout time.Duration
if opts.TimeoutSeconds != nil { if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
} }
result = &v1.AcceleratorFunctionList{} result = &v2.AcceleratorFunctionList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). 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. // 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 var timeout time.Duration
if opts.TimeoutSeconds != nil { if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second 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. // 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) { func (c *acceleratorFunctions) Create(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.CreateOptions) (result *v2.AcceleratorFunction, err error) {
result = &v1.AcceleratorFunction{} result = &v2.AcceleratorFunction{}
err = c.client.Post(). err = c.client.Post().
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). 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. // 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) { func (c *acceleratorFunctions) Update(ctx context.Context, acceleratorFunction *v2.AcceleratorFunction, opts v1.UpdateOptions) (result *v2.AcceleratorFunction, err error) {
result = &v1.AcceleratorFunction{} result = &v2.AcceleratorFunction{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). 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. // 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(). return c.client.Delete().
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). Resource("acceleratorfunctions").
@ -145,7 +145,7 @@ func (c *acceleratorFunctions) Delete(ctx context.Context, name string, opts met
} }
// DeleteCollection deletes a collection of objects. // 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 var timeout time.Duration
if listOpts.TimeoutSeconds != nil { if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second 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. // 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) { 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 = &v1.AcceleratorFunction{} result = &v2.AcceleratorFunction{}
err = c.client.Patch(pt). err = c.client.Patch(pt).
Namespace(c.ns). Namespace(c.ns).
Resource("acceleratorfunctions"). Resource("acceleratorfunctions").

View File

@ -15,4 +15,4 @@
// Code generated by client-gen. DO NOT EDIT. // Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients. // This package has the automatically generated typed clients.
package v1 package v2

View File

@ -19,7 +19,7 @@ package fake
import ( import (
"context" "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" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -30,29 +30,29 @@ import (
// FakeAcceleratorFunctions implements AcceleratorFunctionInterface // FakeAcceleratorFunctions implements AcceleratorFunctionInterface
type FakeAcceleratorFunctions struct { type FakeAcceleratorFunctions struct {
Fake *FakeFpgaV1 Fake *FakeFpgaV2
ns string 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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. 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 { if obj == nil {
return nil, err return nil, err
@ -62,8 +62,8 @@ func (c *FakeAcceleratorFunctions) List(ctx context.Context, opts v1.ListOptions
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &fpgaintelcomv1.AcceleratorFunctionList{ListMeta: obj.(*fpgaintelcomv1.AcceleratorFunctionList).ListMeta} list := &v2.AcceleratorFunctionList{ListMeta: obj.(*v2.AcceleratorFunctionList).ListMeta}
for _, item := range obj.(*fpgaintelcomv1.AcceleratorFunctionList).Items { for _, item := range obj.(*v2.AcceleratorFunctionList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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 { func (c *FakeAcceleratorFunctions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteAction(acceleratorfunctionsResource, c.ns, name), &fpgaintelcomv1.AcceleratorFunction{}) Invokes(testing.NewDeleteAction(acceleratorfunctionsResource, c.ns, name), &v2.AcceleratorFunction{})
return err 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 { func (c *FakeAcceleratorFunctions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(acceleratorfunctionsResource, c.ns, listOpts) action := testing.NewDeleteCollectionAction(acceleratorfunctionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &fpgaintelcomv1.AcceleratorFunctionList{}) _, err := c.Fake.Invokes(action, &v2.AcceleratorFunctionList{})
return err return err
} }
// Patch applies the patch and returns the patched acceleratorFunction. // 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. 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 { if obj == nil {
return nil, err return nil, err
} }
return obj.(*fpgaintelcomv1.AcceleratorFunction), err return obj.(*v2.AcceleratorFunction), err
} }

View File

@ -17,26 +17,26 @@
package fake package fake
import ( 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" rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing" testing "k8s.io/client-go/testing"
) )
type FakeFpgaV1 struct { type FakeFpgaV2 struct {
*testing.Fake *testing.Fake
} }
func (c *FakeFpgaV1) AcceleratorFunctions(namespace string) v1.AcceleratorFunctionInterface { func (c *FakeFpgaV2) AcceleratorFunctions(namespace string) v2.AcceleratorFunctionInterface {
return &FakeAcceleratorFunctions{c, namespace} return &FakeAcceleratorFunctions{c, namespace}
} }
func (c *FakeFpgaV1) FpgaRegions(namespace string) v1.FpgaRegionInterface { func (c *FakeFpgaV2) FpgaRegions(namespace string) v2.FpgaRegionInterface {
return &FakeFpgaRegions{c, namespace} return &FakeFpgaRegions{c, namespace}
} }
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *FakeFpgaV1) RESTClient() rest.Interface { func (c *FakeFpgaV2) RESTClient() rest.Interface {
var ret *rest.RESTClient var ret *rest.RESTClient
return ret return ret
} }

View File

@ -19,7 +19,7 @@ package fake
import ( import (
"context" "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" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels" labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema" schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -30,29 +30,29 @@ import (
// FakeFpgaRegions implements FpgaRegionInterface // FakeFpgaRegions implements FpgaRegionInterface
type FakeFpgaRegions struct { type FakeFpgaRegions struct {
Fake *FakeFpgaV1 Fake *FakeFpgaV2
ns string 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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. 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 { if obj == nil {
return nil, err return nil, err
@ -62,8 +62,8 @@ func (c *FakeFpgaRegions) List(ctx context.Context, opts v1.ListOptions) (result
if label == nil { if label == nil {
label = labels.Everything() label = labels.Everything()
} }
list := &fpgaintelcomv1.FpgaRegionList{ListMeta: obj.(*fpgaintelcomv1.FpgaRegionList).ListMeta} list := &v2.FpgaRegionList{ListMeta: obj.(*v2.FpgaRegionList).ListMeta}
for _, item := range obj.(*fpgaintelcomv1.FpgaRegionList).Items { for _, item := range obj.(*v2.FpgaRegionList).Items {
if label.Matches(labels.Set(item.Labels)) { if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item) 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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. 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 { if obj == nil {
return nil, err 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. // 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 { func (c *FakeFpgaRegions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
_, err := c.Fake. _, err := c.Fake.
Invokes(testing.NewDeleteAction(fpgaregionsResource, c.ns, name), &fpgaintelcomv1.FpgaRegion{}) Invokes(testing.NewDeleteAction(fpgaregionsResource, c.ns, name), &v2.FpgaRegion{})
return err 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 { func (c *FakeFpgaRegions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(fpgaregionsResource, c.ns, listOpts) action := testing.NewDeleteCollectionAction(fpgaregionsResource, c.ns, listOpts)
_, err := c.Fake.Invokes(action, &fpgaintelcomv1.FpgaRegionList{}) _, err := c.Fake.Invokes(action, &v2.FpgaRegionList{})
return err return err
} }
// Patch applies the patch and returns the patched fpgaRegion. // 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. 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 { if obj == nil {
return nil, err return nil, err
} }
return obj.(*fpgaintelcomv1.FpgaRegion), err return obj.(*v2.FpgaRegion), err
} }

View File

@ -14,35 +14,35 @@
// Code generated by client-gen. DO NOT EDIT. // Code generated by client-gen. DO NOT EDIT.
package v1 package v2
import ( 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" "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/clientset/versioned/scheme"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
) )
type FpgaV1Interface interface { type FpgaV2Interface interface {
RESTClient() rest.Interface RESTClient() rest.Interface
AcceleratorFunctionsGetter AcceleratorFunctionsGetter
FpgaRegionsGetter FpgaRegionsGetter
} }
// FpgaV1Client is used to interact with features provided by the fpga.intel.com group. // FpgaV2Client is used to interact with features provided by the fpga.intel.com group.
type FpgaV1Client struct { type FpgaV2Client struct {
restClient rest.Interface restClient rest.Interface
} }
func (c *FpgaV1Client) AcceleratorFunctions(namespace string) AcceleratorFunctionInterface { func (c *FpgaV2Client) AcceleratorFunctions(namespace string) AcceleratorFunctionInterface {
return newAcceleratorFunctions(c, namespace) return newAcceleratorFunctions(c, namespace)
} }
func (c *FpgaV1Client) FpgaRegions(namespace string) FpgaRegionInterface { func (c *FpgaV2Client) FpgaRegions(namespace string) FpgaRegionInterface {
return newFpgaRegions(c, namespace) return newFpgaRegions(c, namespace)
} }
// NewForConfig creates a new FpgaV1Client for the given config. // NewForConfig creates a new FpgaV2Client for the given config.
func NewForConfig(c *rest.Config) (*FpgaV1Client, error) { func NewForConfig(c *rest.Config) (*FpgaV2Client, error) {
config := *c config := *c
if err := setConfigDefaults(&config); err != nil { if err := setConfigDefaults(&config); err != nil {
return nil, err return nil, err
@ -51,12 +51,12 @@ func NewForConfig(c *rest.Config) (*FpgaV1Client, error) {
if err != nil { if err != nil {
return nil, err 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. // 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) client, err := NewForConfig(c)
if err != nil { if err != nil {
panic(err) panic(err)
@ -64,13 +64,13 @@ func NewForConfigOrDie(c *rest.Config) *FpgaV1Client {
return client return client
} }
// New creates a new FpgaV1Client for the given RESTClient. // New creates a new FpgaV2Client for the given RESTClient.
func New(c rest.Interface) *FpgaV1Client { func New(c rest.Interface) *FpgaV2Client {
return &FpgaV1Client{c} return &FpgaV2Client{c}
} }
func setConfigDefaults(config *rest.Config) error { func setConfigDefaults(config *rest.Config) error {
gv := v1.SchemeGroupVersion gv := v2.SchemeGroupVersion
config.GroupVersion = &gv config.GroupVersion = &gv
config.APIPath = "/apis" config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
@ -84,7 +84,7 @@ func setConfigDefaults(config *rest.Config) error {
// RESTClient returns a RESTClient that is used to communicate // RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation. // with API server by this client implementation.
func (c *FpgaV1Client) RESTClient() rest.Interface { func (c *FpgaV2Client) RESTClient() rest.Interface {
if c == nil { if c == nil {
return nil return nil
} }

View File

@ -14,15 +14,15 @@
// Code generated by client-gen. DO NOT EDIT. // Code generated by client-gen. DO NOT EDIT.
package v1 package v2
import ( import (
"context" "context"
"time" "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" 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" types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest" rest "k8s.io/client-go/rest"
@ -36,14 +36,14 @@ type FpgaRegionsGetter interface {
// FpgaRegionInterface has methods to work with FpgaRegion resources. // FpgaRegionInterface has methods to work with FpgaRegion resources.
type FpgaRegionInterface interface { type FpgaRegionInterface interface {
Create(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.CreateOptions) (*v1.FpgaRegion, error) Create(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.CreateOptions) (*v2.FpgaRegion, error)
Update(ctx context.Context, fpgaRegion *v1.FpgaRegion, opts metav1.UpdateOptions) (*v1.FpgaRegion, error) Update(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.UpdateOptions) (*v2.FpgaRegion, error)
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.FpgaRegion, error) Get(ctx context.Context, name string, opts v1.GetOptions) (*v2.FpgaRegion, error)
List(ctx context.Context, opts metav1.ListOptions) (*v1.FpgaRegionList, error) List(ctx context.Context, opts v1.ListOptions) (*v2.FpgaRegionList, error)
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) Watch(ctx context.Context, opts v1.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) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2.FpgaRegion, err error)
FpgaRegionExpansion FpgaRegionExpansion
} }
@ -54,7 +54,7 @@ type fpgaRegions struct {
} }
// newFpgaRegions returns a FpgaRegions // newFpgaRegions returns a FpgaRegions
func newFpgaRegions(c *FpgaV1Client, namespace string) *fpgaRegions { func newFpgaRegions(c *FpgaV2Client, namespace string) *fpgaRegions {
return &fpgaRegions{ return &fpgaRegions{
client: c.RESTClient(), client: c.RESTClient(),
ns: namespace, 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. // 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) { func (c *fpgaRegions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2.FpgaRegion, err error) {
result = &v1.FpgaRegion{} result = &v2.FpgaRegion{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). 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. // 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 var timeout time.Duration
if opts.TimeoutSeconds != nil { if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
} }
result = &v1.FpgaRegionList{} result = &v2.FpgaRegionList{}
err = c.client.Get(). err = c.client.Get().
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). 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. // 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 var timeout time.Duration
if opts.TimeoutSeconds != nil { if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second 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. // 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) { func (c *fpgaRegions) Create(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.CreateOptions) (result *v2.FpgaRegion, err error) {
result = &v1.FpgaRegion{} result = &v2.FpgaRegion{}
err = c.client.Post(). err = c.client.Post().
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). 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. // 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) { func (c *fpgaRegions) Update(ctx context.Context, fpgaRegion *v2.FpgaRegion, opts v1.UpdateOptions) (result *v2.FpgaRegion, err error) {
result = &v1.FpgaRegion{} result = &v2.FpgaRegion{}
err = c.client.Put(). err = c.client.Put().
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). 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. // 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(). return c.client.Delete().
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). Resource("fpgaregions").
@ -145,7 +145,7 @@ func (c *fpgaRegions) Delete(ctx context.Context, name string, opts metav1.Delet
} }
// DeleteCollection deletes a collection of objects. // 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 var timeout time.Duration
if listOpts.TimeoutSeconds != nil { if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second 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. // 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) { 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 = &v1.FpgaRegion{} result = &v2.FpgaRegion{}
err = c.client.Patch(pt). err = c.client.Patch(pt).
Namespace(c.ns). Namespace(c.ns).
Resource("fpgaregions"). Resource("fpgaregions").

View File

@ -14,7 +14,7 @@
// Code generated by client-gen. DO NOT EDIT. // Code generated by client-gen. DO NOT EDIT.
package v1 package v2
type AcceleratorFunctionExpansion interface{} type AcceleratorFunctionExpansion interface{}

View File

@ -17,14 +17,14 @@
package fpga package fpga
import ( 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" internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces"
) )
// Interface provides access to each of this group's versions. // Interface provides access to each of this group's versions.
type Interface interface { type Interface interface {
// V1 provides access to shared informers for resources in V1. // V2 provides access to shared informers for resources in V2.
V1() v1.Interface V2() v2.Interface
} }
type group struct { type group struct {
@ -38,7 +38,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
} }
// V1 returns a new v1.Interface. // V2 returns a new v2.Interface.
func (g *group) V1() v1.Interface { func (g *group) V2() v2.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions) return v2.New(g.factory, g.namespace, g.tweakListOptions)
} }

View File

@ -14,17 +14,17 @@
// Code generated by informer-gen. DO NOT EDIT. // Code generated by informer-gen. DO NOT EDIT.
package v1 package v2
import ( import (
"context" "context"
time "time" 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" 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" 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" v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
@ -34,7 +34,7 @@ import (
// AcceleratorFunctions. // AcceleratorFunctions.
type AcceleratorFunctionInformer interface { type AcceleratorFunctionInformer interface {
Informer() cache.SharedIndexInformer Informer() cache.SharedIndexInformer
Lister() v1.AcceleratorFunctionLister Lister() v2.AcceleratorFunctionLister
} }
type acceleratorFunctionInformer struct { 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 { func NewFilteredAcceleratorFunctionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer( return cache.NewSharedIndexInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) 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 { if tweakListOptions != nil {
tweakListOptions(&options) 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, resyncPeriod,
indexers, indexers,
) )
@ -80,9 +80,9 @@ func (f *acceleratorFunctionInformer) defaultInformer(client versioned.Interface
} }
func (f *acceleratorFunctionInformer) Informer() cache.SharedIndexInformer { 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 { func (f *acceleratorFunctionInformer) Lister() v2.AcceleratorFunctionLister {
return v1.NewAcceleratorFunctionLister(f.Informer().GetIndexer()) return v2.NewAcceleratorFunctionLister(f.Informer().GetIndexer())
} }

View File

@ -14,17 +14,17 @@
// Code generated by informer-gen. DO NOT EDIT. // Code generated by informer-gen. DO NOT EDIT.
package v1 package v2
import ( import (
"context" "context"
time "time" 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" 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" 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" v2 "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/listers/fpga.intel.com/v2"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime" runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch" watch "k8s.io/apimachinery/pkg/watch"
cache "k8s.io/client-go/tools/cache" cache "k8s.io/client-go/tools/cache"
@ -34,7 +34,7 @@ import (
// FpgaRegions. // FpgaRegions.
type FpgaRegionInformer interface { type FpgaRegionInformer interface {
Informer() cache.SharedIndexInformer Informer() cache.SharedIndexInformer
Lister() v1.FpgaRegionLister Lister() v2.FpgaRegionLister
} }
type fpgaRegionInformer struct { 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 { func NewFilteredFpgaRegionInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer( return cache.NewSharedIndexInformer(
&cache.ListWatch{ &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil { if tweakListOptions != nil {
tweakListOptions(&options) 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 { if tweakListOptions != nil {
tweakListOptions(&options) 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, resyncPeriod,
indexers, indexers,
) )
@ -80,9 +80,9 @@ func (f *fpgaRegionInformer) defaultInformer(client versioned.Interface, resyncP
} }
func (f *fpgaRegionInformer) Informer() cache.SharedIndexInformer { 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 { func (f *fpgaRegionInformer) Lister() v2.FpgaRegionLister {
return v1.NewFpgaRegionLister(f.Informer().GetIndexer()) return v2.NewFpgaRegionLister(f.Informer().GetIndexer())
} }

View File

@ -14,7 +14,7 @@
// Code generated by informer-gen. DO NOT EDIT. // Code generated by informer-gen. DO NOT EDIT.
package v1 package v2
import ( import (
internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces" internalinterfaces "github.com/intel/intel-device-plugins-for-kubernetes/pkg/client/informers/externalversions/internalinterfaces"

View File

@ -19,7 +19,7 @@ package externalversions
import ( import (
"fmt" "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" schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache" 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 // TODO extend this to unknown resources with a client pool
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
switch resource { switch resource {
// Group=fpga.intel.com, Version=v1 // Group=fpga.intel.com, Version=v2
case v1.SchemeGroupVersion.WithResource("acceleratorfunctions"): case v2.SchemeGroupVersion.WithResource("acceleratorfunctions"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V1().AcceleratorFunctions().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V2().AcceleratorFunctions().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("fpgaregions"): case v2.SchemeGroupVersion.WithResource("fpgaregions"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V1().FpgaRegions().Informer()}, nil return &genericInformer{resource: resource.GroupResource(), informer: f.Fpga().V2().FpgaRegions().Informer()}, nil
} }

View File

@ -14,10 +14,10 @@
// Code generated by lister-gen. DO NOT EDIT. // Code generated by lister-gen. DO NOT EDIT.
package v1 package v2
import ( 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/api/errors"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
@ -26,7 +26,7 @@ import (
// AcceleratorFunctionLister helps list AcceleratorFunctions. // AcceleratorFunctionLister helps list AcceleratorFunctions.
type AcceleratorFunctionLister interface { type AcceleratorFunctionLister interface {
// List lists all AcceleratorFunctions in the indexer. // 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 returns an object that can list and get AcceleratorFunctions.
AcceleratorFunctions(namespace string) AcceleratorFunctionNamespaceLister AcceleratorFunctions(namespace string) AcceleratorFunctionNamespaceLister
AcceleratorFunctionListerExpansion AcceleratorFunctionListerExpansion
@ -43,9 +43,9 @@ func NewAcceleratorFunctionLister(indexer cache.Indexer) AcceleratorFunctionList
} }
// List lists all AcceleratorFunctions in the indexer. // 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{}) { err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.AcceleratorFunction)) ret = append(ret, m.(*v2.AcceleratorFunction))
}) })
return ret, err return ret, err
} }
@ -58,9 +58,9 @@ func (s *acceleratorFunctionLister) AcceleratorFunctions(namespace string) Accel
// AcceleratorFunctionNamespaceLister helps list and get AcceleratorFunctions. // AcceleratorFunctionNamespaceLister helps list and get AcceleratorFunctions.
type AcceleratorFunctionNamespaceLister interface { type AcceleratorFunctionNamespaceLister interface {
// List lists all AcceleratorFunctions in the indexer for a given namespace. // 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 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 AcceleratorFunctionNamespaceListerExpansion
} }
@ -72,21 +72,21 @@ type acceleratorFunctionNamespaceLister struct {
} }
// List lists all AcceleratorFunctions in the indexer for a given namespace. // 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{}) { 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 return ret, err
} }
// Get retrieves the AcceleratorFunction from the indexer for a given namespace and name. // 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) obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !exists { 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
} }

View File

@ -14,7 +14,7 @@
// Code generated by lister-gen. DO NOT EDIT. // Code generated by lister-gen. DO NOT EDIT.
package v1 package v2
// AcceleratorFunctionListerExpansion allows custom methods to be added to // AcceleratorFunctionListerExpansion allows custom methods to be added to
// AcceleratorFunctionLister. // AcceleratorFunctionLister.

View File

@ -14,10 +14,10 @@
// Code generated by lister-gen. DO NOT EDIT. // Code generated by lister-gen. DO NOT EDIT.
package v1 package v2
import ( 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/api/errors"
"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache" "k8s.io/client-go/tools/cache"
@ -26,7 +26,7 @@ import (
// FpgaRegionLister helps list FpgaRegions. // FpgaRegionLister helps list FpgaRegions.
type FpgaRegionLister interface { type FpgaRegionLister interface {
// List lists all FpgaRegions in the indexer. // 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 returns an object that can list and get FpgaRegions.
FpgaRegions(namespace string) FpgaRegionNamespaceLister FpgaRegions(namespace string) FpgaRegionNamespaceLister
FpgaRegionListerExpansion FpgaRegionListerExpansion
@ -43,9 +43,9 @@ func NewFpgaRegionLister(indexer cache.Indexer) FpgaRegionLister {
} }
// List lists all FpgaRegions in the indexer. // 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{}) { err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1.FpgaRegion)) ret = append(ret, m.(*v2.FpgaRegion))
}) })
return ret, err return ret, err
} }
@ -58,9 +58,9 @@ func (s *fpgaRegionLister) FpgaRegions(namespace string) FpgaRegionNamespaceList
// FpgaRegionNamespaceLister helps list and get FpgaRegions. // FpgaRegionNamespaceLister helps list and get FpgaRegions.
type FpgaRegionNamespaceLister interface { type FpgaRegionNamespaceLister interface {
// List lists all FpgaRegions in the indexer for a given namespace. // 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 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 FpgaRegionNamespaceListerExpansion
} }
@ -72,21 +72,21 @@ type fpgaRegionNamespaceLister struct {
} }
// List lists all FpgaRegions in the indexer for a given namespace. // 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{}) { 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 return ret, err
} }
// Get retrieves the FpgaRegion from the indexer for a given namespace and name. // 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) obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !exists { 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
} }

View File

@ -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. # instead of the $GOPATH directly. For normal projects this can be dropped.
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ ${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \
${PKG_PATH}/client ${PKG_PATH}/apis \ ${PKG_PATH}/client ${PKG_PATH}/apis \
fpga.intel.com:v1 \ fpga.intel.com:v2 \
--output-base "$(dirname ${BASH_SOURCE})/../../../.." \ --output-base "$(dirname ${BASH_SOURCE})/../../../.." \
--go-header-file ${SCRIPT_ROOT}/build/boilerplate/boilerplate.go.txt --go-header-file ${SCRIPT_ROOT}/build/boilerplate/boilerplate.go.txt