Change groupName to groupsnapshot.storage.k8s.io
This commit is contained in:
@@ -15,6 +15,6 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// +k8s:deepcopy-gen=package
|
// +k8s:deepcopy-gen=package
|
||||||
// +groupName=snapshot.storage.k8s.io
|
// +groupName=groupsnapshot.storage.k8s.io
|
||||||
|
|
||||||
package v1alpha1
|
package v1alpha1
|
||||||
|
@@ -20,7 +20,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// GroupName is the group name use in this package.
|
// GroupName is the group name use in this package.
|
||||||
const GroupName = "snapshot.storage.k8s.io"
|
const GroupName = "groupsnapshot.storage.k8s.io"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// SchemeBuilder is the new scheme builder
|
// SchemeBuilder is the new scheme builder
|
||||||
|
@@ -22,7 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1"
|
groupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1"
|
||||||
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1"
|
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1"
|
||||||
discovery "k8s.io/client-go/discovery"
|
discovery "k8s.io/client-go/discovery"
|
||||||
rest "k8s.io/client-go/rest"
|
rest "k8s.io/client-go/rest"
|
||||||
@@ -31,20 +31,20 @@ import (
|
|||||||
|
|
||||||
type Interface interface {
|
type Interface interface {
|
||||||
Discovery() discovery.DiscoveryInterface
|
Discovery() discovery.DiscoveryInterface
|
||||||
SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface
|
GroupsnapshotV1alpha1() groupsnapshotv1alpha1.GroupsnapshotV1alpha1Interface
|
||||||
SnapshotV1() snapshotv1.SnapshotV1Interface
|
SnapshotV1() snapshotv1.SnapshotV1Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clientset contains the clients for groups.
|
// Clientset contains the clients for groups.
|
||||||
type Clientset struct {
|
type Clientset struct {
|
||||||
*discovery.DiscoveryClient
|
*discovery.DiscoveryClient
|
||||||
snapshotV1alpha1 *snapshotv1alpha1.SnapshotV1alpha1Client
|
groupsnapshotV1alpha1 *groupsnapshotv1alpha1.GroupsnapshotV1alpha1Client
|
||||||
snapshotV1 *snapshotv1.SnapshotV1Client
|
snapshotV1 *snapshotv1.SnapshotV1Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotV1alpha1 retrieves the SnapshotV1alpha1Client
|
// GroupsnapshotV1alpha1 retrieves the GroupsnapshotV1alpha1Client
|
||||||
func (c *Clientset) SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface {
|
func (c *Clientset) GroupsnapshotV1alpha1() groupsnapshotv1alpha1.GroupsnapshotV1alpha1Interface {
|
||||||
return c.snapshotV1alpha1
|
return c.groupsnapshotV1alpha1
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotV1 retrieves the SnapshotV1Client
|
// SnapshotV1 retrieves the SnapshotV1Client
|
||||||
@@ -96,7 +96,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset,
|
|||||||
|
|
||||||
var cs Clientset
|
var cs Clientset
|
||||||
var err error
|
var err error
|
||||||
cs.snapshotV1alpha1, err = snapshotv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
cs.groupsnapshotV1alpha1, err = groupsnapshotv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -125,7 +125,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.snapshotV1alpha1 = snapshotv1alpha1.New(c)
|
cs.groupsnapshotV1alpha1 = groupsnapshotv1alpha1.New(c)
|
||||||
cs.snapshotV1 = snapshotv1.New(c)
|
cs.snapshotV1 = snapshotv1.New(c)
|
||||||
|
|
||||||
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||||
|
@@ -20,8 +20,8 @@ package fake
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
clientset "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned"
|
clientset "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned"
|
||||||
snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1"
|
groupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1"
|
||||||
fakesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/fake"
|
fakegroupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumegroupsnapshot/v1alpha1/fake"
|
||||||
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1"
|
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1"
|
||||||
fakesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1/fake"
|
fakesnapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/clientset/versioned/typed/volumesnapshot/v1/fake"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
@@ -81,9 +81,9 @@ var (
|
|||||||
_ testing.FakeClient = &Clientset{}
|
_ testing.FakeClient = &Clientset{}
|
||||||
)
|
)
|
||||||
|
|
||||||
// SnapshotV1alpha1 retrieves the SnapshotV1alpha1Client
|
// GroupsnapshotV1alpha1 retrieves the GroupsnapshotV1alpha1Client
|
||||||
func (c *Clientset) SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface {
|
func (c *Clientset) GroupsnapshotV1alpha1() groupsnapshotv1alpha1.GroupsnapshotV1alpha1Interface {
|
||||||
return &fakesnapshotv1alpha1.FakeSnapshotV1alpha1{Fake: &c.Fake}
|
return &fakegroupsnapshotv1alpha1.FakeGroupsnapshotV1alpha1{Fake: &c.Fake}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotV1 retrieves the SnapshotV1Client
|
// SnapshotV1 retrieves the SnapshotV1Client
|
||||||
|
@@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
package fake
|
package fake
|
||||||
|
|
||||||
import (
|
import (
|
||||||
snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
|
groupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
|
||||||
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
|
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
|
||||||
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"
|
||||||
@@ -32,7 +32,7 @@ var scheme = runtime.NewScheme()
|
|||||||
var codecs = serializer.NewCodecFactory(scheme)
|
var codecs = serializer.NewCodecFactory(scheme)
|
||||||
|
|
||||||
var localSchemeBuilder = runtime.SchemeBuilder{
|
var localSchemeBuilder = runtime.SchemeBuilder{
|
||||||
snapshotv1alpha1.AddToScheme,
|
groupsnapshotv1alpha1.AddToScheme,
|
||||||
snapshotv1.AddToScheme,
|
snapshotv1.AddToScheme,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ limitations under the License.
|
|||||||
package scheme
|
package scheme
|
||||||
|
|
||||||
import (
|
import (
|
||||||
snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
|
groupsnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumegroupsnapshot/v1alpha1"
|
||||||
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
|
snapshotv1 "github.com/kubernetes-csi/external-snapshotter/client/v6/apis/volumesnapshot/v1"
|
||||||
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"
|
||||||
@@ -32,7 +32,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{
|
||||||
snapshotv1alpha1.AddToScheme,
|
groupsnapshotv1alpha1.AddToScheme,
|
||||||
snapshotv1.AddToScheme,
|
snapshotv1.AddToScheme,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -32,13 +32,13 @@ import (
|
|||||||
|
|
||||||
// FakeVolumeGroupSnapshots implements VolumeGroupSnapshotInterface
|
// FakeVolumeGroupSnapshots implements VolumeGroupSnapshotInterface
|
||||||
type FakeVolumeGroupSnapshots struct {
|
type FakeVolumeGroupSnapshots struct {
|
||||||
Fake *FakeSnapshotV1alpha1
|
Fake *FakeGroupsnapshotV1alpha1
|
||||||
ns string
|
ns string
|
||||||
}
|
}
|
||||||
|
|
||||||
var volumegroupsnapshotsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshots"}
|
var volumegroupsnapshotsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshots"}
|
||||||
|
|
||||||
var volumegroupsnapshotsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshot"}
|
var volumegroupsnapshotsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshot"}
|
||||||
|
|
||||||
// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any.
|
// Get takes name of the volumeGroupSnapshot, and returns the corresponding volumeGroupSnapshot object, and an error if there is any.
|
||||||
func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
|
func (c *FakeVolumeGroupSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshot, err error) {
|
||||||
|
@@ -24,25 +24,25 @@ import (
|
|||||||
testing "k8s.io/client-go/testing"
|
testing "k8s.io/client-go/testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
type FakeSnapshotV1alpha1 struct {
|
type FakeGroupsnapshotV1alpha1 struct {
|
||||||
*testing.Fake
|
*testing.Fake
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeSnapshotV1alpha1) VolumeGroupSnapshots(namespace string) v1alpha1.VolumeGroupSnapshotInterface {
|
func (c *FakeGroupsnapshotV1alpha1) VolumeGroupSnapshots(namespace string) v1alpha1.VolumeGroupSnapshotInterface {
|
||||||
return &FakeVolumeGroupSnapshots{c, namespace}
|
return &FakeVolumeGroupSnapshots{c, namespace}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeSnapshotV1alpha1) VolumeGroupSnapshotClasses() v1alpha1.VolumeGroupSnapshotClassInterface {
|
func (c *FakeGroupsnapshotV1alpha1) VolumeGroupSnapshotClasses() v1alpha1.VolumeGroupSnapshotClassInterface {
|
||||||
return &FakeVolumeGroupSnapshotClasses{c}
|
return &FakeVolumeGroupSnapshotClasses{c}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeSnapshotV1alpha1) VolumeGroupSnapshotContents() v1alpha1.VolumeGroupSnapshotContentInterface {
|
func (c *FakeGroupsnapshotV1alpha1) VolumeGroupSnapshotContents() v1alpha1.VolumeGroupSnapshotContentInterface {
|
||||||
return &FakeVolumeGroupSnapshotContents{c}
|
return &FakeVolumeGroupSnapshotContents{c}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 *FakeSnapshotV1alpha1) RESTClient() rest.Interface {
|
func (c *FakeGroupsnapshotV1alpha1) RESTClient() rest.Interface {
|
||||||
var ret *rest.RESTClient
|
var ret *rest.RESTClient
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
@@ -32,12 +32,12 @@ import (
|
|||||||
|
|
||||||
// FakeVolumeGroupSnapshotClasses implements VolumeGroupSnapshotClassInterface
|
// FakeVolumeGroupSnapshotClasses implements VolumeGroupSnapshotClassInterface
|
||||||
type FakeVolumeGroupSnapshotClasses struct {
|
type FakeVolumeGroupSnapshotClasses struct {
|
||||||
Fake *FakeSnapshotV1alpha1
|
Fake *FakeGroupsnapshotV1alpha1
|
||||||
}
|
}
|
||||||
|
|
||||||
var volumegroupsnapshotclassesResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotclasses"}
|
var volumegroupsnapshotclassesResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotclasses"}
|
||||||
|
|
||||||
var volumegroupsnapshotclassesKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotClass"}
|
var volumegroupsnapshotclassesKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotClass"}
|
||||||
|
|
||||||
// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any.
|
// Get takes name of the volumeGroupSnapshotClass, and returns the corresponding volumeGroupSnapshotClass object, and an error if there is any.
|
||||||
func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
|
func (c *FakeVolumeGroupSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotClass, err error) {
|
||||||
|
@@ -32,12 +32,12 @@ import (
|
|||||||
|
|
||||||
// FakeVolumeGroupSnapshotContents implements VolumeGroupSnapshotContentInterface
|
// FakeVolumeGroupSnapshotContents implements VolumeGroupSnapshotContentInterface
|
||||||
type FakeVolumeGroupSnapshotContents struct {
|
type FakeVolumeGroupSnapshotContents struct {
|
||||||
Fake *FakeSnapshotV1alpha1
|
Fake *FakeGroupsnapshotV1alpha1
|
||||||
}
|
}
|
||||||
|
|
||||||
var volumegroupsnapshotcontentsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotcontents"}
|
var volumegroupsnapshotcontentsResource = schema.GroupVersionResource{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumegroupsnapshotcontents"}
|
||||||
|
|
||||||
var volumegroupsnapshotcontentsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotContent"}
|
var volumegroupsnapshotcontentsKind = schema.GroupVersionKind{Group: "groupsnapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeGroupSnapshotContent"}
|
||||||
|
|
||||||
// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any.
|
// Get takes name of the volumeGroupSnapshotContent, and returns the corresponding volumeGroupSnapshotContent object, and an error if there is any.
|
||||||
func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
|
func (c *FakeVolumeGroupSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeGroupSnapshotContent, err error) {
|
||||||
|
@@ -57,7 +57,7 @@ type volumeGroupSnapshots struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newVolumeGroupSnapshots returns a VolumeGroupSnapshots
|
// newVolumeGroupSnapshots returns a VolumeGroupSnapshots
|
||||||
func newVolumeGroupSnapshots(c *SnapshotV1alpha1Client, namespace string) *volumeGroupSnapshots {
|
func newVolumeGroupSnapshots(c *GroupsnapshotV1alpha1Client, namespace string) *volumeGroupSnapshots {
|
||||||
return &volumeGroupSnapshots{
|
return &volumeGroupSnapshots{
|
||||||
client: c.RESTClient(),
|
client: c.RESTClient(),
|
||||||
ns: namespace,
|
ns: namespace,
|
||||||
|
@@ -26,34 +26,34 @@ import (
|
|||||||
rest "k8s.io/client-go/rest"
|
rest "k8s.io/client-go/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SnapshotV1alpha1Interface interface {
|
type GroupsnapshotV1alpha1Interface interface {
|
||||||
RESTClient() rest.Interface
|
RESTClient() rest.Interface
|
||||||
VolumeGroupSnapshotsGetter
|
VolumeGroupSnapshotsGetter
|
||||||
VolumeGroupSnapshotClassesGetter
|
VolumeGroupSnapshotClassesGetter
|
||||||
VolumeGroupSnapshotContentsGetter
|
VolumeGroupSnapshotContentsGetter
|
||||||
}
|
}
|
||||||
|
|
||||||
// SnapshotV1alpha1Client is used to interact with features provided by the snapshot.storage.k8s.io group.
|
// GroupsnapshotV1alpha1Client is used to interact with features provided by the groupsnapshot.storage.k8s.io group.
|
||||||
type SnapshotV1alpha1Client struct {
|
type GroupsnapshotV1alpha1Client struct {
|
||||||
restClient rest.Interface
|
restClient rest.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *SnapshotV1alpha1Client) VolumeGroupSnapshots(namespace string) VolumeGroupSnapshotInterface {
|
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshots(namespace string) VolumeGroupSnapshotInterface {
|
||||||
return newVolumeGroupSnapshots(c, namespace)
|
return newVolumeGroupSnapshots(c, namespace)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *SnapshotV1alpha1Client) VolumeGroupSnapshotClasses() VolumeGroupSnapshotClassInterface {
|
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshotClasses() VolumeGroupSnapshotClassInterface {
|
||||||
return newVolumeGroupSnapshotClasses(c)
|
return newVolumeGroupSnapshotClasses(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *SnapshotV1alpha1Client) VolumeGroupSnapshotContents() VolumeGroupSnapshotContentInterface {
|
func (c *GroupsnapshotV1alpha1Client) VolumeGroupSnapshotContents() VolumeGroupSnapshotContentInterface {
|
||||||
return newVolumeGroupSnapshotContents(c)
|
return newVolumeGroupSnapshotContents(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewForConfig creates a new SnapshotV1alpha1Client for the given config.
|
// NewForConfig creates a new GroupsnapshotV1alpha1Client for the given config.
|
||||||
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient),
|
||||||
// where httpClient was generated with rest.HTTPClientFor(c).
|
// where httpClient was generated with rest.HTTPClientFor(c).
|
||||||
func NewForConfig(c *rest.Config) (*SnapshotV1alpha1Client, error) {
|
func NewForConfig(c *rest.Config) (*GroupsnapshotV1alpha1Client, error) {
|
||||||
config := *c
|
config := *c
|
||||||
if err := setConfigDefaults(&config); err != nil {
|
if err := setConfigDefaults(&config); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -65,9 +65,9 @@ func NewForConfig(c *rest.Config) (*SnapshotV1alpha1Client, error) {
|
|||||||
return NewForConfigAndClient(&config, httpClient)
|
return NewForConfigAndClient(&config, httpClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewForConfigAndClient creates a new SnapshotV1alpha1Client for the given config and http client.
|
// NewForConfigAndClient creates a new GroupsnapshotV1alpha1Client for the given config and http client.
|
||||||
// Note the http client provided takes precedence over the configured transport values.
|
// Note the http client provided takes precedence over the configured transport values.
|
||||||
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SnapshotV1alpha1Client, error) {
|
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*GroupsnapshotV1alpha1Client, error) {
|
||||||
config := *c
|
config := *c
|
||||||
if err := setConfigDefaults(&config); err != nil {
|
if err := setConfigDefaults(&config); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -76,12 +76,12 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SnapshotV1alpha1Cli
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return &SnapshotV1alpha1Client{client}, nil
|
return &GroupsnapshotV1alpha1Client{client}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewForConfigOrDie creates a new SnapshotV1alpha1Client for the given config and
|
// NewForConfigOrDie creates a new GroupsnapshotV1alpha1Client 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) *SnapshotV1alpha1Client {
|
func NewForConfigOrDie(c *rest.Config) *GroupsnapshotV1alpha1Client {
|
||||||
client, err := NewForConfig(c)
|
client, err := NewForConfig(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@@ -89,9 +89,9 @@ func NewForConfigOrDie(c *rest.Config) *SnapshotV1alpha1Client {
|
|||||||
return client
|
return client
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new SnapshotV1alpha1Client for the given RESTClient.
|
// New creates a new GroupsnapshotV1alpha1Client for the given RESTClient.
|
||||||
func New(c rest.Interface) *SnapshotV1alpha1Client {
|
func New(c rest.Interface) *GroupsnapshotV1alpha1Client {
|
||||||
return &SnapshotV1alpha1Client{c}
|
return &GroupsnapshotV1alpha1Client{c}
|
||||||
}
|
}
|
||||||
|
|
||||||
func setConfigDefaults(config *rest.Config) error {
|
func setConfigDefaults(config *rest.Config) error {
|
||||||
@@ -109,7 +109,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 *SnapshotV1alpha1Client) RESTClient() rest.Interface {
|
func (c *GroupsnapshotV1alpha1Client) RESTClient() rest.Interface {
|
||||||
if c == nil {
|
if c == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,7 @@ type volumeGroupSnapshotClasses struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newVolumeGroupSnapshotClasses returns a VolumeGroupSnapshotClasses
|
// newVolumeGroupSnapshotClasses returns a VolumeGroupSnapshotClasses
|
||||||
func newVolumeGroupSnapshotClasses(c *SnapshotV1alpha1Client) *volumeGroupSnapshotClasses {
|
func newVolumeGroupSnapshotClasses(c *GroupsnapshotV1alpha1Client) *volumeGroupSnapshotClasses {
|
||||||
return &volumeGroupSnapshotClasses{
|
return &volumeGroupSnapshotClasses{
|
||||||
client: c.RESTClient(),
|
client: c.RESTClient(),
|
||||||
}
|
}
|
||||||
|
@@ -56,7 +56,7 @@ type volumeGroupSnapshotContents struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// newVolumeGroupSnapshotContents returns a VolumeGroupSnapshotContents
|
// newVolumeGroupSnapshotContents returns a VolumeGroupSnapshotContents
|
||||||
func newVolumeGroupSnapshotContents(c *SnapshotV1alpha1Client) *volumeGroupSnapshotContents {
|
func newVolumeGroupSnapshotContents(c *GroupsnapshotV1alpha1Client) *volumeGroupSnapshotContents {
|
||||||
return &volumeGroupSnapshotContents{
|
return &volumeGroupSnapshotContents{
|
||||||
client: c.RESTClient(),
|
client: c.RESTClient(),
|
||||||
}
|
}
|
||||||
|
@@ -4,11 +4,10 @@ kind: CustomResourceDefinition
|
|||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.11.3
|
controller-gen.kubebuilder.io/version: v0.11.3
|
||||||
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
|
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: volumegroupsnapshotclasses.snapshot.storage.k8s.io
|
name: volumegroupsnapshotclasses.groupsnapshot.storage.k8s.io
|
||||||
spec:
|
spec:
|
||||||
group: snapshot.storage.k8s.io
|
group: groupsnapshot.storage.k8s.io
|
||||||
names:
|
names:
|
||||||
kind: VolumeGroupSnapshotClass
|
kind: VolumeGroupSnapshotClass
|
||||||
listKind: VolumeGroupSnapshotClassList
|
listKind: VolumeGroupSnapshotClassList
|
@@ -4,11 +4,10 @@ kind: CustomResourceDefinition
|
|||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.11.3
|
controller-gen.kubebuilder.io/version: v0.11.3
|
||||||
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
|
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: volumegroupsnapshotcontents.snapshot.storage.k8s.io
|
name: volumegroupsnapshotcontents.groupsnapshot.storage.k8s.io
|
||||||
spec:
|
spec:
|
||||||
group: snapshot.storage.k8s.io
|
group: groupsnapshot.storage.k8s.io
|
||||||
names:
|
names:
|
||||||
kind: VolumeGroupSnapshotContent
|
kind: VolumeGroupSnapshotContent
|
||||||
listKind: VolumeGroupSnapshotContentList
|
listKind: VolumeGroupSnapshotContentList
|
@@ -4,11 +4,10 @@ kind: CustomResourceDefinition
|
|||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
controller-gen.kubebuilder.io/version: v0.11.3
|
controller-gen.kubebuilder.io/version: v0.11.3
|
||||||
api-approved.kubernetes.io: "https://github.com/kubernetes-csi/external-snapshotter/pull/814"
|
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: volumegroupsnapshots.snapshot.storage.k8s.io
|
name: volumegroupsnapshots.groupsnapshot.storage.k8s.io
|
||||||
spec:
|
spec:
|
||||||
group: snapshot.storage.k8s.io
|
group: groupsnapshot.storage.k8s.io
|
||||||
names:
|
names:
|
||||||
kind: VolumeGroupSnapshot
|
kind: VolumeGroupSnapshot
|
||||||
listKind: VolumeGroupSnapshotList
|
listKind: VolumeGroupSnapshotList
|
@@ -52,40 +52,6 @@ Once you run the script, you will get an output as follows:
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The following changes need to be made manually after running the above script:
|
|
||||||
|
|
||||||
* The `SharedInformerFactory` interface in `./informers/factory.go` will have two functions named `Snapshot()`. Modify one to `GroupSnapshot()` and fix all references to that function in `informers/generic.go`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
Snapshot() volumegroupsnapshot.Interface
|
|
||||||
Snapshot() volumesnapshot.Interface
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *sharedInformerFactory) Snapshot() volumegroupsnapshot.Interface {
|
|
||||||
return volumegroupsnapshot.New(f, f.namespace, f.tweakListOptions)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *sharedInformerFactory) Snapshot() volumesnapshot.Interface {
|
|
||||||
return volumesnapshot.New(f, f.namespace, f.tweakListOptions)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
will become
|
|
||||||
|
|
||||||
```bash
|
|
||||||
GroupSnapshot() volumegroupsnapshot.Interface
|
|
||||||
Snapshot() volumesnapshot.Interface
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *sharedInformerFactory) GroupSnapshot() volumegroupsnapshot.Interface {
|
|
||||||
return volumegroupsnapshot.New(f, f.namespace, f.tweakListOptions)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *sharedInformerFactory) Snapshot() volumesnapshot.Interface {
|
|
||||||
return volumesnapshot.New(f, f.namespace, f.tweakListOptions)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## update-crd.sh
|
## update-crd.sh
|
||||||
|
|
||||||
NOTE: We need to keep both v1beta1 and v1 snapshot APIs but set served and storage version of v1beta1 to false. Please copy back the v1beta1 manifest back to the files as this script will remove it.
|
NOTE: We need to keep both v1beta1 and v1 snapshot APIs but set served and storage version of v1beta1 to false. Please copy back the v1beta1 manifest back to the files as this script will remove it.
|
||||||
@@ -188,7 +154,7 @@ Update the restoreSize property to use type string only:
|
|||||||
|
|
||||||
* Add the VolumeSnapshot namespace to the `additionalPrinterColumns` section. Refer https://github.com/kubernetes-csi/external-snapshotter/pull/535 for more details.
|
* Add the VolumeSnapshot namespace to the `additionalPrinterColumns` section. Refer https://github.com/kubernetes-csi/external-snapshotter/pull/535 for more details.
|
||||||
|
|
||||||
* In `client/config/crd/snapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml `, we need to add the `oneOf` constraint to make sure only one of `persistentVolumeNames` and `volumeGroupSnapshotHandle` is specified in the `source` field of the `spec` of `VolumeGroupSnapshotContent`.
|
* In `client/config/crd/groupsnapshot.storage.k8s.io_volumegroupsnapshotcontents.yaml `, we need to add the `oneOf` constraint to make sure only one of `persistentVolumeNames` and `volumeGroupSnapshotHandle` is specified in the `source` field of the `spec` of `VolumeGroupSnapshotContent`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
source:
|
source:
|
||||||
|
@@ -244,11 +244,11 @@ type SharedInformerFactory interface {
|
|||||||
// client.
|
// client.
|
||||||
InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer
|
InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer
|
||||||
|
|
||||||
GroupSnapshot() volumegroupsnapshot.Interface
|
Groupsnapshot() volumegroupsnapshot.Interface
|
||||||
Snapshot() volumesnapshot.Interface
|
Snapshot() volumesnapshot.Interface
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *sharedInformerFactory) GroupSnapshot() volumegroupsnapshot.Interface {
|
func (f *sharedInformerFactory) Groupsnapshot() volumegroupsnapshot.Interface {
|
||||||
return volumegroupsnapshot.New(f, f.namespace, f.tweakListOptions)
|
return volumegroupsnapshot.New(f, f.namespace, f.tweakListOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,7 +53,15 @@ 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=snapshot.storage.k8s.io, Version=v1
|
// Group=groupsnapshot.storage.k8s.io, Version=v1alpha1
|
||||||
|
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshots().Informer()}, nil
|
||||||
|
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshotClasses().Informer()}, nil
|
||||||
|
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents"):
|
||||||
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Groupsnapshot().V1alpha1().VolumeGroupSnapshotContents().Informer()}, nil
|
||||||
|
|
||||||
|
// Group=snapshot.storage.k8s.io, Version=v1
|
||||||
case v1.SchemeGroupVersion.WithResource("volumesnapshots"):
|
case v1.SchemeGroupVersion.WithResource("volumesnapshots"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshots().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshots().Informer()}, nil
|
||||||
case v1.SchemeGroupVersion.WithResource("volumesnapshotclasses"):
|
case v1.SchemeGroupVersion.WithResource("volumesnapshotclasses"):
|
||||||
@@ -61,14 +69,6 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
|||||||
case v1.SchemeGroupVersion.WithResource("volumesnapshotcontents"):
|
case v1.SchemeGroupVersion.WithResource("volumesnapshotcontents"):
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshotContents().Informer()}, nil
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1().VolumeSnapshotContents().Informer()}, nil
|
||||||
|
|
||||||
// Group=snapshot.storage.k8s.io, Version=v1alpha1
|
|
||||||
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshots"):
|
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshots().Informer()}, nil
|
|
||||||
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotclasses"):
|
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshotClasses().Informer()}, nil
|
|
||||||
case v1alpha1.SchemeGroupVersion.WithResource("volumegroupsnapshotcontents"):
|
|
||||||
return &genericInformer{resource: resource.GroupResource(), informer: f.GroupSnapshot().V1alpha1().VolumeGroupSnapshotContents().Informer()}, nil
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, fmt.Errorf("no informer found for %v", resource)
|
return nil, fmt.Errorf("no informer found for %v", resource)
|
||||||
|
@@ -62,13 +62,13 @@ func NewFilteredVolumeGroupSnapshotInformer(client versioned.Interface, namespac
|
|||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshots(namespace).List(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshots(namespace).List(context.TODO(), options)
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshots(namespace).Watch(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshots(namespace).Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshot{},
|
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshot{},
|
||||||
|
@@ -61,13 +61,13 @@ func NewFilteredVolumeGroupSnapshotClassInformer(client versioned.Interface, res
|
|||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshotClasses().List(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotClasses().List(context.TODO(), options)
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshotClasses().Watch(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotClasses().Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotClass{},
|
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotClass{},
|
||||||
|
@@ -61,13 +61,13 @@ func NewFilteredVolumeGroupSnapshotContentInformer(client versioned.Interface, r
|
|||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshotContents().List(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotContents().List(context.TODO(), options)
|
||||||
},
|
},
|
||||||
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
|
||||||
if tweakListOptions != nil {
|
if tweakListOptions != nil {
|
||||||
tweakListOptions(&options)
|
tweakListOptions(&options)
|
||||||
}
|
}
|
||||||
return client.SnapshotV1alpha1().VolumeGroupSnapshotContents().Watch(context.TODO(), options)
|
return client.GroupsnapshotV1alpha1().VolumeGroupSnapshotContents().Watch(context.TODO(), options)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotContent{},
|
&volumegroupsnapshotv1alpha1.VolumeGroupSnapshotContent{},
|
||||||
|
Reference in New Issue
Block a user