mirror of
https://github.com/rancher/types.git
synced 2025-09-18 16:10:58 +00:00
Generated changes
This commit is contained in:
committed by
Alena Prokharchyk
parent
eb49d0d119
commit
35e65403b5
@@ -0,0 +1,440 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
CatalogTemplateGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "CatalogTemplate",
|
||||
}
|
||||
CatalogTemplateResource = metav1.APIResource{
|
||||
Name: "catalogtemplates",
|
||||
SingularName: "catalogtemplate",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: CatalogTemplateGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewCatalogTemplate(namespace, name string, obj CatalogTemplate) *CatalogTemplate {
|
||||
obj.APIVersion, obj.Kind = CatalogTemplateGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type CatalogTemplateList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []CatalogTemplate
|
||||
}
|
||||
|
||||
type CatalogTemplateHandlerFunc func(key string, obj *CatalogTemplate) (runtime.Object, error)
|
||||
|
||||
type CatalogTemplateChangeHandlerFunc func(obj *CatalogTemplate) (runtime.Object, error)
|
||||
|
||||
type CatalogTemplateLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*CatalogTemplate, err error)
|
||||
Get(namespace, name string) (*CatalogTemplate, error)
|
||||
}
|
||||
|
||||
type CatalogTemplateController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() CatalogTemplateLister
|
||||
AddHandler(ctx context.Context, name string, handler CatalogTemplateHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CatalogTemplateHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type CatalogTemplateInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*CatalogTemplate) (*CatalogTemplate, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error)
|
||||
Get(name string, opts metav1.GetOptions) (*CatalogTemplate, error)
|
||||
Update(*CatalogTemplate) (*CatalogTemplate, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*CatalogTemplateList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() CatalogTemplateController
|
||||
AddHandler(ctx context.Context, name string, sync CatalogTemplateHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateLifecycle)
|
||||
}
|
||||
|
||||
type catalogTemplateLister struct {
|
||||
controller *catalogTemplateController
|
||||
}
|
||||
|
||||
func (l *catalogTemplateLister) List(namespace string, selector labels.Selector) (ret []*CatalogTemplate, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*CatalogTemplate))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *catalogTemplateLister) Get(namespace, name string) (*CatalogTemplate, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: CatalogTemplateGroupVersionKind.Group,
|
||||
Resource: "catalogTemplate",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*CatalogTemplate), nil
|
||||
}
|
||||
|
||||
type catalogTemplateController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *catalogTemplateController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *catalogTemplateController) Lister() CatalogTemplateLister {
|
||||
return &catalogTemplateLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *catalogTemplateController) AddHandler(ctx context.Context, name string, handler CatalogTemplateHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CatalogTemplate); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *catalogTemplateController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CatalogTemplateHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CatalogTemplate); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type catalogTemplateFactory struct {
|
||||
}
|
||||
|
||||
func (c catalogTemplateFactory) Object() runtime.Object {
|
||||
return &CatalogTemplate{}
|
||||
}
|
||||
|
||||
func (c catalogTemplateFactory) List() runtime.Object {
|
||||
return &CatalogTemplateList{}
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Controller() CatalogTemplateController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.catalogTemplateControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(CatalogTemplateGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &catalogTemplateController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.catalogTemplateControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type catalogTemplateClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller CatalogTemplateController
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Create(o *CatalogTemplate) (*CatalogTemplate, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*CatalogTemplate), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Get(name string, opts metav1.GetOptions) (*CatalogTemplate, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*CatalogTemplate), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*CatalogTemplate), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Update(o *CatalogTemplate) (*CatalogTemplate, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*CatalogTemplate), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) List(opts metav1.ListOptions) (*CatalogTemplateList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*CatalogTemplateList), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *catalogTemplateClient) Patch(o *CatalogTemplate, patchType types.PatchType, data []byte, subresources ...string) (*CatalogTemplate, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*CatalogTemplate), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) AddHandler(ctx context.Context, name string, sync CatalogTemplateHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateLifecycle) {
|
||||
sync := NewCatalogTemplateLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateLifecycle) {
|
||||
sync := NewCatalogTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type CatalogTemplateIndexer func(obj *CatalogTemplate) ([]string, error)
|
||||
|
||||
type CatalogTemplateClientCache interface {
|
||||
Get(namespace, name string) (*CatalogTemplate, error)
|
||||
List(namespace string, selector labels.Selector) ([]*CatalogTemplate, error)
|
||||
|
||||
Index(name string, indexer CatalogTemplateIndexer)
|
||||
GetIndexed(name, key string) ([]*CatalogTemplate, error)
|
||||
}
|
||||
|
||||
type CatalogTemplateClient interface {
|
||||
Create(*CatalogTemplate) (*CatalogTemplate, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error)
|
||||
Update(*CatalogTemplate) (*CatalogTemplate, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*CatalogTemplateList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() CatalogTemplateClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() CatalogTemplateInterface
|
||||
}
|
||||
|
||||
type catalogTemplateClientCache struct {
|
||||
client *catalogTemplateClient2
|
||||
}
|
||||
|
||||
type catalogTemplateClient2 struct {
|
||||
iface CatalogTemplateInterface
|
||||
controller CatalogTemplateController
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Interface() CatalogTemplateInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Create(obj *CatalogTemplate) (*CatalogTemplate, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Get(namespace, name string, opts metav1.GetOptions) (*CatalogTemplate, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Update(obj *CatalogTemplate) (*CatalogTemplate, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) List(namespace string, opts metav1.ListOptions) (*CatalogTemplateList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClientCache) Get(namespace, name string) (*CatalogTemplate, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClientCache) List(namespace string, selector labels.Selector) ([]*CatalogTemplate, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) Cache() CatalogTemplateClientCache {
|
||||
n.loadController()
|
||||
return &catalogTemplateClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) OnCreate(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &catalogTemplateLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) OnChange(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &catalogTemplateLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) OnRemove(ctx context.Context, name string, sync CatalogTemplateChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &catalogTemplateLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClientCache) Index(name string, indexer CatalogTemplateIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*CatalogTemplate); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClientCache) GetIndexed(name, key string) ([]*CatalogTemplate, error) {
|
||||
var result []*CatalogTemplate
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*CatalogTemplate); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type catalogTemplateLifecycleDelegate struct {
|
||||
create CatalogTemplateChangeHandlerFunc
|
||||
update CatalogTemplateChangeHandlerFunc
|
||||
remove CatalogTemplateChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *catalogTemplateLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateLifecycleDelegate) Create(obj *CatalogTemplate) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateLifecycleDelegate) Remove(obj *CatalogTemplate) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateLifecycleDelegate) Updated(obj *CatalogTemplate) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type CatalogTemplateLifecycle interface {
|
||||
Create(obj *CatalogTemplate) (runtime.Object, error)
|
||||
Remove(obj *CatalogTemplate) (runtime.Object, error)
|
||||
Updated(obj *CatalogTemplate) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type catalogTemplateLifecycleAdapter struct {
|
||||
lifecycle CatalogTemplateLifecycle
|
||||
}
|
||||
|
||||
func (w *catalogTemplateLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *catalogTemplateLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *catalogTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*CatalogTemplate))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *catalogTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*CatalogTemplate))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *catalogTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*CatalogTemplate))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewCatalogTemplateLifecycleAdapter(name string, clusterScoped bool, client CatalogTemplateInterface, l CatalogTemplateLifecycle) CatalogTemplateHandlerFunc {
|
||||
adapter := &catalogTemplateLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *CatalogTemplate) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@@ -0,0 +1,440 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"k8s.io/apimachinery/pkg/api/errors"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
"k8s.io/apimachinery/pkg/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
CatalogTemplateVersionGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "CatalogTemplateVersion",
|
||||
}
|
||||
CatalogTemplateVersionResource = metav1.APIResource{
|
||||
Name: "catalogtemplateversions",
|
||||
SingularName: "catalogtemplateversion",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: CatalogTemplateVersionGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewCatalogTemplateVersion(namespace, name string, obj CatalogTemplateVersion) *CatalogTemplateVersion {
|
||||
obj.APIVersion, obj.Kind = CatalogTemplateVersionGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []CatalogTemplateVersion
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionHandlerFunc func(key string, obj *CatalogTemplateVersion) (runtime.Object, error)
|
||||
|
||||
type CatalogTemplateVersionChangeHandlerFunc func(obj *CatalogTemplateVersion) (runtime.Object, error)
|
||||
|
||||
type CatalogTemplateVersionLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*CatalogTemplateVersion, err error)
|
||||
Get(namespace, name string) (*CatalogTemplateVersion, error)
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() CatalogTemplateVersionLister
|
||||
AddHandler(ctx context.Context, name string, handler CatalogTemplateVersionHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CatalogTemplateVersionHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*CatalogTemplateVersion) (*CatalogTemplateVersion, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error)
|
||||
Get(name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error)
|
||||
Update(*CatalogTemplateVersion) (*CatalogTemplateVersion, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*CatalogTemplateVersionList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() CatalogTemplateVersionController
|
||||
AddHandler(ctx context.Context, name string, sync CatalogTemplateVersionHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateVersionLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateVersionHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle)
|
||||
}
|
||||
|
||||
type catalogTemplateVersionLister struct {
|
||||
controller *catalogTemplateVersionController
|
||||
}
|
||||
|
||||
func (l *catalogTemplateVersionLister) List(namespace string, selector labels.Selector) (ret []*CatalogTemplateVersion, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*CatalogTemplateVersion))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *catalogTemplateVersionLister) Get(namespace, name string) (*CatalogTemplateVersion, error) {
|
||||
var key string
|
||||
if namespace != "" {
|
||||
key = namespace + "/" + name
|
||||
} else {
|
||||
key = name
|
||||
}
|
||||
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !exists {
|
||||
return nil, errors.NewNotFound(schema.GroupResource{
|
||||
Group: CatalogTemplateVersionGroupVersionKind.Group,
|
||||
Resource: "catalogTemplateVersion",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*CatalogTemplateVersion), nil
|
||||
}
|
||||
|
||||
type catalogTemplateVersionController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *catalogTemplateVersionController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *catalogTemplateVersionController) Lister() CatalogTemplateVersionLister {
|
||||
return &catalogTemplateVersionLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *catalogTemplateVersionController) AddHandler(ctx context.Context, name string, handler CatalogTemplateVersionHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CatalogTemplateVersion); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *catalogTemplateVersionController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CatalogTemplateVersionHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CatalogTemplateVersion); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type catalogTemplateVersionFactory struct {
|
||||
}
|
||||
|
||||
func (c catalogTemplateVersionFactory) Object() runtime.Object {
|
||||
return &CatalogTemplateVersion{}
|
||||
}
|
||||
|
||||
func (c catalogTemplateVersionFactory) List() runtime.Object {
|
||||
return &CatalogTemplateVersionList{}
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Controller() CatalogTemplateVersionController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.catalogTemplateVersionControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(CatalogTemplateVersionGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &catalogTemplateVersionController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.catalogTemplateVersionControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type catalogTemplateVersionClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller CatalogTemplateVersionController
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Create(o *CatalogTemplateVersion) (*CatalogTemplateVersion, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*CatalogTemplateVersion), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Get(name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*CatalogTemplateVersion), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*CatalogTemplateVersion), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Update(o *CatalogTemplateVersion) (*CatalogTemplateVersion, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*CatalogTemplateVersion), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) List(opts metav1.ListOptions) (*CatalogTemplateVersionList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*CatalogTemplateVersionList), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *catalogTemplateVersionClient) Patch(o *CatalogTemplateVersion, patchType types.PatchType, data []byte, subresources ...string) (*CatalogTemplateVersion, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*CatalogTemplateVersion), err
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) AddHandler(ctx context.Context, name string, sync CatalogTemplateVersionHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) AddLifecycle(ctx context.Context, name string, lifecycle CatalogTemplateVersionLifecycle) {
|
||||
sync := NewCatalogTemplateVersionLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CatalogTemplateVersionHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *catalogTemplateVersionClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CatalogTemplateVersionLifecycle) {
|
||||
sync := NewCatalogTemplateVersionLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionIndexer func(obj *CatalogTemplateVersion) ([]string, error)
|
||||
|
||||
type CatalogTemplateVersionClientCache interface {
|
||||
Get(namespace, name string) (*CatalogTemplateVersion, error)
|
||||
List(namespace string, selector labels.Selector) ([]*CatalogTemplateVersion, error)
|
||||
|
||||
Index(name string, indexer CatalogTemplateVersionIndexer)
|
||||
GetIndexed(name, key string) ([]*CatalogTemplateVersion, error)
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionClient interface {
|
||||
Create(*CatalogTemplateVersion) (*CatalogTemplateVersion, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error)
|
||||
Update(*CatalogTemplateVersion) (*CatalogTemplateVersion, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*CatalogTemplateVersionList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() CatalogTemplateVersionClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() CatalogTemplateVersionInterface
|
||||
}
|
||||
|
||||
type catalogTemplateVersionClientCache struct {
|
||||
client *catalogTemplateVersionClient2
|
||||
}
|
||||
|
||||
type catalogTemplateVersionClient2 struct {
|
||||
iface CatalogTemplateVersionInterface
|
||||
controller CatalogTemplateVersionController
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Interface() CatalogTemplateVersionInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Create(obj *CatalogTemplateVersion) (*CatalogTemplateVersion, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Get(namespace, name string, opts metav1.GetOptions) (*CatalogTemplateVersion, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Update(obj *CatalogTemplateVersion) (*CatalogTemplateVersion, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) List(namespace string, opts metav1.ListOptions) (*CatalogTemplateVersionList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClientCache) Get(namespace, name string) (*CatalogTemplateVersion, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClientCache) List(namespace string, selector labels.Selector) ([]*CatalogTemplateVersion, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) Cache() CatalogTemplateVersionClientCache {
|
||||
n.loadController()
|
||||
return &catalogTemplateVersionClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) OnCreate(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &catalogTemplateVersionLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) OnChange(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &catalogTemplateVersionLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) OnRemove(ctx context.Context, name string, sync CatalogTemplateVersionChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &catalogTemplateVersionLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClientCache) Index(name string, indexer CatalogTemplateVersionIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*CatalogTemplateVersion); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClientCache) GetIndexed(name, key string) ([]*CatalogTemplateVersion, error) {
|
||||
var result []*CatalogTemplateVersion
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*CatalogTemplateVersion); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type catalogTemplateVersionLifecycleDelegate struct {
|
||||
create CatalogTemplateVersionChangeHandlerFunc
|
||||
update CatalogTemplateVersionChangeHandlerFunc
|
||||
remove CatalogTemplateVersionChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionLifecycleDelegate) Create(obj *CatalogTemplateVersion) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionLifecycleDelegate) Remove(obj *CatalogTemplateVersion) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *catalogTemplateVersionLifecycleDelegate) Updated(obj *CatalogTemplateVersion) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
@@ -0,0 +1,62 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type CatalogTemplateVersionLifecycle interface {
|
||||
Create(obj *CatalogTemplateVersion) (runtime.Object, error)
|
||||
Remove(obj *CatalogTemplateVersion) (runtime.Object, error)
|
||||
Updated(obj *CatalogTemplateVersion) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type catalogTemplateVersionLifecycleAdapter struct {
|
||||
lifecycle CatalogTemplateVersionLifecycle
|
||||
}
|
||||
|
||||
func (w *catalogTemplateVersionLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *catalogTemplateVersionLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *catalogTemplateVersionLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*CatalogTemplateVersion))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *catalogTemplateVersionLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*CatalogTemplateVersion))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *catalogTemplateVersionLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*CatalogTemplateVersion))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewCatalogTemplateVersionLifecycleAdapter(name string, clusterScoped bool, client CatalogTemplateVersionInterface, l CatalogTemplateVersionLifecycle) CatalogTemplateVersionHandlerFunc {
|
||||
adapter := &catalogTemplateVersionLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *CatalogTemplateVersion) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@@ -662,6 +662,128 @@ func (in *CatalogStatus) DeepCopy() *CatalogStatus {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CatalogTemplate) DeepCopyInto(out *CatalogTemplate) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.Template.DeepCopyInto(&out.Template)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplate.
|
||||
func (in *CatalogTemplate) DeepCopy() *CatalogTemplate {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CatalogTemplate)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CatalogTemplate) 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 *CatalogTemplateList) DeepCopyInto(out *CatalogTemplateList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]CatalogTemplate, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateList.
|
||||
func (in *CatalogTemplateList) DeepCopy() *CatalogTemplateList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CatalogTemplateList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CatalogTemplateList) 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 *CatalogTemplateVersion) DeepCopyInto(out *CatalogTemplateVersion) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
in.TemplateVersion.DeepCopyInto(&out.TemplateVersion)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateVersion.
|
||||
func (in *CatalogTemplateVersion) DeepCopy() *CatalogTemplateVersion {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CatalogTemplateVersion)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CatalogTemplateVersion) 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 *CatalogTemplateVersionList) DeepCopyInto(out *CatalogTemplateVersionList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]CatalogTemplateVersion, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogTemplateVersionList.
|
||||
func (in *CatalogTemplateVersionList) DeepCopy() *CatalogTemplateVersionList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CatalogTemplateVersionList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CatalogTemplateVersionList) 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 *ChangePasswordInput) DeepCopyInto(out *ChangePasswordInput) {
|
||||
*out = *in
|
||||
|
@@ -36,6 +36,8 @@ type Interface interface {
|
||||
ClusterRegistrationTokensGetter
|
||||
CatalogsGetter
|
||||
TemplatesGetter
|
||||
CatalogTemplatesGetter
|
||||
CatalogTemplateVersionsGetter
|
||||
TemplateVersionsGetter
|
||||
TemplateContentsGetter
|
||||
GroupsGetter
|
||||
@@ -93,6 +95,8 @@ type Clients struct {
|
||||
ClusterRegistrationToken ClusterRegistrationTokenClient
|
||||
Catalog CatalogClient
|
||||
Template TemplateClient
|
||||
CatalogTemplate CatalogTemplateClient
|
||||
CatalogTemplateVersion CatalogTemplateVersionClient
|
||||
TemplateVersion TemplateVersionClient
|
||||
TemplateContent TemplateContentClient
|
||||
Group GroupClient
|
||||
@@ -152,6 +156,8 @@ type Client struct {
|
||||
clusterRegistrationTokenControllers map[string]ClusterRegistrationTokenController
|
||||
catalogControllers map[string]CatalogController
|
||||
templateControllers map[string]TemplateController
|
||||
catalogTemplateControllers map[string]CatalogTemplateController
|
||||
catalogTemplateVersionControllers map[string]CatalogTemplateVersionController
|
||||
templateVersionControllers map[string]TemplateVersionController
|
||||
templateContentControllers map[string]TemplateContentController
|
||||
groupControllers map[string]GroupController
|
||||
@@ -271,6 +277,12 @@ func NewClientsFromInterface(iface Interface) *Clients {
|
||||
Template: &templateClient2{
|
||||
iface: iface.Templates(""),
|
||||
},
|
||||
CatalogTemplate: &catalogTemplateClient2{
|
||||
iface: iface.CatalogTemplates(""),
|
||||
},
|
||||
CatalogTemplateVersion: &catalogTemplateVersionClient2{
|
||||
iface: iface.CatalogTemplateVersions(""),
|
||||
},
|
||||
TemplateVersion: &templateVersionClient2{
|
||||
iface: iface.TemplateVersions(""),
|
||||
},
|
||||
@@ -411,6 +423,8 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
clusterRegistrationTokenControllers: map[string]ClusterRegistrationTokenController{},
|
||||
catalogControllers: map[string]CatalogController{},
|
||||
templateControllers: map[string]TemplateController{},
|
||||
catalogTemplateControllers: map[string]CatalogTemplateController{},
|
||||
catalogTemplateVersionControllers: map[string]CatalogTemplateVersionController{},
|
||||
templateVersionControllers: map[string]TemplateVersionController{},
|
||||
templateContentControllers: map[string]TemplateContentController{},
|
||||
groupControllers: map[string]GroupController{},
|
||||
@@ -670,6 +684,32 @@ func (c *Client) Templates(namespace string) TemplateInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type CatalogTemplatesGetter interface {
|
||||
CatalogTemplates(namespace string) CatalogTemplateInterface
|
||||
}
|
||||
|
||||
func (c *Client) CatalogTemplates(namespace string) CatalogTemplateInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CatalogTemplateResource, CatalogTemplateGroupVersionKind, catalogTemplateFactory{})
|
||||
return &catalogTemplateClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type CatalogTemplateVersionsGetter interface {
|
||||
CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface
|
||||
}
|
||||
|
||||
func (c *Client) CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CatalogTemplateVersionResource, CatalogTemplateVersionGroupVersionKind, catalogTemplateVersionFactory{})
|
||||
return &catalogTemplateVersionClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type TemplateVersionsGetter interface {
|
||||
TemplateVersions(namespace string) TemplateVersionInterface
|
||||
}
|
||||
|
@@ -65,6 +65,10 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&CatalogList{},
|
||||
&Template{},
|
||||
&TemplateList{},
|
||||
&CatalogTemplate{},
|
||||
&CatalogTemplateList{},
|
||||
&CatalogTemplateVersion{},
|
||||
&CatalogTemplateVersionList{},
|
||||
&TemplateVersion{},
|
||||
&TemplateVersionList{},
|
||||
&TemplateContent{},
|
||||
|
Reference in New Issue
Block a user