diff --git a/cmd/csi-snapshotter/main.go b/cmd/csi-snapshotter/main.go index b07f3a0e..4b93a4a2 100644 --- a/cmd/csi-snapshotter/main.go +++ b/cmd/csi-snapshotter/main.go @@ -184,9 +184,9 @@ func main() { snapClient, kubeClient, *snapshotterName, - factory.Volumesnapshot().V1alpha1().VolumeSnapshots(), - factory.Volumesnapshot().V1alpha1().VolumeSnapshotContents(), - factory.Volumesnapshot().V1alpha1().VolumeSnapshotClasses(), + factory.Snapshot().V1alpha1().VolumeSnapshots(), + factory.Snapshot().V1alpha1().VolumeSnapshotContents(), + factory.Snapshot().V1alpha1().VolumeSnapshotClasses(), coreFactory.Core().V1().PersistentVolumeClaims(), *createSnapshotContentRetryCount, *createSnapshotContentInterval, diff --git a/pkg/apis/volumesnapshot/v1alpha1/doc.go b/pkg/apis/volumesnapshot/v1alpha1/doc.go index fd1b5f86..90642a58 100644 --- a/pkg/apis/volumesnapshot/v1alpha1/doc.go +++ b/pkg/apis/volumesnapshot/v1alpha1/doc.go @@ -15,5 +15,6 @@ limitations under the License. */ // +k8s:deepcopy-gen=package +// +groupName=snapshot.storage.k8s.io package v1alpha1 diff --git a/pkg/apis/volumesnapshot/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/volumesnapshot/v1alpha1/zz_generated.deepcopy.go index baed77c6..38db004a 100644 --- a/pkg/apis/volumesnapshot/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/volumesnapshot/v1alpha1/zz_generated.deepcopy.go @@ -1,7 +1,7 @@ // +build !ignore_autogenerated /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/clientset.go b/pkg/client/clientset/versioned/clientset.go index 5aefca14..5bcff998 100644 --- a/pkg/client/clientset/versioned/clientset.go +++ b/pkg/client/clientset/versioned/clientset.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ limitations under the License. package versioned import ( - volumesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1" + snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1" discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" @@ -27,27 +27,19 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface - VolumesnapshotV1alpha1() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface - // Deprecated: please explicitly pick a version if possible. - Volumesnapshot() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface + SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - volumesnapshotV1alpha1 *volumesnapshotv1alpha1.VolumesnapshotV1alpha1Client + snapshotV1alpha1 *snapshotv1alpha1.SnapshotV1alpha1Client } -// VolumesnapshotV1alpha1 retrieves the VolumesnapshotV1alpha1Client -func (c *Clientset) VolumesnapshotV1alpha1() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface { - return c.volumesnapshotV1alpha1 -} - -// Deprecated: Volumesnapshot retrieves the default version of VolumesnapshotClient. -// Please explicitly pick a version. -func (c *Clientset) Volumesnapshot() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface { - return c.volumesnapshotV1alpha1 +// SnapshotV1alpha1 retrieves the SnapshotV1alpha1Client +func (c *Clientset) SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface { + return c.snapshotV1alpha1 } // Discovery retrieves the DiscoveryClient @@ -66,7 +58,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.volumesnapshotV1alpha1, err = volumesnapshotv1alpha1.NewForConfig(&configShallowCopy) + cs.snapshotV1alpha1, err = snapshotv1alpha1.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -82,7 +74,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.volumesnapshotV1alpha1 = volumesnapshotv1alpha1.NewForConfigOrDie(c) + cs.snapshotV1alpha1 = snapshotv1alpha1.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -91,7 +83,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.volumesnapshotV1alpha1 = volumesnapshotv1alpha1.New(c) + cs.snapshotV1alpha1 = snapshotv1alpha1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/clientset/versioned/doc.go b/pkg/client/clientset/versioned/doc.go index 006b7921..dc992b90 100644 --- a/pkg/client/clientset/versioned/doc.go +++ b/pkg/client/clientset/versioned/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/clientset_generated.go b/pkg/client/clientset/versioned/fake/clientset_generated.go index d1c26394..0c5b8293 100644 --- a/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ package fake import ( clientset "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned" - volumesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1" - fakevolumesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake" + snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1" + fakesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/discovery" @@ -71,12 +71,7 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} -// VolumesnapshotV1alpha1 retrieves the VolumesnapshotV1alpha1Client -func (c *Clientset) VolumesnapshotV1alpha1() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface { - return &fakevolumesnapshotv1alpha1.FakeVolumesnapshotV1alpha1{Fake: &c.Fake} -} - -// Volumesnapshot retrieves the VolumesnapshotV1alpha1Client -func (c *Clientset) Volumesnapshot() volumesnapshotv1alpha1.VolumesnapshotV1alpha1Interface { - return &fakevolumesnapshotv1alpha1.FakeVolumesnapshotV1alpha1{Fake: &c.Fake} +// SnapshotV1alpha1 retrieves the SnapshotV1alpha1Client +func (c *Clientset) SnapshotV1alpha1() snapshotv1alpha1.SnapshotV1alpha1Interface { + return &fakesnapshotv1alpha1.FakeSnapshotV1alpha1{Fake: &c.Fake} } diff --git a/pkg/client/clientset/versioned/fake/doc.go b/pkg/client/clientset/versioned/fake/doc.go index 0bc260bc..acfa6173 100644 --- a/pkg/client/clientset/versioned/fake/doc.go +++ b/pkg/client/clientset/versioned/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/fake/register.go b/pkg/client/clientset/versioned/fake/register.go index 1f1b7261..903889fd 100644 --- a/pkg/client/clientset/versioned/fake/register.go +++ b/pkg/client/clientset/versioned/fake/register.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - volumesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1" + snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - volumesnapshotv1alpha1.AddToScheme, + snapshotv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/scheme/doc.go b/pkg/client/clientset/versioned/scheme/doc.go index 5c5c8deb..7f61dc1f 100644 --- a/pkg/client/clientset/versioned/scheme/doc.go +++ b/pkg/client/clientset/versioned/scheme/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/scheme/register.go b/pkg/client/clientset/versioned/scheme/register.go index 6215c628..46efa8fe 100644 --- a/pkg/client/clientset/versioned/scheme/register.go +++ b/pkg/client/clientset/versioned/scheme/register.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - volumesnapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1" + snapshotv1alpha1 "github.com/kubernetes-csi/external-snapshotter/pkg/apis/volumesnapshot/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - volumesnapshotv1alpha1.AddToScheme, + snapshotv1alpha1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/doc.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/doc.go index 69ca3011..9752e759 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/doc.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/doc.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/doc.go index 87a1873e..ab4fd43a 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/doc.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot.go index 5da6c931..05016a1a 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,13 +30,13 @@ import ( // FakeVolumeSnapshots implements VolumeSnapshotInterface type FakeVolumeSnapshots struct { - Fake *FakeVolumesnapshotV1alpha1 + Fake *FakeSnapshotV1alpha1 ns string } -var volumesnapshotsResource = schema.GroupVersionResource{Group: "volumesnapshot", Version: "v1alpha1", Resource: "volumesnapshots"} +var volumesnapshotsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumesnapshots"} -var volumesnapshotsKind = schema.GroupVersionKind{Group: "volumesnapshot", Version: "v1alpha1", Kind: "VolumeSnapshot"} +var volumesnapshotsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeSnapshot"} // Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. func (c *FakeVolumeSnapshots) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeSnapshot, err error) { diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot_client.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot_client.go index 7433d14f..6c8b11a5 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot_client.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshot_client.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,25 +24,25 @@ import ( testing "k8s.io/client-go/testing" ) -type FakeVolumesnapshotV1alpha1 struct { +type FakeSnapshotV1alpha1 struct { *testing.Fake } -func (c *FakeVolumesnapshotV1alpha1) VolumeSnapshots(namespace string) v1alpha1.VolumeSnapshotInterface { +func (c *FakeSnapshotV1alpha1) VolumeSnapshots(namespace string) v1alpha1.VolumeSnapshotInterface { return &FakeVolumeSnapshots{c, namespace} } -func (c *FakeVolumesnapshotV1alpha1) VolumeSnapshotClasses() v1alpha1.VolumeSnapshotClassInterface { +func (c *FakeSnapshotV1alpha1) VolumeSnapshotClasses() v1alpha1.VolumeSnapshotClassInterface { return &FakeVolumeSnapshotClasses{c} } -func (c *FakeVolumesnapshotV1alpha1) VolumeSnapshotContents() v1alpha1.VolumeSnapshotContentInterface { +func (c *FakeSnapshotV1alpha1) VolumeSnapshotContents() v1alpha1.VolumeSnapshotContentInterface { return &FakeVolumeSnapshotContents{c} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeVolumesnapshotV1alpha1) RESTClient() rest.Interface { +func (c *FakeSnapshotV1alpha1) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotclass.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotclass.go index 03c18b68..5c756b20 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotclass.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotclass.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,12 +30,12 @@ import ( // FakeVolumeSnapshotClasses implements VolumeSnapshotClassInterface type FakeVolumeSnapshotClasses struct { - Fake *FakeVolumesnapshotV1alpha1 + Fake *FakeSnapshotV1alpha1 } -var volumesnapshotclassesResource = schema.GroupVersionResource{Group: "volumesnapshot", Version: "v1alpha1", Resource: "volumesnapshotclasses"} +var volumesnapshotclassesResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumesnapshotclasses"} -var volumesnapshotclassesKind = schema.GroupVersionKind{Group: "volumesnapshot", Version: "v1alpha1", Kind: "VolumeSnapshotClass"} +var volumesnapshotclassesKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeSnapshotClass"} // Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. func (c *FakeVolumeSnapshotClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeSnapshotClass, err error) { diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotcontent.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotcontent.go index 2bdd3c5f..f646d1d9 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotcontent.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/fake/fake_volumesnapshotcontent.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,12 +30,12 @@ import ( // FakeVolumeSnapshotContents implements VolumeSnapshotContentInterface type FakeVolumeSnapshotContents struct { - Fake *FakeVolumesnapshotV1alpha1 + Fake *FakeSnapshotV1alpha1 } -var volumesnapshotcontentsResource = schema.GroupVersionResource{Group: "volumesnapshot", Version: "v1alpha1", Resource: "volumesnapshotcontents"} +var volumesnapshotcontentsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Resource: "volumesnapshotcontents"} -var volumesnapshotcontentsKind = schema.GroupVersionKind{Group: "volumesnapshot", Version: "v1alpha1", Kind: "VolumeSnapshotContent"} +var volumesnapshotcontentsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1alpha1", Kind: "VolumeSnapshotContent"} // Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. func (c *FakeVolumeSnapshotContents) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeSnapshotContent, err error) { diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/generated_expansion.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/generated_expansion.go index 5c57b114..9b641f10 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/generated_expansion.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/generated_expansion.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot.go index f383e807..a2f80805 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ type volumeSnapshots struct { } // newVolumeSnapshots returns a VolumeSnapshots -func newVolumeSnapshots(c *VolumesnapshotV1alpha1Client, namespace string) *volumeSnapshots { +func newVolumeSnapshots(c *SnapshotV1alpha1Client, namespace string) *volumeSnapshots { return &volumeSnapshots{ client: c.RESTClient(), ns: namespace, diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot_client.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot_client.go index 7209839d..ba06f657 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot_client.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshot_client.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,32 +25,32 @@ import ( rest "k8s.io/client-go/rest" ) -type VolumesnapshotV1alpha1Interface interface { +type SnapshotV1alpha1Interface interface { RESTClient() rest.Interface VolumeSnapshotsGetter VolumeSnapshotClassesGetter VolumeSnapshotContentsGetter } -// VolumesnapshotV1alpha1Client is used to interact with features provided by the volumesnapshot group. -type VolumesnapshotV1alpha1Client struct { +// SnapshotV1alpha1Client is used to interact with features provided by the snapshot.storage.k8s.io group. +type SnapshotV1alpha1Client struct { restClient rest.Interface } -func (c *VolumesnapshotV1alpha1Client) VolumeSnapshots(namespace string) VolumeSnapshotInterface { +func (c *SnapshotV1alpha1Client) VolumeSnapshots(namespace string) VolumeSnapshotInterface { return newVolumeSnapshots(c, namespace) } -func (c *VolumesnapshotV1alpha1Client) VolumeSnapshotClasses() VolumeSnapshotClassInterface { +func (c *SnapshotV1alpha1Client) VolumeSnapshotClasses() VolumeSnapshotClassInterface { return newVolumeSnapshotClasses(c) } -func (c *VolumesnapshotV1alpha1Client) VolumeSnapshotContents() VolumeSnapshotContentInterface { +func (c *SnapshotV1alpha1Client) VolumeSnapshotContents() VolumeSnapshotContentInterface { return newVolumeSnapshotContents(c) } -// NewForConfig creates a new VolumesnapshotV1alpha1Client for the given config. -func NewForConfig(c *rest.Config) (*VolumesnapshotV1alpha1Client, error) { +// NewForConfig creates a new SnapshotV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*SnapshotV1alpha1Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -59,12 +59,12 @@ func NewForConfig(c *rest.Config) (*VolumesnapshotV1alpha1Client, error) { if err != nil { return nil, err } - return &VolumesnapshotV1alpha1Client{client}, nil + return &SnapshotV1alpha1Client{client}, nil } -// NewForConfigOrDie creates a new VolumesnapshotV1alpha1Client for the given config and +// NewForConfigOrDie creates a new SnapshotV1alpha1Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *VolumesnapshotV1alpha1Client { +func NewForConfigOrDie(c *rest.Config) *SnapshotV1alpha1Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -72,9 +72,9 @@ func NewForConfigOrDie(c *rest.Config) *VolumesnapshotV1alpha1Client { return client } -// New creates a new VolumesnapshotV1alpha1Client for the given RESTClient. -func New(c rest.Interface) *VolumesnapshotV1alpha1Client { - return &VolumesnapshotV1alpha1Client{c} +// New creates a new SnapshotV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *SnapshotV1alpha1Client { + return &SnapshotV1alpha1Client{c} } func setConfigDefaults(config *rest.Config) error { @@ -92,7 +92,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *VolumesnapshotV1alpha1Client) RESTClient() rest.Interface { +func (c *SnapshotV1alpha1Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotclass.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotclass.go index 9e48bd94..8b788df4 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotclass.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotclass.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ type volumeSnapshotClasses struct { } // newVolumeSnapshotClasses returns a VolumeSnapshotClasses -func newVolumeSnapshotClasses(c *VolumesnapshotV1alpha1Client) *volumeSnapshotClasses { +func newVolumeSnapshotClasses(c *SnapshotV1alpha1Client) *volumeSnapshotClasses { return &volumeSnapshotClasses{ client: c.RESTClient(), } diff --git a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotcontent.go b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotcontent.go index 11aac515..e393ccdf 100644 --- a/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotcontent.go +++ b/pkg/client/clientset/versioned/typed/volumesnapshot/v1alpha1/volumesnapshotcontent.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ type volumeSnapshotContents struct { } // newVolumeSnapshotContents returns a VolumeSnapshotContents -func newVolumeSnapshotContents(c *VolumesnapshotV1alpha1Client) *volumeSnapshotContents { +func newVolumeSnapshotContents(c *SnapshotV1alpha1Client) *volumeSnapshotContents { return &volumeSnapshotContents{ client: c.RESTClient(), } diff --git a/pkg/client/informers/externalversions/factory.go b/pkg/client/informers/externalversions/factory.go index 0a478827..f01d7993 100644 --- a/pkg/client/informers/externalversions/factory.go +++ b/pkg/client/informers/externalversions/factory.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -172,9 +172,9 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool - Volumesnapshot() volumesnapshot.Interface + Snapshot() volumesnapshot.Interface } -func (f *sharedInformerFactory) Volumesnapshot() volumesnapshot.Interface { +func (f *sharedInformerFactory) Snapshot() volumesnapshot.Interface { return volumesnapshot.New(f, f.namespace, f.tweakListOptions) } diff --git a/pkg/client/informers/externalversions/generic.go b/pkg/client/informers/externalversions/generic.go index ff7e7d46..193942d0 100644 --- a/pkg/client/informers/externalversions/generic.go +++ b/pkg/client/informers/externalversions/generic.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -52,13 +52,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=volumesnapshot, Version=v1alpha1 + // Group=snapshot.storage.k8s.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("volumesnapshots"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Volumesnapshot().V1alpha1().VolumeSnapshots().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1alpha1().VolumeSnapshots().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("volumesnapshotclasses"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Volumesnapshot().V1alpha1().VolumeSnapshotClasses().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1alpha1().VolumeSnapshotClasses().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("volumesnapshotcontents"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Volumesnapshot().V1alpha1().VolumeSnapshotContents().Informer()}, nil + return &genericInformer{resource: resource.GroupResource(), informer: f.Snapshot().V1alpha1().VolumeSnapshotContents().Informer()}, nil } diff --git a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go index a11e57cd..daf0bfe8 100644 --- a/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/volumesnapshot/interface.go b/pkg/client/informers/externalversions/volumesnapshot/interface.go index 49bd322b..ba406ea9 100644 --- a/pkg/client/informers/externalversions/volumesnapshot/interface.go +++ b/pkg/client/informers/externalversions/volumesnapshot/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package volumesnapshot +package snapshot import ( internalinterfaces "github.com/kubernetes-csi/external-snapshotter/pkg/client/informers/externalversions/internalinterfaces" diff --git a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/interface.go b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/interface.go index 1a41d0c3..ded10e91 100644 --- a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/interface.go +++ b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/interface.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshot.go b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshot.go index c642e70f..babb79b8 100644 --- a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshot.go +++ b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshot.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -61,13 +61,13 @@ func NewFilteredVolumeSnapshotInformer(client versioned.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshots(namespace).List(options) + return client.SnapshotV1alpha1().VolumeSnapshots(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshots(namespace).Watch(options) + return client.SnapshotV1alpha1().VolumeSnapshots(namespace).Watch(options) }, }, &volumesnapshotv1alpha1.VolumeSnapshot{}, diff --git a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotclass.go b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotclass.go index d0b0fcc7..0026e557 100644 --- a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotclass.go +++ b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotclass.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -60,13 +60,13 @@ func NewFilteredVolumeSnapshotClassInformer(client versioned.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshotClasses().List(options) + return client.SnapshotV1alpha1().VolumeSnapshotClasses().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshotClasses().Watch(options) + return client.SnapshotV1alpha1().VolumeSnapshotClasses().Watch(options) }, }, &volumesnapshotv1alpha1.VolumeSnapshotClass{}, diff --git a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotcontent.go b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotcontent.go index 906aad46..2b34344d 100644 --- a/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotcontent.go +++ b/pkg/client/informers/externalversions/volumesnapshot/v1alpha1/volumesnapshotcontent.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -60,13 +60,13 @@ func NewFilteredVolumeSnapshotContentInformer(client versioned.Interface, resync if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshotContents().List(options) + return client.SnapshotV1alpha1().VolumeSnapshotContents().List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.VolumesnapshotV1alpha1().VolumeSnapshotContents().Watch(options) + return client.SnapshotV1alpha1().VolumeSnapshotContents().Watch(options) }, }, &volumesnapshotv1alpha1.VolumeSnapshotContent{}, diff --git a/pkg/client/listers/volumesnapshot/v1alpha1/expansion_generated.go b/pkg/client/listers/volumesnapshot/v1alpha1/expansion_generated.go index 15740671..f92624ed 100644 --- a/pkg/client/listers/volumesnapshot/v1alpha1/expansion_generated.go +++ b/pkg/client/listers/volumesnapshot/v1alpha1/expansion_generated.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshot.go b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshot.go index 4cc5cdc5..ffa8f16d 100644 --- a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshot.go +++ b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshot.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotclass.go b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotclass.go index bcb5cd65..505d397b 100644 --- a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotclass.go +++ b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotclass.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotcontent.go b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotcontent.go index b12fdb55..97d4e90a 100644 --- a/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotcontent.go +++ b/pkg/client/listers/volumesnapshot/v1alpha1/volumesnapshotcontent.go @@ -1,5 +1,5 @@ /* -Copyright 2018 The Kubernetes Authors. +Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/pkg/controller/framework_test.go b/pkg/controller/framework_test.go index 7c693555..a197d82c 100644 --- a/pkg/controller/framework_test.go +++ b/pkg/controller/framework_test.go @@ -766,9 +766,9 @@ func newTestController(kubeClient kubernetes.Interface, clientset clientset.Inte clientset, kubeClient, mockDriverName, - informerFactory.Volumesnapshot().V1alpha1().VolumeSnapshots(), - informerFactory.Volumesnapshot().V1alpha1().VolumeSnapshotContents(), - informerFactory.Volumesnapshot().V1alpha1().VolumeSnapshotClasses(), + informerFactory.Snapshot().V1alpha1().VolumeSnapshots(), + informerFactory.Snapshot().V1alpha1().VolumeSnapshotContents(), + informerFactory.Snapshot().V1alpha1().VolumeSnapshotClasses(), coreFactory.Core().V1().PersistentVolumeClaims(), 3, 5*time.Millisecond, diff --git a/pkg/controller/snapshot_controller.go b/pkg/controller/snapshot_controller.go index 4395e55f..3085e759 100644 --- a/pkg/controller/snapshot_controller.go +++ b/pkg/controller/snapshot_controller.go @@ -424,7 +424,7 @@ func (ctrl *csiSnapshotController) updateSnapshotErrorStatusWithEvent(snapshot * snapshotClone.Status.Error = statusError snapshotClone.Status.ReadyToUse = false - newSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) + newSnapshot, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) if err != nil { klog.V(4).Infof("updating VolumeSnapshot[%s] error status failed %v", snapshotKey(snapshot), err) return err @@ -458,7 +458,7 @@ func IsSnapshotBound(snapshot *crdv1.VolumeSnapshot, content *crdv1.VolumeSnapsh // isSnapshotConentBeingUsed checks if snapshot content is bound to snapshot. func (ctrl *csiSnapshotController) isSnapshotContentBeingUsed(content *crdv1.VolumeSnapshotContent) bool { if content.Spec.VolumeSnapshotRef != nil { - snapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(content.Spec.VolumeSnapshotRef.Namespace).Get(content.Spec.VolumeSnapshotRef.Name, metav1.GetOptions{}) + snapshotObj, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(content.Spec.VolumeSnapshotRef.Namespace).Get(content.Spec.VolumeSnapshotRef.Name, metav1.GetOptions{}) if err != nil { klog.Infof("isSnapshotContentBeingUsed: Cannot get snapshot %s from api server: [%v]. VolumeSnapshot object may be deleted already.", content.Spec.VolumeSnapshotRef.Name, err) return false @@ -510,7 +510,7 @@ func (ctrl *csiSnapshotController) checkandBindSnapshotContent(snapshot *crdv1.V contentClone.Spec.VolumeSnapshotRef.UID = snapshot.UID className := *(snapshot.Spec.VolumeSnapshotClassName) contentClone.Spec.VolumeSnapshotClassName = &className - newContent, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) + newContent, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) if err != nil { klog.V(4).Infof("updating VolumeSnapshotContent[%s] error status failed %v", newContent.Name, err) return nil, err @@ -691,7 +691,7 @@ func (ctrl *csiSnapshotController) createSnapshotOperation(snapshot *crdv1.Volum // Try to create the VolumeSnapshotContent object several times for i := 0; i < ctrl.createSnapshotContentRetryCount; i++ { klog.V(5).Infof("createSnapshot [%s]: trying to save volume snapshot content %s", snapshotKey(snapshot), snapshotContent.Name) - if _, err = ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Create(snapshotContent); err == nil || apierrs.IsAlreadyExists(err) { + if _, err = ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Create(snapshotContent); err == nil || apierrs.IsAlreadyExists(err) { // Save succeeded. if err != nil { klog.V(3).Infof("volume snapshot content %q for snapshot %q already exists, reusing", snapshotContent.Name, snapshotKey(snapshot)) @@ -758,7 +758,7 @@ func (ctrl *csiSnapshotController) deleteSnapshotContentOperation(content *crdv1 return fmt.Errorf("failed to delete snapshot %#v, err: %v", content.Name, err) } - err = ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Delete(content.Name, &metav1.DeleteOptions{}) + err = ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Delete(content.Name, &metav1.DeleteOptions{}) if err != nil { ctrl.eventRecorder.Event(content, v1.EventTypeWarning, "SnapshotContentObjectDeleteError", "Failed to delete snapshot content API object") return fmt.Errorf("failed to delete VolumeSnapshotContent %s from API server: %q", content.Name, err) @@ -769,7 +769,7 @@ func (ctrl *csiSnapshotController) deleteSnapshotContentOperation(content *crdv1 func (ctrl *csiSnapshotController) bindandUpdateVolumeSnapshot(snapshotContent *crdv1.VolumeSnapshotContent, snapshot *crdv1.VolumeSnapshot) (*crdv1.VolumeSnapshot, error) { klog.V(5).Infof("bindandUpdateVolumeSnapshot for snapshot [%s]: snapshotContent [%s]", snapshot.Name, snapshotContent.Name) - snapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshot.Namespace).Get(snapshot.Name, metav1.GetOptions{}) + snapshotObj, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshot.Namespace).Get(snapshot.Name, metav1.GetOptions{}) if err != nil { return nil, fmt.Errorf("error get snapshot %s from api server: %v", snapshotKey(snapshot), err) } @@ -782,7 +782,7 @@ func (ctrl *csiSnapshotController) bindandUpdateVolumeSnapshot(snapshotContent * } else { klog.Infof("bindVolumeSnapshotContentToVolumeSnapshot: before bind VolumeSnapshot %s to volumeSnapshotContent [%s]", snapshot.Name, snapshotContent.Name) snapshotCopy.Spec.SnapshotContentName = snapshotContent.Name - updateSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshot.Namespace).Update(snapshotCopy) + updateSnapshot, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshot.Namespace).Update(snapshotCopy) if err != nil { klog.Infof("bindVolumeSnapshotContentToVolumeSnapshot: Error binding VolumeSnapshot %s to volumeSnapshotContent [%s]. Error [%#v]", snapshot.Name, snapshotContent.Name, err) return nil, newControllerUpdateError(snapshotKey(snapshot), err.Error()) @@ -808,7 +808,7 @@ func (ctrl *csiSnapshotController) updateSnapshotContentSize(content *crdv1.Volu } contentClone := content.DeepCopy() contentClone.Spec.VolumeSnapshotSource.CSI.RestoreSize = &size - _, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) + _, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) if err != nil { return newControllerUpdateError(content.Name, err.Error()) } @@ -848,7 +848,7 @@ func (ctrl *csiSnapshotController) updateSnapshotStatus(snapshot *crdv1.VolumeSn status.RestoreSize = resource.NewQuantity(size, resource.BinarySI) } snapshotClone.Status = status - newSnapshotObj, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) + newSnapshotObj, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) if err != nil { return nil, newControllerUpdateError(snapshotKey(snapshot), err.Error()) } @@ -949,7 +949,7 @@ func (ctrl *csiSnapshotController) SetDefaultSnapshotClass(snapshot *crdv1.Volum klog.V(5).Infof("setDefaultSnapshotClass [%s]: default VolumeSnapshotClassName [%s]", snapshot.Name, defaultClasses[0].Name) snapshotClone := snapshot.DeepCopy() snapshotClone.Spec.VolumeSnapshotClassName = &(defaultClasses[0].Name) - newSnapshot, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) + newSnapshot, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) if err != nil { klog.V(4).Infof("updating VolumeSnapshot[%s] default class failed %v", snapshotKey(snapshot), err) } @@ -1016,7 +1016,7 @@ func (ctrl *csiSnapshotController) addContentFinalizer(content *crdv1.VolumeSnap contentClone := content.DeepCopy() contentClone.ObjectMeta.Finalizers = append(contentClone.ObjectMeta.Finalizers, VolumeSnapshotContentFinalizer) - _, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) + _, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) if err != nil { return newControllerUpdateError(content.Name, err.Error()) } @@ -1035,7 +1035,7 @@ func (ctrl *csiSnapshotController) removeContentFinalizer(content *crdv1.VolumeS contentClone := content.DeepCopy() contentClone.ObjectMeta.Finalizers = slice.RemoveString(contentClone.ObjectMeta.Finalizers, VolumeSnapshotContentFinalizer, nil) - _, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) + _, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshotContents().Update(contentClone) if err != nil { return newControllerUpdateError(content.Name, err.Error()) } @@ -1053,7 +1053,7 @@ func (ctrl *csiSnapshotController) removeContentFinalizer(content *crdv1.VolumeS func (ctrl *csiSnapshotController) addSnapshotFinalizer(snapshot *crdv1.VolumeSnapshot) error { snapshotClone := snapshot.DeepCopy() snapshotClone.ObjectMeta.Finalizers = append(snapshotClone.ObjectMeta.Finalizers, VolumeSnapshotFinalizer) - _, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) + _, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) if err != nil { return newControllerUpdateError(snapshot.Name, err.Error()) } @@ -1072,7 +1072,7 @@ func (ctrl *csiSnapshotController) removeSnapshotFinalizer(snapshot *crdv1.Volum snapshotClone := snapshot.DeepCopy() snapshotClone.ObjectMeta.Finalizers = slice.RemoveString(snapshotClone.ObjectMeta.Finalizers, VolumeSnapshotFinalizer, nil) - _, err := ctrl.clientset.VolumesnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) + _, err := ctrl.clientset.SnapshotV1alpha1().VolumeSnapshots(snapshotClone.Namespace).Update(snapshotClone) if err != nil { return newControllerUpdateError(snapshot.Name, err.Error()) }