namespace: add new CRD
This introduces a new CRD to add the ability
to create rados namespace for a given
ceph block pool. Typically the name of the pool
is the name of the blockpool created by rook.
Closes: #7035
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit b0fc7c9b92)
This commit is contained in:
1 parent
1a5ed03ee5
commit
baa2c90568
33 files changed
+1857
-2
No files matched your search
@@ -27,6 +27,7 @@ import (
|
||||
type CephV1Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
CephBlockPoolsGetter
|
||||
CephBlockPoolRadosNamespacesGetter
|
||||
CephBucketNotificationsGetter
|
||||
CephBucketTopicsGetter
|
||||
CephClientsGetter
|
||||
@@ -52,6 +53,10 @@ func (c *CephV1Client) CephBlockPools(namespace string) CephBlockPoolInterface {
|
||||
return newCephBlockPools(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CephV1Client) CephBlockPoolRadosNamespaces(namespace string) CephBlockPoolRadosNamespaceInterface {
|
||||
return newCephBlockPoolRadosNamespaces(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CephV1Client) CephBucketNotifications(namespace string) CephBucketNotificationInterface {
|
||||
return newCephBucketNotifications(c, namespace)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
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 v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
v1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
scheme "github.com/rook/rook/pkg/client/clientset/versioned/scheme"
|
||||
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"
|
||||
)
|
||||
|
||||
// CephBlockPoolRadosNamespacesGetter has a method to return a CephBlockPoolRadosNamespaceInterface.
|
||||
// A group's client should implement this interface.
|
||||
type CephBlockPoolRadosNamespacesGetter interface {
|
||||
CephBlockPoolRadosNamespaces(namespace string) CephBlockPoolRadosNamespaceInterface
|
||||
}
|
||||
|
||||
// CephBlockPoolRadosNamespaceInterface has methods to work with CephBlockPoolRadosNamespace resources.
|
||||
type CephBlockPoolRadosNamespaceInterface interface {
|
||||
Create(ctx context.Context, cephBlockPoolRadosNamespace *v1.CephBlockPoolRadosNamespace, opts metav1.CreateOptions) (*v1.CephBlockPoolRadosNamespace, error)
|
||||
Update(ctx context.Context, cephBlockPoolRadosNamespace *v1.CephBlockPoolRadosNamespace, opts metav1.UpdateOptions) (*v1.CephBlockPoolRadosNamespace, error)
|
||||
Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error
|
||||
DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CephBlockPoolRadosNamespace, error)
|
||||
List(ctx context.Context, opts metav1.ListOptions) (*v1.CephBlockPoolRadosNamespaceList, error)
|
||||
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
|
||||
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CephBlockPoolRadosNamespace, err error)
|
||||
CephBlockPoolRadosNamespaceExpansion
|
||||
}
|
||||
|
||||
// cephBlockPoolRadosNamespaces implements CephBlockPoolRadosNamespaceInterface
|
||||
type cephBlockPoolRadosNamespaces struct {
|
||||
client rest.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newCephBlockPoolRadosNamespaces returns a CephBlockPoolRadosNamespaces
|
||||
func newCephBlockPoolRadosNamespaces(c *CephV1Client, namespace string) *cephBlockPoolRadosNamespaces {
|
||||
return &cephBlockPoolRadosNamespaces{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Get takes name of the cephBlockPoolRadosNamespace, and returns the corresponding cephBlockPoolRadosNamespace object, and an error if there is any.
|
||||
func (c *cephBlockPoolRadosNamespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CephBlockPoolRadosNamespace, err error) {
|
||||
result = &v1.CephBlockPoolRadosNamespace{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
Name(name).
|
||||
VersionedParams(&options, scheme.ParameterCodec).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of CephBlockPoolRadosNamespaces that match those selectors.
|
||||
func (c *cephBlockPoolRadosNamespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CephBlockPoolRadosNamespaceList, err error) {
|
||||
var timeout time.Duration
|
||||
if opts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
result = &v1.CephBlockPoolRadosNamespaceList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested cephBlockPoolRadosNamespaces.
|
||||
func (c *cephBlockPoolRadosNamespaces) Watch(ctx context.Context, opts metav1.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("cephblockpoolradosnamespaces").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Watch(ctx)
|
||||
}
|
||||
|
||||
// Create takes the representation of a cephBlockPoolRadosNamespace and creates it. Returns the server's representation of the cephBlockPoolRadosNamespace, and an error, if there is any.
|
||||
func (c *cephBlockPoolRadosNamespaces) Create(ctx context.Context, cephBlockPoolRadosNamespace *v1.CephBlockPoolRadosNamespace, opts metav1.CreateOptions) (result *v1.CephBlockPoolRadosNamespace, err error) {
|
||||
result = &v1.CephBlockPoolRadosNamespace{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cephBlockPoolRadosNamespace).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a cephBlockPoolRadosNamespace and updates it. Returns the server's representation of the cephBlockPoolRadosNamespace, and an error, if there is any.
|
||||
func (c *cephBlockPoolRadosNamespaces) Update(ctx context.Context, cephBlockPoolRadosNamespace *v1.CephBlockPoolRadosNamespace, opts metav1.UpdateOptions) (result *v1.CephBlockPoolRadosNamespace, err error) {
|
||||
result = &v1.CephBlockPoolRadosNamespace{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
Name(cephBlockPoolRadosNamespace.Name).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(cephBlockPoolRadosNamespace).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the cephBlockPoolRadosNamespace and deletes it. Returns an error if one occurs.
|
||||
func (c *cephBlockPoolRadosNamespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
Name(name).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *cephBlockPoolRadosNamespaces) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
var timeout time.Duration
|
||||
if listOpts.TimeoutSeconds != nil {
|
||||
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
|
||||
}
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
VersionedParams(&listOpts, scheme.ParameterCodec).
|
||||
Timeout(timeout).
|
||||
Body(&opts).
|
||||
Do(ctx).
|
||||
Error()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cephBlockPoolRadosNamespace.
|
||||
func (c *cephBlockPoolRadosNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CephBlockPoolRadosNamespace, err error) {
|
||||
result = &v1.CephBlockPoolRadosNamespace{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("cephblockpoolradosnamespaces").
|
||||
Name(name).
|
||||
SubResource(subresources...).
|
||||
VersionedParams(&opts, scheme.ParameterCodec).
|
||||
Body(data).
|
||||
Do(ctx).
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
@@ -32,6 +32,10 @@ func (c *FakeCephV1) CephBlockPools(namespace string) v1.CephBlockPoolInterface
|
||||
return &FakeCephBlockPools{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCephV1) CephBlockPoolRadosNamespaces(namespace string) v1.CephBlockPoolRadosNamespaceInterface {
|
||||
return &FakeCephBlockPoolRadosNamespaces{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCephV1) CephBucketNotifications(namespace string) v1.CephBucketNotificationInterface {
|
||||
return &FakeCephBucketNotifications{c, namespace}
|
||||
}
|
||||
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
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 (
|
||||
"context"
|
||||
|
||||
cephrookiov1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
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"
|
||||
)
|
||||
|
||||
// FakeCephBlockPoolRadosNamespaces implements CephBlockPoolRadosNamespaceInterface
|
||||
type FakeCephBlockPoolRadosNamespaces struct {
|
||||
Fake *FakeCephV1
|
||||
ns string
|
||||
}
|
||||
|
||||
var cephblockpoolradosnamespacesResource = schema.GroupVersionResource{Group: "ceph.rook.io", Version: "v1", Resource: "cephblockpoolradosnamespaces"}
|
||||
|
||||
var cephblockpoolradosnamespacesKind = schema.GroupVersionKind{Group: "ceph.rook.io", Version: "v1", Kind: "CephBlockPoolRadosNamespace"}
|
||||
|
||||
// Get takes name of the cephBlockPoolRadosNamespace, and returns the corresponding cephBlockPoolRadosNamespace object, and an error if there is any.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *cephrookiov1.CephBlockPoolRadosNamespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewGetAction(cephblockpoolradosnamespacesResource, c.ns, name), &cephrookiov1.CephBlockPoolRadosNamespace{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*cephrookiov1.CephBlockPoolRadosNamespace), err
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of CephBlockPoolRadosNamespaces that match those selectors.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) List(ctx context.Context, opts v1.ListOptions) (result *cephrookiov1.CephBlockPoolRadosNamespaceList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewListAction(cephblockpoolradosnamespacesResource, cephblockpoolradosnamespacesKind, c.ns, opts), &cephrookiov1.CephBlockPoolRadosNamespaceList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := testing.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &cephrookiov1.CephBlockPoolRadosNamespaceList{ListMeta: obj.(*cephrookiov1.CephBlockPoolRadosNamespaceList).ListMeta}
|
||||
for _, item := range obj.(*cephrookiov1.CephBlockPoolRadosNamespaceList).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 cephBlockPoolRadosNamespaces.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(testing.NewWatchAction(cephblockpoolradosnamespacesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Create takes the representation of a cephBlockPoolRadosNamespace and creates it. Returns the server's representation of the cephBlockPoolRadosNamespace, and an error, if there is any.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Create(ctx context.Context, cephBlockPoolRadosNamespace *cephrookiov1.CephBlockPoolRadosNamespace, opts v1.CreateOptions) (result *cephrookiov1.CephBlockPoolRadosNamespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewCreateAction(cephblockpoolradosnamespacesResource, c.ns, cephBlockPoolRadosNamespace), &cephrookiov1.CephBlockPoolRadosNamespace{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*cephrookiov1.CephBlockPoolRadosNamespace), err
|
||||
}
|
||||
|
||||
// Update takes the representation of a cephBlockPoolRadosNamespace and updates it. Returns the server's representation of the cephBlockPoolRadosNamespace, and an error, if there is any.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Update(ctx context.Context, cephBlockPoolRadosNamespace *cephrookiov1.CephBlockPoolRadosNamespace, opts v1.UpdateOptions) (result *cephrookiov1.CephBlockPoolRadosNamespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewUpdateAction(cephblockpoolradosnamespacesResource, c.ns, cephBlockPoolRadosNamespace), &cephrookiov1.CephBlockPoolRadosNamespace{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*cephrookiov1.CephBlockPoolRadosNamespace), err
|
||||
}
|
||||
|
||||
// Delete takes name of the cephBlockPoolRadosNamespace and deletes it. Returns an error if one occurs.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(testing.NewDeleteAction(cephblockpoolradosnamespacesResource, c.ns, name), &cephrookiov1.CephBlockPoolRadosNamespace{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
|
||||
action := testing.NewDeleteCollectionAction(cephblockpoolradosnamespacesResource, c.ns, listOpts)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &cephrookiov1.CephBlockPoolRadosNamespaceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cephBlockPoolRadosNamespace.
|
||||
func (c *FakeCephBlockPoolRadosNamespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *cephrookiov1.CephBlockPoolRadosNamespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(testing.NewPatchSubresourceAction(cephblockpoolradosnamespacesResource, c.ns, name, pt, data, subresources...), &cephrookiov1.CephBlockPoolRadosNamespace{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*cephrookiov1.CephBlockPoolRadosNamespace), err
|
||||
}
|
||||
@@ -20,6 +20,8 @@ package v1
|
||||
|
||||
type CephBlockPoolExpansion interface{}
|
||||
|
||||
type CephBlockPoolRadosNamespaceExpansion interface{}
|
||||
|
||||
type CephBucketNotificationExpansion interface{}
|
||||
|
||||
type CephBucketTopicExpansion interface{}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
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 v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
time "time"
|
||||
|
||||
cephrookiov1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
versioned "github.com/rook/rook/pkg/client/clientset/versioned"
|
||||
internalinterfaces "github.com/rook/rook/pkg/client/informers/externalversions/internalinterfaces"
|
||||
v1 "github.com/rook/rook/pkg/client/listers/ceph.rook.io/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"
|
||||
)
|
||||
|
||||
// CephBlockPoolRadosNamespaceInformer provides access to a shared informer and lister for
|
||||
// CephBlockPoolRadosNamespaces.
|
||||
type CephBlockPoolRadosNamespaceInformer interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() v1.CephBlockPoolRadosNamespaceLister
|
||||
}
|
||||
|
||||
type cephBlockPoolRadosNamespaceInformer struct {
|
||||
factory internalinterfaces.SharedInformerFactory
|
||||
tweakListOptions internalinterfaces.TweakListOptionsFunc
|
||||
namespace string
|
||||
}
|
||||
|
||||
// NewCephBlockPoolRadosNamespaceInformer constructs a new informer for CephBlockPoolRadosNamespace 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 NewCephBlockPoolRadosNamespaceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
|
||||
return NewFilteredCephBlockPoolRadosNamespaceInformer(client, namespace, resyncPeriod, indexers, nil)
|
||||
}
|
||||
|
||||
// NewFilteredCephBlockPoolRadosNamespaceInformer constructs a new informer for CephBlockPoolRadosNamespace 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 NewFilteredCephBlockPoolRadosNamespaceInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
|
||||
return cache.NewSharedIndexInformer(
|
||||
&cache.ListWatch{
|
||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CephV1().CephBlockPoolRadosNamespaces(namespace).List(context.TODO(), options)
|
||||
},
|
||||
WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) {
|
||||
if tweakListOptions != nil {
|
||||
tweakListOptions(&options)
|
||||
}
|
||||
return client.CephV1().CephBlockPoolRadosNamespaces(namespace).Watch(context.TODO(), options)
|
||||
},
|
||||
},
|
||||
&cephrookiov1.CephBlockPoolRadosNamespace{},
|
||||
resyncPeriod,
|
||||
indexers,
|
||||
)
|
||||
}
|
||||
|
||||
func (f *cephBlockPoolRadosNamespaceInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
|
||||
return NewFilteredCephBlockPoolRadosNamespaceInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
|
||||
}
|
||||
|
||||
func (f *cephBlockPoolRadosNamespaceInformer) Informer() cache.SharedIndexInformer {
|
||||
return f.factory.InformerFor(&cephrookiov1.CephBlockPoolRadosNamespace{}, f.defaultInformer)
|
||||
}
|
||||
|
||||
func (f *cephBlockPoolRadosNamespaceInformer) Lister() v1.CephBlockPoolRadosNamespaceLister {
|
||||
return v1.NewCephBlockPoolRadosNamespaceLister(f.Informer().GetIndexer())
|
||||
}
|
||||
@@ -26,6 +26,8 @@ import (
|
||||
type Interface interface {
|
||||
// CephBlockPools returns a CephBlockPoolInformer.
|
||||
CephBlockPools() CephBlockPoolInformer
|
||||
// CephBlockPoolRadosNamespaces returns a CephBlockPoolRadosNamespaceInformer.
|
||||
CephBlockPoolRadosNamespaces() CephBlockPoolRadosNamespaceInformer
|
||||
// CephBucketNotifications returns a CephBucketNotificationInformer.
|
||||
CephBucketNotifications() CephBucketNotificationInformer
|
||||
// CephBucketTopics returns a CephBucketTopicInformer.
|
||||
@@ -72,6 +74,11 @@ func (v *version) CephBlockPools() CephBlockPoolInformer {
|
||||
return &cephBlockPoolInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// CephBlockPoolRadosNamespaces returns a CephBlockPoolRadosNamespaceInformer.
|
||||
func (v *version) CephBlockPoolRadosNamespaces() CephBlockPoolRadosNamespaceInformer {
|
||||
return &cephBlockPoolRadosNamespaceInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
}
|
||||
|
||||
// CephBucketNotifications returns a CephBucketNotificationInformer.
|
||||
func (v *version) CephBucketNotifications() CephBucketNotificationInformer {
|
||||
return &cephBucketNotificationInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions}
|
||||
|
||||
@@ -55,6 +55,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
|
||||
// Group=ceph.rook.io, Version=v1
|
||||
case v1.SchemeGroupVersion.WithResource("cephblockpools"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ceph().V1().CephBlockPools().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("cephblockpoolradosnamespaces"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ceph().V1().CephBlockPoolRadosNamespaces().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("cephbucketnotifications"):
|
||||
return &genericInformer{resource: resource.GroupResource(), informer: f.Ceph().V1().CephBucketNotifications().Informer()}, nil
|
||||
case v1.SchemeGroupVersion.WithResource("cephbuckettopics"):
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
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 v1
|
||||
|
||||
import (
|
||||
v1 "github.com/rook/rook/pkg/apis/ceph.rook.io/v1"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
// CephBlockPoolRadosNamespaceLister helps list CephBlockPoolRadosNamespaces.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type CephBlockPoolRadosNamespaceLister interface {
|
||||
// List lists all CephBlockPoolRadosNamespaces in the indexer.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1.CephBlockPoolRadosNamespace, err error)
|
||||
// CephBlockPoolRadosNamespaces returns an object that can list and get CephBlockPoolRadosNamespaces.
|
||||
CephBlockPoolRadosNamespaces(namespace string) CephBlockPoolRadosNamespaceNamespaceLister
|
||||
CephBlockPoolRadosNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// cephBlockPoolRadosNamespaceLister implements the CephBlockPoolRadosNamespaceLister interface.
|
||||
type cephBlockPoolRadosNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
}
|
||||
|
||||
// NewCephBlockPoolRadosNamespaceLister returns a new CephBlockPoolRadosNamespaceLister.
|
||||
func NewCephBlockPoolRadosNamespaceLister(indexer cache.Indexer) CephBlockPoolRadosNamespaceLister {
|
||||
return &cephBlockPoolRadosNamespaceLister{indexer: indexer}
|
||||
}
|
||||
|
||||
// List lists all CephBlockPoolRadosNamespaces in the indexer.
|
||||
func (s *cephBlockPoolRadosNamespaceLister) List(selector labels.Selector) (ret []*v1.CephBlockPoolRadosNamespace, err error) {
|
||||
err = cache.ListAll(s.indexer, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.CephBlockPoolRadosNamespace))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// CephBlockPoolRadosNamespaces returns an object that can list and get CephBlockPoolRadosNamespaces.
|
||||
func (s *cephBlockPoolRadosNamespaceLister) CephBlockPoolRadosNamespaces(namespace string) CephBlockPoolRadosNamespaceNamespaceLister {
|
||||
return cephBlockPoolRadosNamespaceNamespaceLister{indexer: s.indexer, namespace: namespace}
|
||||
}
|
||||
|
||||
// CephBlockPoolRadosNamespaceNamespaceLister helps list and get CephBlockPoolRadosNamespaces.
|
||||
// All objects returned here must be treated as read-only.
|
||||
type CephBlockPoolRadosNamespaceNamespaceLister interface {
|
||||
// List lists all CephBlockPoolRadosNamespaces in the indexer for a given namespace.
|
||||
// Objects returned here must be treated as read-only.
|
||||
List(selector labels.Selector) (ret []*v1.CephBlockPoolRadosNamespace, err error)
|
||||
// Get retrieves the CephBlockPoolRadosNamespace from the indexer for a given namespace and name.
|
||||
// Objects returned here must be treated as read-only.
|
||||
Get(name string) (*v1.CephBlockPoolRadosNamespace, error)
|
||||
CephBlockPoolRadosNamespaceNamespaceListerExpansion
|
||||
}
|
||||
|
||||
// cephBlockPoolRadosNamespaceNamespaceLister implements the CephBlockPoolRadosNamespaceNamespaceLister
|
||||
// interface.
|
||||
type cephBlockPoolRadosNamespaceNamespaceLister struct {
|
||||
indexer cache.Indexer
|
||||
namespace string
|
||||
}
|
||||
|
||||
// List lists all CephBlockPoolRadosNamespaces in the indexer for a given namespace.
|
||||
func (s cephBlockPoolRadosNamespaceNamespaceLister) List(selector labels.Selector) (ret []*v1.CephBlockPoolRadosNamespace, err error) {
|
||||
err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
|
||||
ret = append(ret, m.(*v1.CephBlockPoolRadosNamespace))
|
||||
})
|
||||
return ret, err
|
||||
}
|
||||
|
||||
// Get retrieves the CephBlockPoolRadosNamespace from the indexer for a given namespace and name.
|
||||
func (s cephBlockPoolRadosNamespaceNamespaceLister) Get(name string) (*v1.CephBlockPoolRadosNamespace, error) {
|
||||
obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(v1.Resource("cephblockpoolradosnamespace"), name)
|
||||
}
|
||||
return obj.(*v1.CephBlockPoolRadosNamespace), nil
|
||||
}
|
||||
@@ -26,6 +26,14 @@ type CephBlockPoolListerExpansion interface{}
|
||||
// CephBlockPoolNamespaceLister.
|
||||
type CephBlockPoolNamespaceListerExpansion interface{}
|
||||
|
||||
// CephBlockPoolRadosNamespaceListerExpansion allows custom methods to be added to
|
||||
// CephBlockPoolRadosNamespaceLister.
|
||||
type CephBlockPoolRadosNamespaceListerExpansion interface{}
|
||||
|
||||
// CephBlockPoolRadosNamespaceNamespaceListerExpansion allows custom methods to be added to
|
||||
// CephBlockPoolRadosNamespaceNamespaceLister.
|
||||
type CephBlockPoolRadosNamespaceNamespaceListerExpansion interface{}
|
||||
|
||||
// CephBucketNotificationListerExpansion allows custom methods to be added to
|
||||
// CephBucketNotificationLister.
|
||||
type CephBucketNotificationListerExpansion interface{}
|
||||
|
||||
Reference in new issue
Block a user