feat(beta): autogen code for v1 CRDs

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan 2020-05-28 00:45:18 +05:30 committed by Kiran Mova
parent 472fd603ac
commit 1e23607d8a
22 changed files with 433 additions and 212 deletions

View file

@ -0,0 +1,221 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The OpenEBS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by deepcopy-gen. DO NOT EDIT.
package v1
import (
runtime "k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MountInfo) DeepCopyInto(out *MountInfo) {
*out = *in
if in.AccessModes != nil {
in, out := &in.AccessModes, &out.AccessModes
*out = make([]string, len(*in))
copy(*out, *in)
}
if in.MountOptions != nil {
in, out := &in.MountOptions, &out.MountOptions
*out = make([]string, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountInfo.
func (in *MountInfo) DeepCopy() *MountInfo {
if in == nil {
return nil
}
out := new(MountInfo)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SnapStatus) DeepCopyInto(out *SnapStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapStatus.
func (in *SnapStatus) DeepCopy() *SnapStatus {
if in == nil {
return nil
}
out := new(SnapStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolStatus) DeepCopyInto(out *VolStatus) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolStatus.
func (in *VolStatus) DeepCopy() *VolStatus {
if in == nil {
return nil
}
out := new(VolStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VolumeInfo) DeepCopyInto(out *VolumeInfo) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeInfo.
func (in *VolumeInfo) DeepCopy() *VolumeInfo {
if in == nil {
return nil
}
out := new(VolumeInfo)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ZFSSnapshot) DeepCopyInto(out *ZFSSnapshot) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZFSSnapshot.
func (in *ZFSSnapshot) DeepCopy() *ZFSSnapshot {
if in == nil {
return nil
}
out := new(ZFSSnapshot)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ZFSSnapshot) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ZFSSnapshotList) DeepCopyInto(out *ZFSSnapshotList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ZFSSnapshot, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZFSSnapshotList.
func (in *ZFSSnapshotList) DeepCopy() *ZFSSnapshotList {
if in == nil {
return nil
}
out := new(ZFSSnapshotList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ZFSSnapshotList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ZFSVolume) DeepCopyInto(out *ZFSVolume) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
out.Status = in.Status
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZFSVolume.
func (in *ZFSVolume) DeepCopy() *ZFSVolume {
if in == nil {
return nil
}
out := new(ZFSVolume)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ZFSVolume) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ZFSVolumeList) DeepCopyInto(out *ZFSVolumeList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ZFSVolume, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZFSVolumeList.
func (in *ZFSVolumeList) DeepCopy() *ZFSVolumeList {
if in == nil {
return nil
}
out := new(ZFSVolumeList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ZFSVolumeList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package internalclientset
import (
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
@ -27,19 +27,19 @@ import (
type Interface interface {
Discovery() discovery.DiscoveryInterface
ZfsV1alpha1() zfsv1alpha1.ZfsV1alpha1Interface
ZfsV1() zfsv1.ZfsV1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
zfsV1alpha1 *zfsv1alpha1.ZfsV1alpha1Client
zfsV1 *zfsv1.ZfsV1Client
}
// ZfsV1alpha1 retrieves the ZfsV1alpha1Client
func (c *Clientset) ZfsV1alpha1() zfsv1alpha1.ZfsV1alpha1Interface {
return c.zfsV1alpha1
// ZfsV1 retrieves the ZfsV1Client
func (c *Clientset) ZfsV1() zfsv1.ZfsV1Interface {
return c.zfsV1
}
// Discovery retrieves the DiscoveryClient
@ -58,7 +58,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) {
}
var cs Clientset
var err error
cs.zfsV1alpha1, err = zfsv1alpha1.NewForConfig(&configShallowCopy)
cs.zfsV1, err = zfsv1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
@ -74,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.zfsV1alpha1 = zfsv1alpha1.NewForConfigOrDie(c)
cs.zfsV1 = zfsv1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
@ -83,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.zfsV1alpha1 = zfsv1alpha1.New(c)
cs.zfsV1 = zfsv1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs

View file

@ -20,8 +20,8 @@ package fake
import (
clientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1alpha1"
fakezfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1alpha1/fake"
zfsv1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1"
fakezfsv1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1/fake"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/discovery"
@ -71,7 +71,7 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface {
var _ clientset.Interface = &Clientset{}
// ZfsV1alpha1 retrieves the ZfsV1alpha1Client
func (c *Clientset) ZfsV1alpha1() zfsv1alpha1.ZfsV1alpha1Interface {
return &fakezfsv1alpha1.FakeZfsV1alpha1{Fake: &c.Fake}
// ZfsV1 retrieves the ZfsV1Client
func (c *Clientset) ZfsV1() zfsv1.ZfsV1Interface {
return &fakezfsv1.FakeZfsV1{Fake: &c.Fake}
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
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{
zfsv1alpha1.AddToScheme,
zfsv1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View file

@ -19,7 +19,7 @@ limitations under the License.
package scheme
import (
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
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{
zfsv1alpha1.AddToScheme,
zfsv1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition

View file

@ -17,4 +17,4 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1alpha1
package v1

View file

@ -19,26 +19,26 @@ limitations under the License.
package fake
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/typed/zfs/v1"
rest "k8s.io/client-go/rest"
testing "k8s.io/client-go/testing"
)
type FakeZfsV1alpha1 struct {
type FakeZfsV1 struct {
*testing.Fake
}
func (c *FakeZfsV1alpha1) ZFSSnapshots(namespace string) v1alpha1.ZFSSnapshotInterface {
func (c *FakeZfsV1) ZFSSnapshots(namespace string) v1.ZFSSnapshotInterface {
return &FakeZFSSnapshots{c, namespace}
}
func (c *FakeZfsV1alpha1) ZFSVolumes(namespace string) v1alpha1.ZFSVolumeInterface {
func (c *FakeZfsV1) ZFSVolumes(namespace string) v1.ZFSVolumeInterface {
return &FakeZFSVolumes{c, namespace}
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *FakeZfsV1alpha1) RESTClient() rest.Interface {
func (c *FakeZfsV1) RESTClient() rest.Interface {
var ret *rest.RESTClient
return ret
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -30,29 +30,29 @@ import (
// FakeZFSSnapshots implements ZFSSnapshotInterface
type FakeZFSSnapshots struct {
Fake *FakeZfsV1alpha1
Fake *FakeZfsV1
ns string
}
var zfssnapshotsResource = schema.GroupVersionResource{Group: "zfs.openebs.io", Version: "v1alpha1", Resource: "zfssnapshots"}
var zfssnapshotsResource = schema.GroupVersionResource{Group: "zfs.openebs.io", Version: "v1", Resource: "zfssnapshots"}
var zfssnapshotsKind = schema.GroupVersionKind{Group: "zfs.openebs.io", Version: "v1alpha1", Kind: "ZFSSnapshot"}
var zfssnapshotsKind = schema.GroupVersionKind{Group: "zfs.openebs.io", Version: "v1", Kind: "ZFSSnapshot"}
// Get takes name of the zFSSnapshot, and returns the corresponding zFSSnapshot object, and an error if there is any.
func (c *FakeZFSSnapshots) Get(name string, options v1.GetOptions) (result *v1alpha1.ZFSSnapshot, err error) {
func (c *FakeZFSSnapshots) Get(name string, options v1.GetOptions) (result *zfsv1.ZFSSnapshot, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(zfssnapshotsResource, c.ns, name), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewGetAction(zfssnapshotsResource, c.ns, name), &zfsv1.ZFSSnapshot{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSSnapshot), err
return obj.(*zfsv1.ZFSSnapshot), err
}
// List takes label and field selectors, and returns the list of ZFSSnapshots that match those selectors.
func (c *FakeZFSSnapshots) List(opts v1.ListOptions) (result *v1alpha1.ZFSSnapshotList, err error) {
func (c *FakeZFSSnapshots) List(opts v1.ListOptions) (result *zfsv1.ZFSSnapshotList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(zfssnapshotsResource, zfssnapshotsKind, c.ns, opts), &v1alpha1.ZFSSnapshotList{})
Invokes(testing.NewListAction(zfssnapshotsResource, zfssnapshotsKind, c.ns, opts), &zfsv1.ZFSSnapshotList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeZFSSnapshots) List(opts v1.ListOptions) (result *v1alpha1.ZFSSnapsh
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ZFSSnapshotList{ListMeta: obj.(*v1alpha1.ZFSSnapshotList).ListMeta}
for _, item := range obj.(*v1alpha1.ZFSSnapshotList).Items {
list := &zfsv1.ZFSSnapshotList{ListMeta: obj.(*zfsv1.ZFSSnapshotList).ListMeta}
for _, item := range obj.(*zfsv1.ZFSSnapshotList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeZFSSnapshots) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a zFSSnapshot and creates it. Returns the server's representation of the zFSSnapshot, and an error, if there is any.
func (c *FakeZFSSnapshots) Create(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alpha1.ZFSSnapshot, err error) {
func (c *FakeZFSSnapshots) Create(zFSSnapshot *zfsv1.ZFSSnapshot) (result *zfsv1.ZFSSnapshot, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(zfssnapshotsResource, c.ns, zFSSnapshot), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewCreateAction(zfssnapshotsResource, c.ns, zFSSnapshot), &zfsv1.ZFSSnapshot{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSSnapshot), err
return obj.(*zfsv1.ZFSSnapshot), err
}
// Update takes the representation of a zFSSnapshot and updates it. Returns the server's representation of the zFSSnapshot, and an error, if there is any.
func (c *FakeZFSSnapshots) Update(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alpha1.ZFSSnapshot, err error) {
func (c *FakeZFSSnapshots) Update(zFSSnapshot *zfsv1.ZFSSnapshot) (result *zfsv1.ZFSSnapshot, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(zfssnapshotsResource, c.ns, zFSSnapshot), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewUpdateAction(zfssnapshotsResource, c.ns, zFSSnapshot), &zfsv1.ZFSSnapshot{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSSnapshot), err
return obj.(*zfsv1.ZFSSnapshot), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeZFSSnapshots) UpdateStatus(zFSSnapshot *v1alpha1.ZFSSnapshot) (*v1alpha1.ZFSSnapshot, error) {
func (c *FakeZFSSnapshots) UpdateStatus(zFSSnapshot *zfsv1.ZFSSnapshot) (*zfsv1.ZFSSnapshot, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(zfssnapshotsResource, "status", c.ns, zFSSnapshot), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewUpdateSubresourceAction(zfssnapshotsResource, "status", c.ns, zFSSnapshot), &zfsv1.ZFSSnapshot{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSSnapshot), err
return obj.(*zfsv1.ZFSSnapshot), err
}
// Delete takes name of the zFSSnapshot and deletes it. Returns an error if one occurs.
func (c *FakeZFSSnapshots) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(zfssnapshotsResource, c.ns, name), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewDeleteAction(zfssnapshotsResource, c.ns, name), &zfsv1.ZFSSnapshot{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeZFSSnapshots) Delete(name string, options *v1.DeleteOptions) error
func (c *FakeZFSSnapshots) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(zfssnapshotsResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ZFSSnapshotList{})
_, err := c.Fake.Invokes(action, &zfsv1.ZFSSnapshotList{})
return err
}
// Patch applies the patch and returns the patched zFSSnapshot.
func (c *FakeZFSSnapshots) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSSnapshot, err error) {
func (c *FakeZFSSnapshots) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *zfsv1.ZFSSnapshot, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(zfssnapshotsResource, c.ns, name, pt, data, subresources...), &v1alpha1.ZFSSnapshot{})
Invokes(testing.NewPatchSubresourceAction(zfssnapshotsResource, c.ns, name, pt, data, subresources...), &zfsv1.ZFSSnapshot{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSSnapshot), err
return obj.(*zfsv1.ZFSSnapshot), err
}

View file

@ -19,7 +19,7 @@ limitations under the License.
package fake
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
@ -30,29 +30,29 @@ import (
// FakeZFSVolumes implements ZFSVolumeInterface
type FakeZFSVolumes struct {
Fake *FakeZfsV1alpha1
Fake *FakeZfsV1
ns string
}
var zfsvolumesResource = schema.GroupVersionResource{Group: "zfs.openebs.io", Version: "v1alpha1", Resource: "zfsvolumes"}
var zfsvolumesResource = schema.GroupVersionResource{Group: "zfs.openebs.io", Version: "v1", Resource: "zfsvolumes"}
var zfsvolumesKind = schema.GroupVersionKind{Group: "zfs.openebs.io", Version: "v1alpha1", Kind: "ZFSVolume"}
var zfsvolumesKind = schema.GroupVersionKind{Group: "zfs.openebs.io", Version: "v1", Kind: "ZFSVolume"}
// Get takes name of the zFSVolume, and returns the corresponding zFSVolume object, and an error if there is any.
func (c *FakeZFSVolumes) Get(name string, options v1.GetOptions) (result *v1alpha1.ZFSVolume, err error) {
func (c *FakeZFSVolumes) Get(name string, options v1.GetOptions) (result *zfsv1.ZFSVolume, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(zfsvolumesResource, c.ns, name), &v1alpha1.ZFSVolume{})
Invokes(testing.NewGetAction(zfsvolumesResource, c.ns, name), &zfsv1.ZFSVolume{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSVolume), err
return obj.(*zfsv1.ZFSVolume), err
}
// List takes label and field selectors, and returns the list of ZFSVolumes that match those selectors.
func (c *FakeZFSVolumes) List(opts v1.ListOptions) (result *v1alpha1.ZFSVolumeList, err error) {
func (c *FakeZFSVolumes) List(opts v1.ListOptions) (result *zfsv1.ZFSVolumeList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(zfsvolumesResource, zfsvolumesKind, c.ns, opts), &v1alpha1.ZFSVolumeList{})
Invokes(testing.NewListAction(zfsvolumesResource, zfsvolumesKind, c.ns, opts), &zfsv1.ZFSVolumeList{})
if obj == nil {
return nil, err
@ -62,8 +62,8 @@ func (c *FakeZFSVolumes) List(opts v1.ListOptions) (result *v1alpha1.ZFSVolumeLi
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.ZFSVolumeList{ListMeta: obj.(*v1alpha1.ZFSVolumeList).ListMeta}
for _, item := range obj.(*v1alpha1.ZFSVolumeList).Items {
list := &zfsv1.ZFSVolumeList{ListMeta: obj.(*zfsv1.ZFSVolumeList).ListMeta}
for _, item := range obj.(*zfsv1.ZFSVolumeList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
@ -79,43 +79,43 @@ func (c *FakeZFSVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a zFSVolume and creates it. Returns the server's representation of the zFSVolume, and an error, if there is any.
func (c *FakeZFSVolumes) Create(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFSVolume, err error) {
func (c *FakeZFSVolumes) Create(zFSVolume *zfsv1.ZFSVolume) (result *zfsv1.ZFSVolume, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(zfsvolumesResource, c.ns, zFSVolume), &v1alpha1.ZFSVolume{})
Invokes(testing.NewCreateAction(zfsvolumesResource, c.ns, zFSVolume), &zfsv1.ZFSVolume{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSVolume), err
return obj.(*zfsv1.ZFSVolume), err
}
// Update takes the representation of a zFSVolume and updates it. Returns the server's representation of the zFSVolume, and an error, if there is any.
func (c *FakeZFSVolumes) Update(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFSVolume, err error) {
func (c *FakeZFSVolumes) Update(zFSVolume *zfsv1.ZFSVolume) (result *zfsv1.ZFSVolume, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(zfsvolumesResource, c.ns, zFSVolume), &v1alpha1.ZFSVolume{})
Invokes(testing.NewUpdateAction(zfsvolumesResource, c.ns, zFSVolume), &zfsv1.ZFSVolume{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSVolume), err
return obj.(*zfsv1.ZFSVolume), err
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *FakeZFSVolumes) UpdateStatus(zFSVolume *v1alpha1.ZFSVolume) (*v1alpha1.ZFSVolume, error) {
func (c *FakeZFSVolumes) UpdateStatus(zFSVolume *zfsv1.ZFSVolume) (*zfsv1.ZFSVolume, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(zfsvolumesResource, "status", c.ns, zFSVolume), &v1alpha1.ZFSVolume{})
Invokes(testing.NewUpdateSubresourceAction(zfsvolumesResource, "status", c.ns, zFSVolume), &zfsv1.ZFSVolume{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSVolume), err
return obj.(*zfsv1.ZFSVolume), err
}
// Delete takes name of the zFSVolume and deletes it. Returns an error if one occurs.
func (c *FakeZFSVolumes) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(zfsvolumesResource, c.ns, name), &v1alpha1.ZFSVolume{})
Invokes(testing.NewDeleteAction(zfsvolumesResource, c.ns, name), &zfsv1.ZFSVolume{})
return err
}
@ -124,17 +124,17 @@ func (c *FakeZFSVolumes) Delete(name string, options *v1.DeleteOptions) error {
func (c *FakeZFSVolumes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(zfsvolumesResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1alpha1.ZFSVolumeList{})
_, err := c.Fake.Invokes(action, &zfsv1.ZFSVolumeList{})
return err
}
// Patch applies the patch and returns the patched zFSVolume.
func (c *FakeZFSVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSVolume, err error) {
func (c *FakeZFSVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *zfsv1.ZFSVolume, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(zfsvolumesResource, c.ns, name, pt, data, subresources...), &v1alpha1.ZFSVolume{})
Invokes(testing.NewPatchSubresourceAction(zfsvolumesResource, c.ns, name, pt, data, subresources...), &zfsv1.ZFSVolume{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.ZFSVolume), err
return obj.(*zfsv1.ZFSVolume), err
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
type ZFSSnapshotExpansion interface{}

View file

@ -16,36 +16,36 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
"github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
rest "k8s.io/client-go/rest"
)
type ZfsV1alpha1Interface interface {
type ZfsV1Interface interface {
RESTClient() rest.Interface
ZFSSnapshotsGetter
ZFSVolumesGetter
}
// ZfsV1alpha1Client is used to interact with features provided by the zfs.openebs.io group.
type ZfsV1alpha1Client struct {
// ZfsV1Client is used to interact with features provided by the zfs.openebs.io group.
type ZfsV1Client struct {
restClient rest.Interface
}
func (c *ZfsV1alpha1Client) ZFSSnapshots(namespace string) ZFSSnapshotInterface {
func (c *ZfsV1Client) ZFSSnapshots(namespace string) ZFSSnapshotInterface {
return newZFSSnapshots(c, namespace)
}
func (c *ZfsV1alpha1Client) ZFSVolumes(namespace string) ZFSVolumeInterface {
func (c *ZfsV1Client) ZFSVolumes(namespace string) ZFSVolumeInterface {
return newZFSVolumes(c, namespace)
}
// NewForConfig creates a new ZfsV1alpha1Client for the given config.
func NewForConfig(c *rest.Config) (*ZfsV1alpha1Client, error) {
// NewForConfig creates a new ZfsV1Client for the given config.
func NewForConfig(c *rest.Config) (*ZfsV1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
@ -54,12 +54,12 @@ func NewForConfig(c *rest.Config) (*ZfsV1alpha1Client, error) {
if err != nil {
return nil, err
}
return &ZfsV1alpha1Client{client}, nil
return &ZfsV1Client{client}, nil
}
// NewForConfigOrDie creates a new ZfsV1alpha1Client for the given config and
// NewForConfigOrDie creates a new ZfsV1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *ZfsV1alpha1Client {
func NewForConfigOrDie(c *rest.Config) *ZfsV1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
@ -67,13 +67,13 @@ func NewForConfigOrDie(c *rest.Config) *ZfsV1alpha1Client {
return client
}
// New creates a new ZfsV1alpha1Client for the given RESTClient.
func New(c rest.Interface) *ZfsV1alpha1Client {
return &ZfsV1alpha1Client{c}
// New creates a new ZfsV1Client for the given RESTClient.
func New(c rest.Interface) *ZfsV1Client {
return &ZfsV1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1alpha1.SchemeGroupVersion
gv := v1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs}
@ -87,7 +87,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 *ZfsV1alpha1Client) RESTClient() rest.Interface {
func (c *ZfsV1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}

View file

@ -16,14 +16,14 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"time"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
scheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "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"
@ -37,15 +37,15 @@ type ZFSSnapshotsGetter interface {
// ZFSSnapshotInterface has methods to work with ZFSSnapshot resources.
type ZFSSnapshotInterface interface {
Create(*v1alpha1.ZFSSnapshot) (*v1alpha1.ZFSSnapshot, error)
Update(*v1alpha1.ZFSSnapshot) (*v1alpha1.ZFSSnapshot, error)
UpdateStatus(*v1alpha1.ZFSSnapshot) (*v1alpha1.ZFSSnapshot, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.ZFSSnapshot, error)
List(opts v1.ListOptions) (*v1alpha1.ZFSSnapshotList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSSnapshot, err error)
Create(*v1.ZFSSnapshot) (*v1.ZFSSnapshot, error)
Update(*v1.ZFSSnapshot) (*v1.ZFSSnapshot, error)
UpdateStatus(*v1.ZFSSnapshot) (*v1.ZFSSnapshot, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ZFSSnapshot, error)
List(opts metav1.ListOptions) (*v1.ZFSSnapshotList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ZFSSnapshot, err error)
ZFSSnapshotExpansion
}
@ -56,7 +56,7 @@ type zFSSnapshots struct {
}
// newZFSSnapshots returns a ZFSSnapshots
func newZFSSnapshots(c *ZfsV1alpha1Client, namespace string) *zFSSnapshots {
func newZFSSnapshots(c *ZfsV1Client, namespace string) *zFSSnapshots {
return &zFSSnapshots{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +64,8 @@ func newZFSSnapshots(c *ZfsV1alpha1Client, namespace string) *zFSSnapshots {
}
// Get takes name of the zFSSnapshot, and returns the corresponding zFSSnapshot object, and an error if there is any.
func (c *zFSSnapshots) Get(name string, options v1.GetOptions) (result *v1alpha1.ZFSSnapshot, err error) {
result = &v1alpha1.ZFSSnapshot{}
func (c *zFSSnapshots) Get(name string, options metav1.GetOptions) (result *v1.ZFSSnapshot, err error) {
result = &v1.ZFSSnapshot{}
err = c.client.Get().
Namespace(c.ns).
Resource("zfssnapshots").
@ -77,12 +77,12 @@ func (c *zFSSnapshots) Get(name string, options v1.GetOptions) (result *v1alpha1
}
// List takes label and field selectors, and returns the list of ZFSSnapshots that match those selectors.
func (c *zFSSnapshots) List(opts v1.ListOptions) (result *v1alpha1.ZFSSnapshotList, err error) {
func (c *zFSSnapshots) List(opts metav1.ListOptions) (result *v1.ZFSSnapshotList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ZFSSnapshotList{}
result = &v1.ZFSSnapshotList{}
err = c.client.Get().
Namespace(c.ns).
Resource("zfssnapshots").
@ -94,7 +94,7 @@ func (c *zFSSnapshots) List(opts v1.ListOptions) (result *v1alpha1.ZFSSnapshotLi
}
// Watch returns a watch.Interface that watches the requested zFSSnapshots.
func (c *zFSSnapshots) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *zFSSnapshots) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -109,8 +109,8 @@ func (c *zFSSnapshots) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a zFSSnapshot and creates it. Returns the server's representation of the zFSSnapshot, and an error, if there is any.
func (c *zFSSnapshots) Create(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alpha1.ZFSSnapshot, err error) {
result = &v1alpha1.ZFSSnapshot{}
func (c *zFSSnapshots) Create(zFSSnapshot *v1.ZFSSnapshot) (result *v1.ZFSSnapshot, err error) {
result = &v1.ZFSSnapshot{}
err = c.client.Post().
Namespace(c.ns).
Resource("zfssnapshots").
@ -121,8 +121,8 @@ func (c *zFSSnapshots) Create(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alph
}
// Update takes the representation of a zFSSnapshot and updates it. Returns the server's representation of the zFSSnapshot, and an error, if there is any.
func (c *zFSSnapshots) Update(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alpha1.ZFSSnapshot, err error) {
result = &v1alpha1.ZFSSnapshot{}
func (c *zFSSnapshots) Update(zFSSnapshot *v1.ZFSSnapshot) (result *v1.ZFSSnapshot, err error) {
result = &v1.ZFSSnapshot{}
err = c.client.Put().
Namespace(c.ns).
Resource("zfssnapshots").
@ -136,8 +136,8 @@ func (c *zFSSnapshots) Update(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alph
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *zFSSnapshots) UpdateStatus(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *v1alpha1.ZFSSnapshot, err error) {
result = &v1alpha1.ZFSSnapshot{}
func (c *zFSSnapshots) UpdateStatus(zFSSnapshot *v1.ZFSSnapshot) (result *v1.ZFSSnapshot, err error) {
result = &v1.ZFSSnapshot{}
err = c.client.Put().
Namespace(c.ns).
Resource("zfssnapshots").
@ -150,7 +150,7 @@ func (c *zFSSnapshots) UpdateStatus(zFSSnapshot *v1alpha1.ZFSSnapshot) (result *
}
// Delete takes name of the zFSSnapshot and deletes it. Returns an error if one occurs.
func (c *zFSSnapshots) Delete(name string, options *v1.DeleteOptions) error {
func (c *zFSSnapshots) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("zfssnapshots").
@ -161,7 +161,7 @@ func (c *zFSSnapshots) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *zFSSnapshots) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *zFSSnapshots) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
@ -177,8 +177,8 @@ func (c *zFSSnapshots) DeleteCollection(options *v1.DeleteOptions, listOptions v
}
// Patch applies the patch and returns the patched zFSSnapshot.
func (c *zFSSnapshots) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSSnapshot, err error) {
result = &v1alpha1.ZFSSnapshot{}
func (c *zFSSnapshots) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ZFSSnapshot, err error) {
result = &v1.ZFSSnapshot{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("zfssnapshots").

View file

@ -16,14 +16,14 @@ limitations under the License.
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
"time"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
scheme "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "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"
@ -37,15 +37,15 @@ type ZFSVolumesGetter interface {
// ZFSVolumeInterface has methods to work with ZFSVolume resources.
type ZFSVolumeInterface interface {
Create(*v1alpha1.ZFSVolume) (*v1alpha1.ZFSVolume, error)
Update(*v1alpha1.ZFSVolume) (*v1alpha1.ZFSVolume, error)
UpdateStatus(*v1alpha1.ZFSVolume) (*v1alpha1.ZFSVolume, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1alpha1.ZFSVolume, error)
List(opts v1.ListOptions) (*v1alpha1.ZFSVolumeList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSVolume, err error)
Create(*v1.ZFSVolume) (*v1.ZFSVolume, error)
Update(*v1.ZFSVolume) (*v1.ZFSVolume, error)
UpdateStatus(*v1.ZFSVolume) (*v1.ZFSVolume, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
Get(name string, options metav1.GetOptions) (*v1.ZFSVolume, error)
List(opts metav1.ListOptions) (*v1.ZFSVolumeList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ZFSVolume, err error)
ZFSVolumeExpansion
}
@ -56,7 +56,7 @@ type zFSVolumes struct {
}
// newZFSVolumes returns a ZFSVolumes
func newZFSVolumes(c *ZfsV1alpha1Client, namespace string) *zFSVolumes {
func newZFSVolumes(c *ZfsV1Client, namespace string) *zFSVolumes {
return &zFSVolumes{
client: c.RESTClient(),
ns: namespace,
@ -64,8 +64,8 @@ func newZFSVolumes(c *ZfsV1alpha1Client, namespace string) *zFSVolumes {
}
// Get takes name of the zFSVolume, and returns the corresponding zFSVolume object, and an error if there is any.
func (c *zFSVolumes) Get(name string, options v1.GetOptions) (result *v1alpha1.ZFSVolume, err error) {
result = &v1alpha1.ZFSVolume{}
func (c *zFSVolumes) Get(name string, options metav1.GetOptions) (result *v1.ZFSVolume, err error) {
result = &v1.ZFSVolume{}
err = c.client.Get().
Namespace(c.ns).
Resource("zfsvolumes").
@ -77,12 +77,12 @@ func (c *zFSVolumes) Get(name string, options v1.GetOptions) (result *v1alpha1.Z
}
// List takes label and field selectors, and returns the list of ZFSVolumes that match those selectors.
func (c *zFSVolumes) List(opts v1.ListOptions) (result *v1alpha1.ZFSVolumeList, err error) {
func (c *zFSVolumes) List(opts metav1.ListOptions) (result *v1.ZFSVolumeList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.ZFSVolumeList{}
result = &v1.ZFSVolumeList{}
err = c.client.Get().
Namespace(c.ns).
Resource("zfsvolumes").
@ -94,7 +94,7 @@ func (c *zFSVolumes) List(opts v1.ListOptions) (result *v1alpha1.ZFSVolumeList,
}
// Watch returns a watch.Interface that watches the requested zFSVolumes.
func (c *zFSVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) {
func (c *zFSVolumes) Watch(opts metav1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
@ -109,8 +109,8 @@ func (c *zFSVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) {
}
// Create takes the representation of a zFSVolume and creates it. Returns the server's representation of the zFSVolume, and an error, if there is any.
func (c *zFSVolumes) Create(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFSVolume, err error) {
result = &v1alpha1.ZFSVolume{}
func (c *zFSVolumes) Create(zFSVolume *v1.ZFSVolume) (result *v1.ZFSVolume, err error) {
result = &v1.ZFSVolume{}
err = c.client.Post().
Namespace(c.ns).
Resource("zfsvolumes").
@ -121,8 +121,8 @@ func (c *zFSVolumes) Create(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFS
}
// Update takes the representation of a zFSVolume and updates it. Returns the server's representation of the zFSVolume, and an error, if there is any.
func (c *zFSVolumes) Update(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFSVolume, err error) {
result = &v1alpha1.ZFSVolume{}
func (c *zFSVolumes) Update(zFSVolume *v1.ZFSVolume) (result *v1.ZFSVolume, err error) {
result = &v1.ZFSVolume{}
err = c.client.Put().
Namespace(c.ns).
Resource("zfsvolumes").
@ -136,8 +136,8 @@ func (c *zFSVolumes) Update(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFS
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *zFSVolumes) UpdateStatus(zFSVolume *v1alpha1.ZFSVolume) (result *v1alpha1.ZFSVolume, err error) {
result = &v1alpha1.ZFSVolume{}
func (c *zFSVolumes) UpdateStatus(zFSVolume *v1.ZFSVolume) (result *v1.ZFSVolume, err error) {
result = &v1.ZFSVolume{}
err = c.client.Put().
Namespace(c.ns).
Resource("zfsvolumes").
@ -150,7 +150,7 @@ func (c *zFSVolumes) UpdateStatus(zFSVolume *v1alpha1.ZFSVolume) (result *v1alph
}
// Delete takes name of the zFSVolume and deletes it. Returns an error if one occurs.
func (c *zFSVolumes) Delete(name string, options *v1.DeleteOptions) error {
func (c *zFSVolumes) Delete(name string, options *metav1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("zfsvolumes").
@ -161,7 +161,7 @@ func (c *zFSVolumes) Delete(name string, options *v1.DeleteOptions) error {
}
// DeleteCollection deletes a collection of objects.
func (c *zFSVolumes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
func (c *zFSVolumes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
@ -177,8 +177,8 @@ func (c *zFSVolumes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.
}
// Patch applies the patch and returns the patched zFSVolume.
func (c *zFSVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ZFSVolume, err error) {
result = &v1alpha1.ZFSVolume{}
func (c *zFSVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ZFSVolume, err error) {
result = &v1.ZFSVolume{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("zfsvolumes").

View file

@ -21,7 +21,7 @@ package externalversions
import (
"fmt"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
@ -52,11 +52,11 @@ 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=zfs.openebs.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("zfssnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1alpha1().ZFSSnapshots().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("zfsvolumes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1alpha1().ZFSVolumes().Informer()}, nil
// Group=zfs.openebs.io, Version=v1
case v1.SchemeGroupVersion.WithResource("zfssnapshots"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1().ZFSSnapshots().Informer()}, nil
case v1.SchemeGroupVersion.WithResource("zfsvolumes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Zfs().V1().ZFSVolumes().Informer()}, nil
}

View file

@ -20,13 +20,13 @@ package zfs
import (
internalinterfaces "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/internalinterfaces"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/zfs/v1"
)
// Interface provides access to each of this group's versions.
type Interface interface {
// V1alpha1 provides access to shared informers for resources in V1alpha1.
V1alpha1() v1alpha1.Interface
// V1 provides access to shared informers for resources in V1.
V1() v1.Interface
}
type group struct {
@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList
return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions}
}
// V1alpha1 returns a new v1alpha1.Interface.
func (g *group) V1alpha1() v1alpha1.Interface {
return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions)
// V1 returns a new v1.Interface.
func (g *group) V1() v1.Interface {
return v1.New(g.factory, g.namespace, g.tweakListOptions)
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
internalinterfaces "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/internalinterfaces"

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
time "time"
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
internalclientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
internalinterfaces "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/internalinterfaces"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1"
metav1 "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"
@ -35,7 +35,7 @@ import (
// ZFSSnapshots.
type ZFSSnapshotInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ZFSSnapshotLister
Lister() v1.ZFSSnapshotLister
}
type zFSSnapshotInformer struct {
@ -57,20 +57,20 @@ func NewZFSSnapshotInformer(client internalclientset.Interface, namespace string
func NewFilteredZFSSnapshotInformer(client internalclientset.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) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ZfsV1alpha1().ZFSSnapshots(namespace).List(options)
return client.ZfsV1().ZFSSnapshots(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ZfsV1alpha1().ZFSSnapshots(namespace).Watch(options)
return client.ZfsV1().ZFSSnapshots(namespace).Watch(options)
},
},
&zfsv1alpha1.ZFSSnapshot{},
&zfsv1.ZFSSnapshot{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *zFSSnapshotInformer) defaultInformer(client internalclientset.Interface
}
func (f *zFSSnapshotInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&zfsv1alpha1.ZFSSnapshot{}, f.defaultInformer)
return f.factory.InformerFor(&zfsv1.ZFSSnapshot{}, f.defaultInformer)
}
func (f *zFSSnapshotInformer) Lister() v1alpha1.ZFSSnapshotLister {
return v1alpha1.NewZFSSnapshotLister(f.Informer().GetIndexer())
func (f *zFSSnapshotInformer) Lister() v1.ZFSSnapshotLister {
return v1.NewZFSSnapshotLister(f.Informer().GetIndexer())
}

View file

@ -16,16 +16,16 @@ limitations under the License.
// Code generated by informer-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
time "time"
zfsv1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
zfsv1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
internalclientset "github.com/openebs/zfs-localpv/pkg/generated/clientset/internalclientset"
internalinterfaces "github.com/openebs/zfs-localpv/pkg/generated/informer/externalversions/internalinterfaces"
v1alpha1 "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/openebs/zfs-localpv/pkg/generated/lister/zfs/v1"
metav1 "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"
@ -35,7 +35,7 @@ import (
// ZFSVolumes.
type ZFSVolumeInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.ZFSVolumeLister
Lister() v1.ZFSVolumeLister
}
type zFSVolumeInformer struct {
@ -57,20 +57,20 @@ func NewZFSVolumeInformer(client internalclientset.Interface, namespace string,
func NewFilteredZFSVolumeInformer(client internalclientset.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) {
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ZfsV1alpha1().ZFSVolumes(namespace).List(options)
return client.ZfsV1().ZFSVolumes(namespace).List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.ZfsV1alpha1().ZFSVolumes(namespace).Watch(options)
return client.ZfsV1().ZFSVolumes(namespace).Watch(options)
},
},
&zfsv1alpha1.ZFSVolume{},
&zfsv1.ZFSVolume{},
resyncPeriod,
indexers,
)
@ -81,9 +81,9 @@ func (f *zFSVolumeInformer) defaultInformer(client internalclientset.Interface,
}
func (f *zFSVolumeInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&zfsv1alpha1.ZFSVolume{}, f.defaultInformer)
return f.factory.InformerFor(&zfsv1.ZFSVolume{}, f.defaultInformer)
}
func (f *zFSVolumeInformer) Lister() v1alpha1.ZFSVolumeLister {
return v1alpha1.NewZFSVolumeLister(f.Informer().GetIndexer())
func (f *zFSVolumeInformer) Lister() v1.ZFSVolumeLister {
return v1.NewZFSVolumeLister(f.Informer().GetIndexer())
}

View file

@ -16,7 +16,7 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1
// ZFSSnapshotListerExpansion allows custom methods to be added to
// ZFSSnapshotLister.

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -28,7 +28,7 @@ import (
// ZFSSnapshotLister helps list ZFSSnapshots.
type ZFSSnapshotLister interface {
// List lists all ZFSSnapshots in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.ZFSSnapshot, err error)
List(selector labels.Selector) (ret []*v1.ZFSSnapshot, err error)
// ZFSSnapshots returns an object that can list and get ZFSSnapshots.
ZFSSnapshots(namespace string) ZFSSnapshotNamespaceLister
ZFSSnapshotListerExpansion
@ -45,9 +45,9 @@ func NewZFSSnapshotLister(indexer cache.Indexer) ZFSSnapshotLister {
}
// List lists all ZFSSnapshots in the indexer.
func (s *zFSSnapshotLister) List(selector labels.Selector) (ret []*v1alpha1.ZFSSnapshot, err error) {
func (s *zFSSnapshotLister) List(selector labels.Selector) (ret []*v1.ZFSSnapshot, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ZFSSnapshot))
ret = append(ret, m.(*v1.ZFSSnapshot))
})
return ret, err
}
@ -60,9 +60,9 @@ func (s *zFSSnapshotLister) ZFSSnapshots(namespace string) ZFSSnapshotNamespaceL
// ZFSSnapshotNamespaceLister helps list and get ZFSSnapshots.
type ZFSSnapshotNamespaceLister interface {
// List lists all ZFSSnapshots in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.ZFSSnapshot, err error)
List(selector labels.Selector) (ret []*v1.ZFSSnapshot, err error)
// Get retrieves the ZFSSnapshot from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.ZFSSnapshot, error)
Get(name string) (*v1.ZFSSnapshot, error)
ZFSSnapshotNamespaceListerExpansion
}
@ -74,21 +74,21 @@ type zFSSnapshotNamespaceLister struct {
}
// List lists all ZFSSnapshots in the indexer for a given namespace.
func (s zFSSnapshotNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ZFSSnapshot, err error) {
func (s zFSSnapshotNamespaceLister) List(selector labels.Selector) (ret []*v1.ZFSSnapshot, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ZFSSnapshot))
ret = append(ret, m.(*v1.ZFSSnapshot))
})
return ret, err
}
// Get retrieves the ZFSSnapshot from the indexer for a given namespace and name.
func (s zFSSnapshotNamespaceLister) Get(name string) (*v1alpha1.ZFSSnapshot, error) {
func (s zFSSnapshotNamespaceLister) Get(name string) (*v1.ZFSSnapshot, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("zfssnapshot"), name)
return nil, errors.NewNotFound(v1.Resource("zfssnapshot"), name)
}
return obj.(*v1alpha1.ZFSSnapshot), nil
return obj.(*v1.ZFSSnapshot), nil
}

View file

@ -16,10 +16,10 @@ limitations under the License.
// Code generated by lister-gen. DO NOT EDIT.
package v1alpha1
package v1
import (
v1alpha1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1alpha1"
v1 "github.com/openebs/zfs-localpv/pkg/apis/openebs.io/zfs/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/tools/cache"
@ -28,7 +28,7 @@ import (
// ZFSVolumeLister helps list ZFSVolumes.
type ZFSVolumeLister interface {
// List lists all ZFSVolumes in the indexer.
List(selector labels.Selector) (ret []*v1alpha1.ZFSVolume, err error)
List(selector labels.Selector) (ret []*v1.ZFSVolume, err error)
// ZFSVolumes returns an object that can list and get ZFSVolumes.
ZFSVolumes(namespace string) ZFSVolumeNamespaceLister
ZFSVolumeListerExpansion
@ -45,9 +45,9 @@ func NewZFSVolumeLister(indexer cache.Indexer) ZFSVolumeLister {
}
// List lists all ZFSVolumes in the indexer.
func (s *zFSVolumeLister) List(selector labels.Selector) (ret []*v1alpha1.ZFSVolume, err error) {
func (s *zFSVolumeLister) List(selector labels.Selector) (ret []*v1.ZFSVolume, err error) {
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ZFSVolume))
ret = append(ret, m.(*v1.ZFSVolume))
})
return ret, err
}
@ -60,9 +60,9 @@ func (s *zFSVolumeLister) ZFSVolumes(namespace string) ZFSVolumeNamespaceLister
// ZFSVolumeNamespaceLister helps list and get ZFSVolumes.
type ZFSVolumeNamespaceLister interface {
// List lists all ZFSVolumes in the indexer for a given namespace.
List(selector labels.Selector) (ret []*v1alpha1.ZFSVolume, err error)
List(selector labels.Selector) (ret []*v1.ZFSVolume, err error)
// Get retrieves the ZFSVolume from the indexer for a given namespace and name.
Get(name string) (*v1alpha1.ZFSVolume, error)
Get(name string) (*v1.ZFSVolume, error)
ZFSVolumeNamespaceListerExpansion
}
@ -74,21 +74,21 @@ type zFSVolumeNamespaceLister struct {
}
// List lists all ZFSVolumes in the indexer for a given namespace.
func (s zFSVolumeNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ZFSVolume, err error) {
func (s zFSVolumeNamespaceLister) List(selector labels.Selector) (ret []*v1.ZFSVolume, err error) {
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
ret = append(ret, m.(*v1alpha1.ZFSVolume))
ret = append(ret, m.(*v1.ZFSVolume))
})
return ret, err
}
// Get retrieves the ZFSVolume from the indexer for a given namespace and name.
func (s zFSVolumeNamespaceLister) Get(name string) (*v1alpha1.ZFSVolume, error) {
func (s zFSVolumeNamespaceLister) Get(name string) (*v1.ZFSVolume, error) {
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(v1alpha1.Resource("zfsvolume"), name)
return nil, errors.NewNotFound(v1.Resource("zfsvolume"), name)
}
return obj.(*v1alpha1.ZFSVolume), nil
return obj.(*v1.ZFSVolume), nil
}