Move snapshot APIs and client to v1 (no controller changes)

This commit is contained in:
xing-yang
2020-11-02 22:16:37 +00:00
parent e56a75b271
commit 9e21c6240d
65 changed files with 5914 additions and 220 deletions

View File

@@ -21,6 +21,7 @@ package versioned
import (
"fmt"
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned/typed/volumesnapshot/v1"
snapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/client/v3/clientset/versioned/typed/volumesnapshot/v1beta1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
@@ -30,6 +31,7 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
SnapshotV1beta1() snapshotv1beta1.SnapshotV1beta1Interface
SnapshotV1() snapshotv1.SnapshotV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
@@ -37,6 +39,7 @@ type Interface interface {
type Clientset struct {
*discovery.DiscoveryClient
snapshotV1beta1 *snapshotv1beta1.SnapshotV1beta1Client
snapshotV1 *snapshotv1.SnapshotV1Client
}
// SnapshotV1beta1 retrieves the SnapshotV1beta1Client
@@ -44,6 +47,11 @@ func (c *Clientset) SnapshotV1beta1() snapshotv1beta1.SnapshotV1beta1Interface {
return c.snapshotV1beta1
}
// SnapshotV1 retrieves the SnapshotV1Client
func (c *Clientset) SnapshotV1() snapshotv1.SnapshotV1Interface {
return c.snapshotV1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
@@ -69,6 +77,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
if err != nil {
return nil, err
}
cs.snapshotV1, err = snapshotv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
@@ -82,6 +94,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.snapshotV1beta1 = snapshotv1beta1.NewForConfigOrDie(c)
cs.snapshotV1 = snapshotv1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@@ -91,6 +104,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset {
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.snapshotV1beta1 = snapshotv1beta1.New(c)
cs.snapshotV1 = snapshotv1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs