From f6421c8b43ab1d1000010439633bb43aebadba90 Mon Sep 17 00:00:00 2001 From: buffalo1024 Date: Mon, 29 Jan 2024 16:10:34 +0800 Subject: [PATCH] use hwameistor v0.14.1 Signed-off-by: buffalo1024 --- go.mod | 2 +- go.sum | 4 +- helm/operator/values.yaml | 26 +-- pkg/install/constants.go | 2 +- .../v1alpha1/generated_expansion.go | 4 + .../hwameistor/v1alpha1/hwameistor_client.go | 10 + .../v1alpha1/localvolumesnapshot.go | 179 ++++++++++++++++++ .../v1alpha1/localvolumesnapshotrestore.go | 179 ++++++++++++++++++ .../hwameistor/v1alpha1/interface.go | 14 ++ .../v1alpha1/localvolumesnapshot.go | 74 ++++++++ .../v1alpha1/localvolumesnapshotrestore.go | 74 ++++++++ .../v1alpha1/expansion_generated.go | 16 ++ .../v1alpha1/localvolumesnapshot.go | 78 ++++++++ .../v1alpha1/localvolumesnapshotrestore.go | 78 ++++++++ .../v1alpha1/localvolumesnapshot_types.go | 1 + .../localvolumesnapshotrestore_types.go | 1 + vendor/modules.txt | 2 +- 17 files changed, 726 insertions(+), 18 deletions(-) create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshot.go create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshotrestore.go create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshot.go create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshotrestore.go create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshot.go create mode 100644 vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshotrestore.go diff --git a/go.mod b/go.mod index 73356940..3b2cce85 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/uuid v1.1.2 // indirect - github.com/hwameistor/hwameistor v0.14.0 + github.com/hwameistor/hwameistor v0.14.1 github.com/imdario/mergo v0.3.12 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect diff --git a/go.sum b/go.sum index b6de1b74..6b4ba42f 100644 --- a/go.sum +++ b/go.sum @@ -282,8 +282,8 @@ github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0m github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/hwameistor/hwameistor v0.14.0 h1:urD/Y4t18uWGDAr/wjRqSu7fKnlnOBsT3Deei0x7rJ0= -github.com/hwameistor/hwameistor v0.14.0/go.mod h1:uuYPiN78aba8NgqQ2Wv35phP33VKIJ1YCOS8K5koJ/k= +github.com/hwameistor/hwameistor v0.14.1 h1:IChDIYnjx6y8RgUvjgIoY6ki+yX4Lwn5Ryjjd2x0tDM= +github.com/hwameistor/hwameistor v0.14.1/go.mod h1:uuYPiN78aba8NgqQ2Wv35phP33VKIJ1YCOS8K5koJ/k= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= diff --git a/helm/operator/values.yaml b/helm/operator/values.yaml index 256e5f59..bafbadc9 100644 --- a/helm/operator/values.yaml +++ b/helm/operator/values.yaml @@ -5,7 +5,7 @@ global: #hwameistorImageRegistry: ghcr.m.daocloud.io k8sImageRegistry: registry.k8s.io # k8sImageRegistry: m.daocloud.io/registry.k8s.io - hwameistorVersion: v0.14.0 + hwameistorVersion: v0.14.1 operator: replicas: 1 @@ -17,7 +17,7 @@ localDiskManager: kubeletRootDir: /var/lib/kubelet manager: imageRepository: hwameistor/local-disk-manager - tag: v0.14.0 + tag: v0.14.1 csi: registrar: imageRepository: sig-storage/csi-node-driver-registrar @@ -37,7 +37,7 @@ localStorage: kubeletRootDir: /var/lib/kubelet member: imageRepository: hwameistor/local-storage - tag: v0.14.0 + tag: v0.14.1 hostPathSSHDir: /root/.ssh hostPathDRBDDir: /etc/drbd.d csi: @@ -78,13 +78,13 @@ scheduler: disable: false replicas: 1 imageRepository: hwameistor/scheduler - tag: v0.14.0 + tag: v0.14.1 admission: disable: false replicas: 1 imageRepository: hwameistor/admission - tag: v0.14.0 + tag: v0.14.1 # failurePolicy defines how unrecognized errors from the admission endpoint # are handled - allowed values are Ignore or Fail. Defaults to Fail. failurePolicy: "Ignore" @@ -93,13 +93,13 @@ evictor: disable: true replicas: 0 imageRepository: hwameistor/evictor - tag: v0.14.0 + tag: v0.14.1 apiserver: disable: false replicas: 1 imageRepository: hwameistor/apiserver - tag: v0.14.0 + tag: v0.14.1 authentication: enable: false accessId: admin @@ -109,37 +109,37 @@ exporter: disable: false replicas: 1 imageRepository: hwameistor/exporter - tag: v0.14.0 + tag: v0.14.1 auditor: disable: false replicas: 1 imageRepository: hwameistor/auditor - tag: v0.14.0 + tag: v0.14.1 failoverAssistant: disable: false replicas: 1 imageRepository: hwameistor/failover-assistant - tag: v0.14.0 + tag: v0.14.1 pvcAutoResizer: disable: false replicas: 1 imageRepository: hwameistor/pvc-autoresizer - tag: v0.14.0 + tag: v0.14.1 localDiskActionController: disable: false replicas: 1 imageRepository: hwameistor/local-disk-action-controller - tag: v0.14.0 + tag: v0.14.1 ui: disable: false replicas: 1 imageRepository: hwameistor/hwameistor-ui - tag: v0.15.0 + tag: v0.15.1 ha: disable: false diff --git a/pkg/install/constants.go b/pkg/install/constants.go index 8caa15b8..cfe539dd 100644 --- a/pkg/install/constants.go +++ b/pkg/install/constants.go @@ -1,3 +1,3 @@ package install -const DefaultHwameistorVersion = "v0.14.0" \ No newline at end of file +const DefaultHwameistorVersion = "v0.14.1" \ No newline at end of file diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go index 7140fec9..23bfe108 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/generated_expansion.go @@ -27,3 +27,7 @@ type LocalVolumeGroupExpansion interface{} type LocalVolumeMigrateExpansion interface{} type LocalVolumeReplicaExpansion interface{} + +type LocalVolumeSnapshotExpansion interface{} + +type LocalVolumeSnapshotRestoreExpansion interface{} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go index 7e361a09..a84a3515 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/hwameistor_client.go @@ -23,6 +23,8 @@ type HwameistorV1alpha1Interface interface { LocalVolumeGroupsGetter LocalVolumeMigratesGetter LocalVolumeReplicasGetter + LocalVolumeSnapshotsGetter + LocalVolumeSnapshotRestoresGetter } // HwameistorV1alpha1Client is used to interact with features provided by the hwameistor.io group. @@ -82,6 +84,14 @@ func (c *HwameistorV1alpha1Client) LocalVolumeReplicas() LocalVolumeReplicaInter return newLocalVolumeReplicas(c) } +func (c *HwameistorV1alpha1Client) LocalVolumeSnapshots(namespace string) LocalVolumeSnapshotInterface { + return newLocalVolumeSnapshots(c, namespace) +} + +func (c *HwameistorV1alpha1Client) LocalVolumeSnapshotRestores(namespace string) LocalVolumeSnapshotRestoreInterface { + return newLocalVolumeSnapshotRestores(c, namespace) +} + // NewForConfig creates a new HwameistorV1alpha1Client for the given config. func NewForConfig(c *rest.Config) (*HwameistorV1alpha1Client, error) { config := *c diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshot.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshot.go new file mode 100644 index 00000000..ad26e52f --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshot.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + scheme "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/scheme" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// LocalVolumeSnapshotsGetter has a method to return a LocalVolumeSnapshotInterface. +// A group's client should implement this interface. +type LocalVolumeSnapshotsGetter interface { + LocalVolumeSnapshots(namespace string) LocalVolumeSnapshotInterface +} + +// LocalVolumeSnapshotInterface has methods to work with LocalVolumeSnapshot resources. +type LocalVolumeSnapshotInterface interface { + Create(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.CreateOptions) (*v1alpha1.LocalVolumeSnapshot, error) + Update(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.UpdateOptions) (*v1alpha1.LocalVolumeSnapshot, error) + UpdateStatus(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.UpdateOptions) (*v1alpha1.LocalVolumeSnapshot, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LocalVolumeSnapshot, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LocalVolumeSnapshotList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalVolumeSnapshot, err error) + LocalVolumeSnapshotExpansion +} + +// localVolumeSnapshots implements LocalVolumeSnapshotInterface +type localVolumeSnapshots struct { + client rest.Interface + ns string +} + +// newLocalVolumeSnapshots returns a LocalVolumeSnapshots +func newLocalVolumeSnapshots(c *HwameistorV1alpha1Client, namespace string) *localVolumeSnapshots { + return &localVolumeSnapshots{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the localVolumeSnapshot, and returns the corresponding localVolumeSnapshot object, and an error if there is any. +func (c *localVolumeSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalVolumeSnapshot, err error) { + result = &v1alpha1.LocalVolumeSnapshot{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalVolumeSnapshots that match those selectors. +func (c *localVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalVolumeSnapshotList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.LocalVolumeSnapshotList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localVolumeSnapshots. +func (c *localVolumeSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localVolumeSnapshot and creates it. Returns the server's representation of the localVolumeSnapshot, and an error, if there is any. +func (c *localVolumeSnapshots) Create(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.CreateOptions) (result *v1alpha1.LocalVolumeSnapshot, err error) { + result = &v1alpha1.LocalVolumeSnapshot{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshot). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localVolumeSnapshot and updates it. Returns the server's representation of the localVolumeSnapshot, and an error, if there is any. +func (c *localVolumeSnapshots) Update(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.UpdateOptions) (result *v1alpha1.LocalVolumeSnapshot, err error) { + result = &v1alpha1.LocalVolumeSnapshot{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + Name(localVolumeSnapshot.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshot). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *localVolumeSnapshots) UpdateStatus(ctx context.Context, localVolumeSnapshot *v1alpha1.LocalVolumeSnapshot, opts v1.UpdateOptions) (result *v1alpha1.LocalVolumeSnapshot, err error) { + result = &v1alpha1.LocalVolumeSnapshot{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + Name(localVolumeSnapshot.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshot). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localVolumeSnapshot and deletes it. Returns an error if one occurs. +func (c *localVolumeSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localVolumeSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("localvolumesnapshots"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localVolumeSnapshot. +func (c *localVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalVolumeSnapshot, err error) { + result = &v1alpha1.LocalVolumeSnapshot{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("localvolumesnapshots"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshotrestore.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshotrestore.go new file mode 100644 index 00000000..a0c96e86 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/typed/hwameistor/v1alpha1/localvolumesnapshotrestore.go @@ -0,0 +1,179 @@ +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + scheme "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned/scheme" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// LocalVolumeSnapshotRestoresGetter has a method to return a LocalVolumeSnapshotRestoreInterface. +// A group's client should implement this interface. +type LocalVolumeSnapshotRestoresGetter interface { + LocalVolumeSnapshotRestores(namespace string) LocalVolumeSnapshotRestoreInterface +} + +// LocalVolumeSnapshotRestoreInterface has methods to work with LocalVolumeSnapshotRestore resources. +type LocalVolumeSnapshotRestoreInterface interface { + Create(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.CreateOptions) (*v1alpha1.LocalVolumeSnapshotRestore, error) + Update(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.UpdateOptions) (*v1alpha1.LocalVolumeSnapshotRestore, error) + UpdateStatus(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.UpdateOptions) (*v1alpha1.LocalVolumeSnapshotRestore, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.LocalVolumeSnapshotRestore, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.LocalVolumeSnapshotRestoreList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) + LocalVolumeSnapshotRestoreExpansion +} + +// localVolumeSnapshotRestores implements LocalVolumeSnapshotRestoreInterface +type localVolumeSnapshotRestores struct { + client rest.Interface + ns string +} + +// newLocalVolumeSnapshotRestores returns a LocalVolumeSnapshotRestores +func newLocalVolumeSnapshotRestores(c *HwameistorV1alpha1Client, namespace string) *localVolumeSnapshotRestores { + return &localVolumeSnapshotRestores{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the localVolumeSnapshotRestore, and returns the corresponding localVolumeSnapshotRestore object, and an error if there is any. +func (c *localVolumeSnapshotRestores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) { + result = &v1alpha1.LocalVolumeSnapshotRestore{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalVolumeSnapshotRestores that match those selectors. +func (c *localVolumeSnapshotRestores) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.LocalVolumeSnapshotRestoreList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.LocalVolumeSnapshotRestoreList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localVolumeSnapshotRestores. +func (c *localVolumeSnapshotRestores) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localVolumeSnapshotRestore and creates it. Returns the server's representation of the localVolumeSnapshotRestore, and an error, if there is any. +func (c *localVolumeSnapshotRestores) Create(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.CreateOptions) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) { + result = &v1alpha1.LocalVolumeSnapshotRestore{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshotRestore). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localVolumeSnapshotRestore and updates it. Returns the server's representation of the localVolumeSnapshotRestore, and an error, if there is any. +func (c *localVolumeSnapshotRestores) Update(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.UpdateOptions) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) { + result = &v1alpha1.LocalVolumeSnapshotRestore{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + Name(localVolumeSnapshotRestore.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshotRestore). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *localVolumeSnapshotRestores) UpdateStatus(ctx context.Context, localVolumeSnapshotRestore *v1alpha1.LocalVolumeSnapshotRestore, opts v1.UpdateOptions) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) { + result = &v1alpha1.LocalVolumeSnapshotRestore{} + err = c.client.Put(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + Name(localVolumeSnapshotRestore.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localVolumeSnapshotRestore). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localVolumeSnapshotRestore and deletes it. Returns an error if one occurs. +func (c *localVolumeSnapshotRestores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localVolumeSnapshotRestores) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localVolumeSnapshotRestore. +func (c *localVolumeSnapshotRestores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.LocalVolumeSnapshotRestore, err error) { + result = &v1alpha1.LocalVolumeSnapshotRestore{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("localvolumesnapshotrestores"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go index 81ec3076..a6d3ee0d 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/interface.go @@ -34,6 +34,10 @@ type Interface interface { LocalVolumeMigrates() LocalVolumeMigrateInformer // LocalVolumeReplicas returns a LocalVolumeReplicaInformer. LocalVolumeReplicas() LocalVolumeReplicaInformer + // LocalVolumeSnapshots returns a LocalVolumeSnapshotInformer. + LocalVolumeSnapshots() LocalVolumeSnapshotInformer + // LocalVolumeSnapshotRestores returns a LocalVolumeSnapshotRestoreInformer. + LocalVolumeSnapshotRestores() LocalVolumeSnapshotRestoreInformer } type version struct { @@ -111,3 +115,13 @@ func (v *version) LocalVolumeMigrates() LocalVolumeMigrateInformer { func (v *version) LocalVolumeReplicas() LocalVolumeReplicaInformer { return &localVolumeReplicaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// LocalVolumeSnapshots returns a LocalVolumeSnapshotInformer. +func (v *version) LocalVolumeSnapshots() LocalVolumeSnapshotInformer { + return &localVolumeSnapshotInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// LocalVolumeSnapshotRestores returns a LocalVolumeSnapshotRestoreInformer. +func (v *version) LocalVolumeSnapshotRestores() LocalVolumeSnapshotRestoreInformer { + return &localVolumeSnapshotRestoreInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshot.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshot.go new file mode 100644 index 00000000..22e8e6db --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshot.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + versioned "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned" + internalinterfaces "github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1" + hwameistorv1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalVolumeSnapshotInformer provides access to a shared informer and lister for +// LocalVolumeSnapshots. +type LocalVolumeSnapshotInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.LocalVolumeSnapshotLister +} + +type localVolumeSnapshotInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewLocalVolumeSnapshotInformer constructs a new informer for LocalVolumeSnapshot type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalVolumeSnapshotInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalVolumeSnapshotInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalVolumeSnapshotInformer constructs a new informer for LocalVolumeSnapshot type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalVolumeSnapshotInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().LocalVolumeSnapshots(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().LocalVolumeSnapshots(namespace).Watch(context.TODO(), options) + }, + }, + &hwameistorv1alpha1.LocalVolumeSnapshot{}, + resyncPeriod, + indexers, + ) +} + +func (f *localVolumeSnapshotInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalVolumeSnapshotInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localVolumeSnapshotInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&hwameistorv1alpha1.LocalVolumeSnapshot{}, f.defaultInformer) +} + +func (f *localVolumeSnapshotInformer) Lister() v1alpha1.LocalVolumeSnapshotLister { + return v1alpha1.NewLocalVolumeSnapshotLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshotrestore.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshotrestore.go new file mode 100644 index 00000000..47f01d7c --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/hwameistor/v1alpha1/localvolumesnapshotrestore.go @@ -0,0 +1,74 @@ +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + versioned "github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned" + internalinterfaces "github.com/hwameistor/hwameistor/pkg/apis/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1" + hwameistorv1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" +) + +// LocalVolumeSnapshotRestoreInformer provides access to a shared informer and lister for +// LocalVolumeSnapshotRestores. +type LocalVolumeSnapshotRestoreInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.LocalVolumeSnapshotRestoreLister +} + +type localVolumeSnapshotRestoreInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewLocalVolumeSnapshotRestoreInformer constructs a new informer for LocalVolumeSnapshotRestore type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewLocalVolumeSnapshotRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredLocalVolumeSnapshotRestoreInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredLocalVolumeSnapshotRestoreInformer constructs a new informer for LocalVolumeSnapshotRestore type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredLocalVolumeSnapshotRestoreInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().LocalVolumeSnapshotRestores(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.HwameistorV1alpha1().LocalVolumeSnapshotRestores(namespace).Watch(context.TODO(), options) + }, + }, + &hwameistorv1alpha1.LocalVolumeSnapshotRestore{}, + resyncPeriod, + indexers, + ) +} + +func (f *localVolumeSnapshotRestoreInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredLocalVolumeSnapshotRestoreInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *localVolumeSnapshotRestoreInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&hwameistorv1alpha1.LocalVolumeSnapshotRestore{}, f.defaultInformer) +} + +func (f *localVolumeSnapshotRestoreInformer) Lister() v1alpha1.LocalVolumeSnapshotRestoreLister { + return v1alpha1.NewLocalVolumeSnapshotRestoreLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go index 4f8728d5..d532533f 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/expansion_generated.go @@ -53,3 +53,19 @@ type LocalVolumeMigrateListerExpansion interface{} // LocalVolumeReplicaListerExpansion allows custom methods to be added to // LocalVolumeReplicaLister. type LocalVolumeReplicaListerExpansion interface{} + +// LocalVolumeSnapshotListerExpansion allows custom methods to be added to +// LocalVolumeSnapshotLister. +type LocalVolumeSnapshotListerExpansion interface{} + +// LocalVolumeSnapshotNamespaceListerExpansion allows custom methods to be added to +// LocalVolumeSnapshotNamespaceLister. +type LocalVolumeSnapshotNamespaceListerExpansion interface{} + +// LocalVolumeSnapshotRestoreListerExpansion allows custom methods to be added to +// LocalVolumeSnapshotRestoreLister. +type LocalVolumeSnapshotRestoreListerExpansion interface{} + +// LocalVolumeSnapshotRestoreNamespaceListerExpansion allows custom methods to be added to +// LocalVolumeSnapshotRestoreNamespaceLister. +type LocalVolumeSnapshotRestoreNamespaceListerExpansion interface{} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshot.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshot.go new file mode 100644 index 00000000..80601559 --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshot.go @@ -0,0 +1,78 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalVolumeSnapshotLister helps list LocalVolumeSnapshots. +type LocalVolumeSnapshotLister interface { + // List lists all LocalVolumeSnapshots in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshot, err error) + // LocalVolumeSnapshots returns an object that can list and get LocalVolumeSnapshots. + LocalVolumeSnapshots(namespace string) LocalVolumeSnapshotNamespaceLister + LocalVolumeSnapshotListerExpansion +} + +// localVolumeSnapshotLister implements the LocalVolumeSnapshotLister interface. +type localVolumeSnapshotLister struct { + indexer cache.Indexer +} + +// NewLocalVolumeSnapshotLister returns a new LocalVolumeSnapshotLister. +func NewLocalVolumeSnapshotLister(indexer cache.Indexer) LocalVolumeSnapshotLister { + return &localVolumeSnapshotLister{indexer: indexer} +} + +// List lists all LocalVolumeSnapshots in the indexer. +func (s *localVolumeSnapshotLister) List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshot, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalVolumeSnapshot)) + }) + return ret, err +} + +// LocalVolumeSnapshots returns an object that can list and get LocalVolumeSnapshots. +func (s *localVolumeSnapshotLister) LocalVolumeSnapshots(namespace string) LocalVolumeSnapshotNamespaceLister { + return localVolumeSnapshotNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// LocalVolumeSnapshotNamespaceLister helps list and get LocalVolumeSnapshots. +type LocalVolumeSnapshotNamespaceLister interface { + // List lists all LocalVolumeSnapshots in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshot, err error) + // Get retrieves the LocalVolumeSnapshot from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.LocalVolumeSnapshot, error) + LocalVolumeSnapshotNamespaceListerExpansion +} + +// localVolumeSnapshotNamespaceLister implements the LocalVolumeSnapshotNamespaceLister +// interface. +type localVolumeSnapshotNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all LocalVolumeSnapshots in the indexer for a given namespace. +func (s localVolumeSnapshotNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshot, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalVolumeSnapshot)) + }) + return ret, err +} + +// Get retrieves the LocalVolumeSnapshot from the indexer for a given namespace and name. +func (s localVolumeSnapshotNamespaceLister) Get(name string) (*v1alpha1.LocalVolumeSnapshot, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("localvolumesnapshot"), name) + } + return obj.(*v1alpha1.LocalVolumeSnapshot), nil +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshotrestore.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshotrestore.go new file mode 100644 index 00000000..21dc275c --- /dev/null +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/client/listers/hwameistor/v1alpha1/localvolumesnapshotrestore.go @@ -0,0 +1,78 @@ +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// LocalVolumeSnapshotRestoreLister helps list LocalVolumeSnapshotRestores. +type LocalVolumeSnapshotRestoreLister interface { + // List lists all LocalVolumeSnapshotRestores in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshotRestore, err error) + // LocalVolumeSnapshotRestores returns an object that can list and get LocalVolumeSnapshotRestores. + LocalVolumeSnapshotRestores(namespace string) LocalVolumeSnapshotRestoreNamespaceLister + LocalVolumeSnapshotRestoreListerExpansion +} + +// localVolumeSnapshotRestoreLister implements the LocalVolumeSnapshotRestoreLister interface. +type localVolumeSnapshotRestoreLister struct { + indexer cache.Indexer +} + +// NewLocalVolumeSnapshotRestoreLister returns a new LocalVolumeSnapshotRestoreLister. +func NewLocalVolumeSnapshotRestoreLister(indexer cache.Indexer) LocalVolumeSnapshotRestoreLister { + return &localVolumeSnapshotRestoreLister{indexer: indexer} +} + +// List lists all LocalVolumeSnapshotRestores in the indexer. +func (s *localVolumeSnapshotRestoreLister) List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshotRestore, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalVolumeSnapshotRestore)) + }) + return ret, err +} + +// LocalVolumeSnapshotRestores returns an object that can list and get LocalVolumeSnapshotRestores. +func (s *localVolumeSnapshotRestoreLister) LocalVolumeSnapshotRestores(namespace string) LocalVolumeSnapshotRestoreNamespaceLister { + return localVolumeSnapshotRestoreNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// LocalVolumeSnapshotRestoreNamespaceLister helps list and get LocalVolumeSnapshotRestores. +type LocalVolumeSnapshotRestoreNamespaceLister interface { + // List lists all LocalVolumeSnapshotRestores in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshotRestore, err error) + // Get retrieves the LocalVolumeSnapshotRestore from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.LocalVolumeSnapshotRestore, error) + LocalVolumeSnapshotRestoreNamespaceListerExpansion +} + +// localVolumeSnapshotRestoreNamespaceLister implements the LocalVolumeSnapshotRestoreNamespaceLister +// interface. +type localVolumeSnapshotRestoreNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all LocalVolumeSnapshotRestores in the indexer for a given namespace. +func (s localVolumeSnapshotRestoreNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.LocalVolumeSnapshotRestore, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.LocalVolumeSnapshotRestore)) + }) + return ret, err +} + +// Get retrieves the LocalVolumeSnapshotRestore from the indexer for a given namespace and name. +func (s localVolumeSnapshotRestoreNamespaceLister) Get(name string) (*v1alpha1.LocalVolumeSnapshotRestore, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("localvolumesnapshotrestore"), name) + } + return obj.(*v1alpha1.LocalVolumeSnapshotRestore), nil +} diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go index 12153ad4..1d0cedd9 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshot_types.go @@ -52,6 +52,7 @@ type LocalVolumeSnapshotStatus struct { Message string `json:"message,omitempty"` } +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalVolumeSnapshot is a user's request for either creating a point-in-time diff --git a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrestore_types.go b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrestore_types.go index 6d9597c0..bf3f5f4b 100644 --- a/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrestore_types.go +++ b/vendor/github.com/hwameistor/hwameistor/pkg/apis/hwameistor/v1alpha1/localvolumesnapshotrestore_types.go @@ -47,6 +47,7 @@ type LocalVolumeSnapshotRestoreStatus struct { Message string `json:"message,omitempty"` } +// +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // LocalVolumeSnapshotRestore is a user's request for either restoring a local volume snapshot to a new volume, or merging into the old volume. diff --git a/vendor/modules.txt b/vendor/modules.txt index 96905e1d..60655e40 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -97,7 +97,7 @@ github.com/google/gofuzz # github.com/google/uuid v1.1.2 ## explicit github.com/google/uuid -# github.com/hwameistor/hwameistor v0.14.0 +# github.com/hwameistor/hwameistor v0.14.1 ## explicit; go 1.18 github.com/hwameistor/hwameistor/deploy/crds github.com/hwameistor/hwameistor/pkg/apis/client/clientset/versioned