diff --git a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device.go b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device.go index 95b00e6747..7789f470ed 100644 --- a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device.go +++ b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device.go @@ -7,7 +7,6 @@ import ( // +genclient // +genclient:noStatus -// +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +resource:path=blockdevice diff --git a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device_claim.go b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device_claim.go new file mode 100644 index 0000000000..23548ef3b1 --- /dev/null +++ b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/block_device_claim.go @@ -0,0 +1,118 @@ +/* +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. +*/ + +package v1alpha1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. + +// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster +// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file + +// DeviceClaimSpec defines the desired state of BlockDeviceClaim +type DeviceClaimSpec struct { + Resources DeviceClaimResources `json:"resources"` // the resources in the claim like Capacity, IOPS + DeviceType string `json:"deviceType"` // DeviceType represents the type of drive like SSD, HDD etc., + HostName string `json:"hostName"` // Node name from where blockdevice has to be claimed. + Details DeviceClaimDetails `json:"deviceClaimDetails,omitempty"` // Details of the device to be claimed + BlockDeviceName string `json:"blockDeviceName,omitempty"` // BlockDeviceName is the reference to the block-device backing this claim +} + +// DeviceClaimStatus defines the observed state of BlockDeviceClaim +type DeviceClaimStatus struct { + Phase DeviceClaimPhase `json:"phase"` +} + +// DeviceClaimPhase is a typed string for phase field of BlockDeviceClaim. +type DeviceClaimPhase string + +// BlockDeviceClaim CR, when created pass through phases before it got some Devices Assigned. +// Given below table, have all phases which BlockDeviceClaim CR can go before it is marked done. +const ( + // BlockDeviceClaimStatusEmpty represents that the BlockDeviceClaim was just created. + BlockDeviceClaimStatusEmpty DeviceClaimPhase = "" + + // BlockDeviceClaimStatusPending represents BlockDeviceClaim has not been assigned devices yet. Rather + // search is going on for matching devices. + BlockDeviceClaimStatusPending DeviceClaimPhase = "Pending" + + // BlockDeviceClaimStatusInvalidCapacity represents BlockDeviceClaim has invalid capacity request i.e. 0/-1 + BlockDeviceClaimStatusInvalidCapacity DeviceClaimPhase = "Invalid Capacity Request" + + // BlockDeviceClaimStatusDone represents BlockDeviceClaim has been assigned backing blockdevice and ready for use. + BlockDeviceClaimStatusDone DeviceClaimPhase = "Bound" +) + +// DeviceClaimResources defines the request by the claim, eg, Storage, IOPS +type DeviceClaimResources struct { + // Requests describes the minimum resources required. eg: if storage resource of 10G is + // requested minimum capacity of 10G should be available + Requests v1.ResourceList `json:"requests"` +} + +const ( + // ResourceStorage defines the storage required as v1.Quantity + ResourceStorage v1.ResourceName = "storage" +) + +// DeviceClaimDetails defines the details of the block device that should be claimed +type DeviceClaimDetails struct { + // BlockVolumeMode represents whether to claim a device in Block mode or Filesystem mode. + // These are use cases of BlockVolumeMode: + // 1) Not specified: DeviceFormat and MountPoint will not be considered + // 2) VolumeModeBlock: DeviceFormat and MountPoint checks will be used as empty strings irrespective + // of the value they hold + // 3) VolumeModeFileSystem: DeviceFormat and MountPoint will be used for exact matches + BlockVolumeMode BlockDeviceVolumeMode `json:"blockVolumeMode,omitempty"` + DeviceFormat string `json:"formatType,omitempty"` //Format of the device required, eg:ext4, xfs + AllowPartition bool `json:"allowPartition,omitempty"` //AllowPartition represents whether to claim a full block device or a device that is a partition +} + +// BlockDeviceVolumeMode specifies the type in which the BlockDevice can be used +type BlockDeviceVolumeMode string + +const ( + // VolumeModeBlock specifies that the block device needs to be used as a raw block + VolumeModeBlock BlockDeviceVolumeMode = "Block" + // VolumeModeFileSystem specifies that block device will be used with a filesystem already existing + VolumeModeFileSystem BlockDeviceVolumeMode = "FileSystem" +) + +// +genclient +// +genclient:noStatus +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +resource:path=blockdeviceclaim + +// BlockDeviceClaim is the Schema for the block device claim API +type BlockDeviceClaim struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec DeviceClaimSpec `json:"spec,omitempty"` + Status DeviceClaimStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +resource:path=blockdeviceclaims + +// BlockDeviceClaimList contains a list of BlockDeviceClaim +type BlockDeviceClaimList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []BlockDeviceClaim `json:"items"` +} diff --git a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/register.go b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/register.go index f7b56220d3..26c2d53ec2 100644 --- a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/register.go +++ b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/register.go @@ -51,6 +51,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &DiskList{}, &BlockDevice{}, &BlockDeviceList{}, + &BlockDeviceClaim{}, + &BlockDeviceClaimList{}, ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil diff --git a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/zz_generated.deepcopy.go index 1a4b9fd73e..48d8c9a12a 100644 --- a/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1/zz_generated.deepcopy.go @@ -74,6 +74,67 @@ func (in *BlockDeviceAttr) DeepCopy() *BlockDeviceAttr { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceClaim) DeepCopyInto(out *BlockDeviceClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + out.Status = in.Status + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceClaim. +func (in *BlockDeviceClaim) DeepCopy() *BlockDeviceClaim { + if in == nil { + return nil + } + out := new(BlockDeviceClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BlockDeviceClaim) 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 *BlockDeviceClaimList) DeepCopyInto(out *BlockDeviceClaimList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]BlockDeviceClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceClaimList. +func (in *BlockDeviceClaimList) DeepCopy() *BlockDeviceClaimList { + if in == nil { + return nil + } + out := new(BlockDeviceClaimList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *BlockDeviceClaimList) 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 *BlockDeviceGroup) DeepCopyInto(out *BlockDeviceGroup) { *out = *in @@ -738,6 +799,79 @@ func (in *DeviceCapacity) DeepCopy() *DeviceCapacity { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClaimDetails) DeepCopyInto(out *DeviceClaimDetails) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimDetails. +func (in *DeviceClaimDetails) DeepCopy() *DeviceClaimDetails { + if in == nil { + return nil + } + out := new(DeviceClaimDetails) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClaimResources) DeepCopyInto(out *DeviceClaimResources) { + *out = *in + if in.Requests != nil { + in, out := &in.Requests, &out.Requests + *out = make(v1.ResourceList, len(*in)) + for key, val := range *in { + (*out)[key] = val.DeepCopy() + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimResources. +func (in *DeviceClaimResources) DeepCopy() *DeviceClaimResources { + if in == nil { + return nil + } + out := new(DeviceClaimResources) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClaimSpec) DeepCopyInto(out *DeviceClaimSpec) { + *out = *in + in.Resources.DeepCopyInto(&out.Resources) + out.Details = in.Details + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimSpec. +func (in *DeviceClaimSpec) DeepCopy() *DeviceClaimSpec { + if in == nil { + return nil + } + out := new(DeviceClaimSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeviceClaimStatus) DeepCopyInto(out *DeviceClaimStatus) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeviceClaimStatus. +func (in *DeviceClaimStatus) DeepCopy() *DeviceClaimStatus { + if in == nil { + return nil + } + out := new(DeviceClaimStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeviceDetails) DeepCopyInto(out *DeviceDetails) { *out = *in diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdevice.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdevice.go index c0019121fc..bbfd88434a 100644 --- a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdevice.go +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdevice.go @@ -32,7 +32,7 @@ import ( // BlockDevicesGetter has a method to return a BlockDeviceInterface. // A group's client should implement this interface. type BlockDevicesGetter interface { - BlockDevices() BlockDeviceInterface + BlockDevices(namespace string) BlockDeviceInterface } // BlockDeviceInterface has methods to work with BlockDevice resources. @@ -51,12 +51,14 @@ type BlockDeviceInterface interface { // blockDevices implements BlockDeviceInterface type blockDevices struct { client rest.Interface + ns string } // newBlockDevices returns a BlockDevices -func newBlockDevices(c *OpenebsV1alpha1Client) *blockDevices { +func newBlockDevices(c *OpenebsV1alpha1Client, namespace string) *blockDevices { return &blockDevices{ client: c.RESTClient(), + ns: namespace, } } @@ -64,6 +66,7 @@ func newBlockDevices(c *OpenebsV1alpha1Client) *blockDevices { func (c *blockDevices) Get(name string, options v1.GetOptions) (result *v1alpha1.BlockDevice, err error) { result = &v1alpha1.BlockDevice{} err = c.client.Get(). + Namespace(c.ns). Resource("blockdevices"). Name(name). VersionedParams(&options, scheme.ParameterCodec). @@ -80,6 +83,7 @@ func (c *blockDevices) List(opts v1.ListOptions) (result *v1alpha1.BlockDeviceLi } result = &v1alpha1.BlockDeviceList{} err = c.client.Get(). + Namespace(c.ns). Resource("blockdevices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -96,6 +100,7 @@ func (c *blockDevices) Watch(opts v1.ListOptions) (watch.Interface, error) { } opts.Watch = true return c.client.Get(). + Namespace(c.ns). Resource("blockdevices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). @@ -106,6 +111,7 @@ func (c *blockDevices) Watch(opts v1.ListOptions) (watch.Interface, error) { func (c *blockDevices) Create(blockDevice *v1alpha1.BlockDevice) (result *v1alpha1.BlockDevice, err error) { result = &v1alpha1.BlockDevice{} err = c.client.Post(). + Namespace(c.ns). Resource("blockdevices"). Body(blockDevice). Do(). @@ -117,6 +123,7 @@ func (c *blockDevices) Create(blockDevice *v1alpha1.BlockDevice) (result *v1alph func (c *blockDevices) Update(blockDevice *v1alpha1.BlockDevice) (result *v1alpha1.BlockDevice, err error) { result = &v1alpha1.BlockDevice{} err = c.client.Put(). + Namespace(c.ns). Resource("blockdevices"). Name(blockDevice.Name). Body(blockDevice). @@ -128,6 +135,7 @@ func (c *blockDevices) Update(blockDevice *v1alpha1.BlockDevice) (result *v1alph // Delete takes name of the blockDevice and deletes it. Returns an error if one occurs. func (c *blockDevices) Delete(name string, options *v1.DeleteOptions) error { return c.client.Delete(). + Namespace(c.ns). Resource("blockdevices"). Name(name). Body(options). @@ -142,6 +150,7 @@ func (c *blockDevices) DeleteCollection(options *v1.DeleteOptions, listOptions v timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second } return c.client.Delete(). + Namespace(c.ns). Resource("blockdevices"). VersionedParams(&listOptions, scheme.ParameterCodec). Timeout(timeout). @@ -154,6 +163,7 @@ func (c *blockDevices) DeleteCollection(options *v1.DeleteOptions, listOptions v func (c *blockDevices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BlockDevice, err error) { result = &v1alpha1.BlockDevice{} err = c.client.Patch(pt). + Namespace(c.ns). Resource("blockdevices"). SubResource(subresources...). Name(name). diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdeviceclaim.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdeviceclaim.go new file mode 100644 index 0000000000..acd19debd3 --- /dev/null +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/blockdeviceclaim.go @@ -0,0 +1,174 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "time" + + v1alpha1 "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" + scheme "github.com/openebs/maya/pkg/client/clientset/versioned/scheme" + 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" +) + +// BlockDeviceClaimsGetter has a method to return a BlockDeviceClaimInterface. +// A group's client should implement this interface. +type BlockDeviceClaimsGetter interface { + BlockDeviceClaims(namespace string) BlockDeviceClaimInterface +} + +// BlockDeviceClaimInterface has methods to work with BlockDeviceClaim resources. +type BlockDeviceClaimInterface interface { + Create(*v1alpha1.BlockDeviceClaim) (*v1alpha1.BlockDeviceClaim, error) + Update(*v1alpha1.BlockDeviceClaim) (*v1alpha1.BlockDeviceClaim, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.BlockDeviceClaim, error) + List(opts v1.ListOptions) (*v1alpha1.BlockDeviceClaimList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BlockDeviceClaim, err error) + BlockDeviceClaimExpansion +} + +// blockDeviceClaims implements BlockDeviceClaimInterface +type blockDeviceClaims struct { + client rest.Interface + ns string +} + +// newBlockDeviceClaims returns a BlockDeviceClaims +func newBlockDeviceClaims(c *OpenebsV1alpha1Client, namespace string) *blockDeviceClaims { + return &blockDeviceClaims{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the blockDeviceClaim, and returns the corresponding blockDeviceClaim object, and an error if there is any. +func (c *blockDeviceClaims) Get(name string, options v1.GetOptions) (result *v1alpha1.BlockDeviceClaim, err error) { + result = &v1alpha1.BlockDeviceClaim{} + err = c.client.Get(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BlockDeviceClaims that match those selectors. +func (c *blockDeviceClaims) List(opts v1.ListOptions) (result *v1alpha1.BlockDeviceClaimList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.BlockDeviceClaimList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested blockDeviceClaims. +func (c *blockDeviceClaims) Watch(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("blockdeviceclaims"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a blockDeviceClaim and creates it. Returns the server's representation of the blockDeviceClaim, and an error, if there is any. +func (c *blockDeviceClaims) Create(blockDeviceClaim *v1alpha1.BlockDeviceClaim) (result *v1alpha1.BlockDeviceClaim, err error) { + result = &v1alpha1.BlockDeviceClaim{} + err = c.client.Post(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + Body(blockDeviceClaim). + Do(). + Into(result) + return +} + +// Update takes the representation of a blockDeviceClaim and updates it. Returns the server's representation of the blockDeviceClaim, and an error, if there is any. +func (c *blockDeviceClaims) Update(blockDeviceClaim *v1alpha1.BlockDeviceClaim) (result *v1alpha1.BlockDeviceClaim, err error) { + result = &v1alpha1.BlockDeviceClaim{} + err = c.client.Put(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + Name(blockDeviceClaim.Name). + Body(blockDeviceClaim). + Do(). + Into(result) + return +} + +// Delete takes name of the blockDeviceClaim and deletes it. Returns an error if one occurs. +func (c *blockDeviceClaims) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *blockDeviceClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("blockdeviceclaims"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched blockDeviceClaim. +func (c *blockDeviceClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BlockDeviceClaim, err error) { + result = &v1alpha1.BlockDeviceClaim{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("blockdeviceclaims"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdevice.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdevice.go index 0c3f625687..5adaa30fc3 100644 --- a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdevice.go +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdevice.go @@ -31,6 +31,7 @@ import ( // FakeBlockDevices implements BlockDeviceInterface type FakeBlockDevices struct { Fake *FakeOpenebsV1alpha1 + ns string } var blockdevicesResource = schema.GroupVersionResource{Group: "openebs.io", Version: "v1alpha1", Resource: "blockdevices"} @@ -40,7 +41,8 @@ var blockdevicesKind = schema.GroupVersionKind{Group: "openebs.io", Version: "v1 // Get takes name of the blockDevice, and returns the corresponding blockDevice object, and an error if there is any. func (c *FakeBlockDevices) Get(name string, options v1.GetOptions) (result *v1alpha1.BlockDevice, err error) { obj, err := c.Fake. - Invokes(testing.NewRootGetAction(blockdevicesResource, name), &v1alpha1.BlockDevice{}) + Invokes(testing.NewGetAction(blockdevicesResource, c.ns, name), &v1alpha1.BlockDevice{}) + if obj == nil { return nil, err } @@ -50,7 +52,8 @@ func (c *FakeBlockDevices) Get(name string, options v1.GetOptions) (result *v1al // List takes label and field selectors, and returns the list of BlockDevices that match those selectors. func (c *FakeBlockDevices) List(opts v1.ListOptions) (result *v1alpha1.BlockDeviceList, err error) { obj, err := c.Fake. - Invokes(testing.NewRootListAction(blockdevicesResource, blockdevicesKind, opts), &v1alpha1.BlockDeviceList{}) + Invokes(testing.NewListAction(blockdevicesResource, blockdevicesKind, c.ns, opts), &v1alpha1.BlockDeviceList{}) + if obj == nil { return nil, err } @@ -71,13 +74,15 @@ func (c *FakeBlockDevices) List(opts v1.ListOptions) (result *v1alpha1.BlockDevi // Watch returns a watch.Interface that watches the requested blockDevices. func (c *FakeBlockDevices) Watch(opts v1.ListOptions) (watch.Interface, error) { return c.Fake. - InvokesWatch(testing.NewRootWatchAction(blockdevicesResource, opts)) + InvokesWatch(testing.NewWatchAction(blockdevicesResource, c.ns, opts)) + } // Create takes the representation of a blockDevice and creates it. Returns the server's representation of the blockDevice, and an error, if there is any. func (c *FakeBlockDevices) Create(blockDevice *v1alpha1.BlockDevice) (result *v1alpha1.BlockDevice, err error) { obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(blockdevicesResource, blockDevice), &v1alpha1.BlockDevice{}) + Invokes(testing.NewCreateAction(blockdevicesResource, c.ns, blockDevice), &v1alpha1.BlockDevice{}) + if obj == nil { return nil, err } @@ -87,7 +92,8 @@ func (c *FakeBlockDevices) Create(blockDevice *v1alpha1.BlockDevice) (result *v1 // Update takes the representation of a blockDevice and updates it. Returns the server's representation of the blockDevice, and an error, if there is any. func (c *FakeBlockDevices) Update(blockDevice *v1alpha1.BlockDevice) (result *v1alpha1.BlockDevice, err error) { obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(blockdevicesResource, blockDevice), &v1alpha1.BlockDevice{}) + Invokes(testing.NewUpdateAction(blockdevicesResource, c.ns, blockDevice), &v1alpha1.BlockDevice{}) + if obj == nil { return nil, err } @@ -97,13 +103,14 @@ func (c *FakeBlockDevices) Update(blockDevice *v1alpha1.BlockDevice) (result *v1 // Delete takes name of the blockDevice and deletes it. Returns an error if one occurs. func (c *FakeBlockDevices) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(blockdevicesResource, name), &v1alpha1.BlockDevice{}) + Invokes(testing.NewDeleteAction(blockdevicesResource, c.ns, name), &v1alpha1.BlockDevice{}) + return err } // DeleteCollection deletes a collection of objects. func (c *FakeBlockDevices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(blockdevicesResource, listOptions) + action := testing.NewDeleteCollectionAction(blockdevicesResource, c.ns, listOptions) _, err := c.Fake.Invokes(action, &v1alpha1.BlockDeviceList{}) return err @@ -112,7 +119,8 @@ func (c *FakeBlockDevices) DeleteCollection(options *v1.DeleteOptions, listOptio // Patch applies the patch and returns the patched blockDevice. func (c *FakeBlockDevices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BlockDevice, err error) { obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(blockdevicesResource, name, pt, data, subresources...), &v1alpha1.BlockDevice{}) + Invokes(testing.NewPatchSubresourceAction(blockdevicesResource, c.ns, name, pt, data, subresources...), &v1alpha1.BlockDevice{}) + if obj == nil { return nil, err } diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdeviceclaim.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdeviceclaim.go new file mode 100644 index 0000000000..f391417762 --- /dev/null +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_blockdeviceclaim.go @@ -0,0 +1,128 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBlockDeviceClaims implements BlockDeviceClaimInterface +type FakeBlockDeviceClaims struct { + Fake *FakeOpenebsV1alpha1 + ns string +} + +var blockdeviceclaimsResource = schema.GroupVersionResource{Group: "openebs.io", Version: "v1alpha1", Resource: "blockdeviceclaims"} + +var blockdeviceclaimsKind = schema.GroupVersionKind{Group: "openebs.io", Version: "v1alpha1", Kind: "BlockDeviceClaim"} + +// Get takes name of the blockDeviceClaim, and returns the corresponding blockDeviceClaim object, and an error if there is any. +func (c *FakeBlockDeviceClaims) Get(name string, options v1.GetOptions) (result *v1alpha1.BlockDeviceClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(blockdeviceclaimsResource, c.ns, name), &v1alpha1.BlockDeviceClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BlockDeviceClaim), err +} + +// List takes label and field selectors, and returns the list of BlockDeviceClaims that match those selectors. +func (c *FakeBlockDeviceClaims) List(opts v1.ListOptions) (result *v1alpha1.BlockDeviceClaimList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(blockdeviceclaimsResource, blockdeviceclaimsKind, c.ns, opts), &v1alpha1.BlockDeviceClaimList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.BlockDeviceClaimList{ListMeta: obj.(*v1alpha1.BlockDeviceClaimList).ListMeta} + for _, item := range obj.(*v1alpha1.BlockDeviceClaimList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested blockDeviceClaims. +func (c *FakeBlockDeviceClaims) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(blockdeviceclaimsResource, c.ns, opts)) + +} + +// Create takes the representation of a blockDeviceClaim and creates it. Returns the server's representation of the blockDeviceClaim, and an error, if there is any. +func (c *FakeBlockDeviceClaims) Create(blockDeviceClaim *v1alpha1.BlockDeviceClaim) (result *v1alpha1.BlockDeviceClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(blockdeviceclaimsResource, c.ns, blockDeviceClaim), &v1alpha1.BlockDeviceClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BlockDeviceClaim), err +} + +// Update takes the representation of a blockDeviceClaim and updates it. Returns the server's representation of the blockDeviceClaim, and an error, if there is any. +func (c *FakeBlockDeviceClaims) Update(blockDeviceClaim *v1alpha1.BlockDeviceClaim) (result *v1alpha1.BlockDeviceClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(blockdeviceclaimsResource, c.ns, blockDeviceClaim), &v1alpha1.BlockDeviceClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BlockDeviceClaim), err +} + +// Delete takes name of the blockDeviceClaim and deletes it. Returns an error if one occurs. +func (c *FakeBlockDeviceClaims) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(blockdeviceclaimsResource, c.ns, name), &v1alpha1.BlockDeviceClaim{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBlockDeviceClaims) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(blockdeviceclaimsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.BlockDeviceClaimList{}) + return err +} + +// Patch applies the patch and returns the patched blockDeviceClaim. +func (c *FakeBlockDeviceClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BlockDeviceClaim, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(blockdeviceclaimsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BlockDeviceClaim{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.BlockDeviceClaim), err +} diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_openebs.io_client.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_openebs.io_client.go index 30f74bce89..a54ec9b2a4 100644 --- a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_openebs.io_client.go +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/fake/fake_openebs.io_client.go @@ -28,8 +28,12 @@ type FakeOpenebsV1alpha1 struct { *testing.Fake } -func (c *FakeOpenebsV1alpha1) BlockDevices() v1alpha1.BlockDeviceInterface { - return &FakeBlockDevices{c} +func (c *FakeOpenebsV1alpha1) BlockDevices(namespace string) v1alpha1.BlockDeviceInterface { + return &FakeBlockDevices{c, namespace} +} + +func (c *FakeOpenebsV1alpha1) BlockDeviceClaims(namespace string) v1alpha1.BlockDeviceClaimInterface { + return &FakeBlockDeviceClaims{c, namespace} } func (c *FakeOpenebsV1alpha1) CASTemplates() v1alpha1.CASTemplateInterface { diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/generated_expansion.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/generated_expansion.go index 2b2545b127..0f887aae20 100644 --- a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/generated_expansion.go +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/generated_expansion.go @@ -20,6 +20,8 @@ package v1alpha1 type BlockDeviceExpansion interface{} +type BlockDeviceClaimExpansion interface{} + type CASTemplateExpansion interface{} type CStorPoolExpansion interface{} diff --git a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/openebs.io_client.go b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/openebs.io_client.go index 40d0ac3523..7dc04c444e 100644 --- a/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/openebs.io_client.go +++ b/vendor/github.com/openebs/maya/pkg/client/clientset/versioned/typed/openebs.io/v1alpha1/openebs.io_client.go @@ -28,6 +28,7 @@ import ( type OpenebsV1alpha1Interface interface { RESTClient() rest.Interface BlockDevicesGetter + BlockDeviceClaimsGetter CASTemplatesGetter CStorPoolsGetter CStorVolumesGetter @@ -43,8 +44,12 @@ type OpenebsV1alpha1Client struct { restClient rest.Interface } -func (c *OpenebsV1alpha1Client) BlockDevices() BlockDeviceInterface { - return newBlockDevices(c) +func (c *OpenebsV1alpha1Client) BlockDevices(namespace string) BlockDeviceInterface { + return newBlockDevices(c, namespace) +} + +func (c *OpenebsV1alpha1Client) BlockDeviceClaims(namespace string) BlockDeviceClaimInterface { + return newBlockDeviceClaims(c, namespace) } func (c *OpenebsV1alpha1Client) CASTemplates() CASTemplateInterface { diff --git a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/generic.go b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/generic.go index 63ca798727..10bb7d64f2 100644 --- a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/generic.go +++ b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/generic.go @@ -55,6 +55,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=openebs.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("blockdevices"): return &genericInformer{resource: resource.GroupResource(), informer: f.Openebs().V1alpha1().BlockDevices().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("blockdeviceclaims"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Openebs().V1alpha1().BlockDeviceClaims().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("castemplates"): return &genericInformer{resource: resource.GroupResource(), informer: f.Openebs().V1alpha1().CASTemplates().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("cstorpools"): diff --git a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdevice.go b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdevice.go index 81b2664342..db3c722dfa 100644 --- a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdevice.go +++ b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdevice.go @@ -41,32 +41,33 @@ type BlockDeviceInformer interface { type blockDeviceInformer struct { factory internalinterfaces.SharedInformerFactory tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string } // NewBlockDeviceInformer constructs a new informer for BlockDevice 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 NewBlockDeviceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredBlockDeviceInformer(client, resyncPeriod, indexers, nil) +func NewBlockDeviceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBlockDeviceInformer(client, namespace, resyncPeriod, indexers, nil) } // NewFilteredBlockDeviceInformer constructs a new informer for BlockDevice 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 NewFilteredBlockDeviceInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { +func NewFilteredBlockDeviceInformer(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.OpenebsV1alpha1().BlockDevices().List(options) + return client.OpenebsV1alpha1().BlockDevices(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.OpenebsV1alpha1().BlockDevices().Watch(options) + return client.OpenebsV1alpha1().BlockDevices(namespace).Watch(options) }, }, &openebsiov1alpha1.BlockDevice{}, @@ -76,7 +77,7 @@ func NewFilteredBlockDeviceInformer(client versioned.Interface, resyncPeriod tim } func (f *blockDeviceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredBlockDeviceInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) + return NewFilteredBlockDeviceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) } func (f *blockDeviceInformer) Informer() cache.SharedIndexInformer { diff --git a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdeviceclaim.go b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdeviceclaim.go new file mode 100644 index 0000000000..3fc3ccf0f8 --- /dev/null +++ b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/blockdeviceclaim.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + time "time" + + openebsiov1alpha1 "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" + versioned "github.com/openebs/maya/pkg/client/clientset/versioned" + internalinterfaces "github.com/openebs/maya/pkg/client/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/openebs/maya/pkg/client/listers/openebs.io/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" +) + +// BlockDeviceClaimInformer provides access to a shared informer and lister for +// BlockDeviceClaims. +type BlockDeviceClaimInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.BlockDeviceClaimLister +} + +type blockDeviceClaimInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewBlockDeviceClaimInformer constructs a new informer for BlockDeviceClaim 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 NewBlockDeviceClaimInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredBlockDeviceClaimInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredBlockDeviceClaimInformer constructs a new informer for BlockDeviceClaim 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 NewFilteredBlockDeviceClaimInformer(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.OpenebsV1alpha1().BlockDeviceClaims(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.OpenebsV1alpha1().BlockDeviceClaims(namespace).Watch(options) + }, + }, + &openebsiov1alpha1.BlockDeviceClaim{}, + resyncPeriod, + indexers, + ) +} + +func (f *blockDeviceClaimInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredBlockDeviceClaimInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *blockDeviceClaimInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&openebsiov1alpha1.BlockDeviceClaim{}, f.defaultInformer) +} + +func (f *blockDeviceClaimInformer) Lister() v1alpha1.BlockDeviceClaimLister { + return v1alpha1.NewBlockDeviceClaimLister(f.Informer().GetIndexer()) +} diff --git a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/interface.go b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/interface.go index ec0e553a82..25a1169587 100644 --- a/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/interface.go +++ b/vendor/github.com/openebs/maya/pkg/client/informers/externalversions/openebs.io/v1alpha1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // BlockDevices returns a BlockDeviceInformer. BlockDevices() BlockDeviceInformer + // BlockDeviceClaims returns a BlockDeviceClaimInformer. + BlockDeviceClaims() BlockDeviceClaimInformer // CASTemplates returns a CASTemplateInformer. CASTemplates() CASTemplateInformer // CStorPools returns a CStorPoolInformer. @@ -57,7 +59,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList // BlockDevices returns a BlockDeviceInformer. func (v *version) BlockDevices() BlockDeviceInformer { - return &blockDeviceInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} + return &blockDeviceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + +// BlockDeviceClaims returns a BlockDeviceClaimInformer. +func (v *version) BlockDeviceClaims() BlockDeviceClaimInformer { + return &blockDeviceClaimInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } // CASTemplates returns a CASTemplateInformer. diff --git a/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdevice.go b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdevice.go index f10dc88bcd..314cc5a058 100644 --- a/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdevice.go +++ b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdevice.go @@ -29,8 +29,8 @@ import ( type BlockDeviceLister interface { // List lists all BlockDevices in the indexer. List(selector labels.Selector) (ret []*v1alpha1.BlockDevice, err error) - // Get retrieves the BlockDevice from the index for a given name. - Get(name string) (*v1alpha1.BlockDevice, error) + // BlockDevices returns an object that can list and get BlockDevices. + BlockDevices(namespace string) BlockDeviceNamespaceLister BlockDeviceListerExpansion } @@ -52,9 +52,38 @@ func (s *blockDeviceLister) List(selector labels.Selector) (ret []*v1alpha1.Bloc return ret, err } -// Get retrieves the BlockDevice from the index for a given name. -func (s *blockDeviceLister) Get(name string) (*v1alpha1.BlockDevice, error) { - obj, exists, err := s.indexer.GetByKey(name) +// BlockDevices returns an object that can list and get BlockDevices. +func (s *blockDeviceLister) BlockDevices(namespace string) BlockDeviceNamespaceLister { + return blockDeviceNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BlockDeviceNamespaceLister helps list and get BlockDevices. +type BlockDeviceNamespaceLister interface { + // List lists all BlockDevices in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.BlockDevice, err error) + // Get retrieves the BlockDevice from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.BlockDevice, error) + BlockDeviceNamespaceListerExpansion +} + +// blockDeviceNamespaceLister implements the BlockDeviceNamespaceLister +// interface. +type blockDeviceNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BlockDevices in the indexer for a given namespace. +func (s blockDeviceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BlockDevice, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BlockDevice)) + }) + return ret, err +} + +// Get retrieves the BlockDevice from the indexer for a given namespace and name. +func (s blockDeviceNamespaceLister) Get(name string) (*v1alpha1.BlockDevice, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } diff --git a/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdeviceclaim.go b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdeviceclaim.go new file mode 100644 index 0000000000..66c499e86c --- /dev/null +++ b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/blockdeviceclaim.go @@ -0,0 +1,94 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +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 lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// BlockDeviceClaimLister helps list BlockDeviceClaims. +type BlockDeviceClaimLister interface { + // List lists all BlockDeviceClaims in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.BlockDeviceClaim, err error) + // BlockDeviceClaims returns an object that can list and get BlockDeviceClaims. + BlockDeviceClaims(namespace string) BlockDeviceClaimNamespaceLister + BlockDeviceClaimListerExpansion +} + +// blockDeviceClaimLister implements the BlockDeviceClaimLister interface. +type blockDeviceClaimLister struct { + indexer cache.Indexer +} + +// NewBlockDeviceClaimLister returns a new BlockDeviceClaimLister. +func NewBlockDeviceClaimLister(indexer cache.Indexer) BlockDeviceClaimLister { + return &blockDeviceClaimLister{indexer: indexer} +} + +// List lists all BlockDeviceClaims in the indexer. +func (s *blockDeviceClaimLister) List(selector labels.Selector) (ret []*v1alpha1.BlockDeviceClaim, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BlockDeviceClaim)) + }) + return ret, err +} + +// BlockDeviceClaims returns an object that can list and get BlockDeviceClaims. +func (s *blockDeviceClaimLister) BlockDeviceClaims(namespace string) BlockDeviceClaimNamespaceLister { + return blockDeviceClaimNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// BlockDeviceClaimNamespaceLister helps list and get BlockDeviceClaims. +type BlockDeviceClaimNamespaceLister interface { + // List lists all BlockDeviceClaims in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.BlockDeviceClaim, err error) + // Get retrieves the BlockDeviceClaim from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.BlockDeviceClaim, error) + BlockDeviceClaimNamespaceListerExpansion +} + +// blockDeviceClaimNamespaceLister implements the BlockDeviceClaimNamespaceLister +// interface. +type blockDeviceClaimNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all BlockDeviceClaims in the indexer for a given namespace. +func (s blockDeviceClaimNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.BlockDeviceClaim, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.BlockDeviceClaim)) + }) + return ret, err +} + +// Get retrieves the BlockDeviceClaim from the indexer for a given namespace and name. +func (s blockDeviceClaimNamespaceLister) Get(name string) (*v1alpha1.BlockDeviceClaim, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("blockdeviceclaim"), name) + } + return obj.(*v1alpha1.BlockDeviceClaim), nil +} diff --git a/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/expansion_generated.go b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/expansion_generated.go index e77d650622..50162d5597 100644 --- a/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/expansion_generated.go +++ b/vendor/github.com/openebs/maya/pkg/client/listers/openebs.io/v1alpha1/expansion_generated.go @@ -22,6 +22,18 @@ package v1alpha1 // BlockDeviceLister. type BlockDeviceListerExpansion interface{} +// BlockDeviceNamespaceListerExpansion allows custom methods to be added to +// BlockDeviceNamespaceLister. +type BlockDeviceNamespaceListerExpansion interface{} + +// BlockDeviceClaimListerExpansion allows custom methods to be added to +// BlockDeviceClaimLister. +type BlockDeviceClaimListerExpansion interface{} + +// BlockDeviceClaimNamespaceListerExpansion allows custom methods to be added to +// BlockDeviceClaimNamespaceLister. +type BlockDeviceClaimNamespaceListerExpansion interface{} + // CASTemplateListerExpansion allows custom methods to be added to // CASTemplateLister. type CASTemplateListerExpansion interface{}