mirror of
https://github.com/rancher/types.git
synced 2025-08-31 12:48:45 +00:00
Update generated code
This commit is contained in:
@@ -0,0 +1,193 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/clientbase"
|
||||
"github.com/rancher/norman/controller"
|
||||
"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/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
ClusterRegistrationTokenGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: "v3",
|
||||
Group: "management.cattle.io",
|
||||
Kind: "ClusterRegistrationToken",
|
||||
}
|
||||
ClusterRegistrationTokenResource = metav1.APIResource{
|
||||
Name: "clusterregistrationtokens",
|
||||
SingularName: "clusterregistrationtoken",
|
||||
Namespaced: false,
|
||||
Kind: ClusterRegistrationTokenGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ClusterRegistrationTokenList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterRegistrationToken
|
||||
}
|
||||
|
||||
type ClusterRegistrationTokenHandlerFunc func(key string, obj *ClusterRegistrationToken) error
|
||||
|
||||
type ClusterRegistrationTokenLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error)
|
||||
Get(namespace, name string) (*ClusterRegistrationToken, error)
|
||||
}
|
||||
|
||||
type ClusterRegistrationTokenController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ClusterRegistrationTokenLister
|
||||
AddHandler(handler ClusterRegistrationTokenHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterRegistrationTokenInterface interface {
|
||||
ObjectClient() *clientbase.ObjectClient
|
||||
Create(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error)
|
||||
Update(*ClusterRegistrationToken) (*ClusterRegistrationToken, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterRegistrationTokenController
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenLister struct {
|
||||
controller *clusterRegistrationTokenController
|
||||
}
|
||||
|
||||
func (l *clusterRegistrationTokenLister) List(namespace string, selector labels.Selector) (ret []*ClusterRegistrationToken, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*ClusterRegistrationToken))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *clusterRegistrationTokenLister) Get(namespace, name string) (*ClusterRegistrationToken, 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: ClusterRegistrationTokenGroupVersionKind.Group,
|
||||
Resource: "clusterRegistrationToken",
|
||||
}, name)
|
||||
}
|
||||
return obj.(*ClusterRegistrationToken), nil
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterRegistrationTokenController) Lister() ClusterRegistrationTokenLister {
|
||||
return &clusterRegistrationTokenLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *clusterRegistrationTokenController) AddHandler(handler ClusterRegistrationTokenHandlerFunc) {
|
||||
c.GenericController.AddHandler(func(key string) error {
|
||||
obj, exists, err := c.Informer().GetStore().GetByKey(key)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
return handler(key, nil)
|
||||
}
|
||||
return handler(key, obj.(*ClusterRegistrationToken))
|
||||
})
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterRegistrationTokenFactory) Object() runtime.Object {
|
||||
return &ClusterRegistrationToken{}
|
||||
}
|
||||
|
||||
func (c clusterRegistrationTokenFactory) List() runtime.Object {
|
||||
return &ClusterRegistrationTokenList{}
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Controller() ClusterRegistrationTokenController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterRegistrationTokenControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterRegistrationTokenGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterRegistrationTokenController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterRegistrationTokenControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *clientbase.ObjectClient
|
||||
controller ClusterRegistrationTokenController
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) ObjectClient() *clientbase.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Create(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterRegistrationToken), err
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Get(name string, opts metav1.GetOptions) (*ClusterRegistrationToken, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterRegistrationToken), err
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Update(o *ClusterRegistrationToken) (*ClusterRegistrationToken, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterRegistrationToken), err
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) List(opts metav1.ListOptions) (*ClusterRegistrationTokenList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterRegistrationTokenList), err
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
func (s *clusterRegistrationTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type ClusterRegistrationTokenLifecycle interface {
|
||||
Create(obj *ClusterRegistrationToken) error
|
||||
Remove(obj *ClusterRegistrationToken) error
|
||||
Updated(obj *ClusterRegistrationToken) error
|
||||
}
|
||||
|
||||
type clusterRegistrationTokenLifecycleAdapter struct {
|
||||
lifecycle ClusterRegistrationTokenLifecycle
|
||||
}
|
||||
|
||||
func (w *clusterRegistrationTokenLifecycleAdapter) Create(obj runtime.Object) error {
|
||||
return w.lifecycle.Create(obj.(*ClusterRegistrationToken))
|
||||
}
|
||||
|
||||
func (w *clusterRegistrationTokenLifecycleAdapter) Finalize(obj runtime.Object) error {
|
||||
return w.lifecycle.Remove(obj.(*ClusterRegistrationToken))
|
||||
}
|
||||
|
||||
func (w *clusterRegistrationTokenLifecycleAdapter) Updated(obj runtime.Object) error {
|
||||
return w.lifecycle.Updated(obj.(*ClusterRegistrationToken))
|
||||
}
|
||||
|
||||
func NewClusterRegistrationTokenLifecycleAdapter(name string, client ClusterRegistrationTokenInterface, l ClusterRegistrationTokenLifecycle) ClusterRegistrationTokenHandlerFunc {
|
||||
adapter := &clusterRegistrationTokenLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterRegistrationToken) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@@ -386,6 +386,101 @@ func (in *ClusterList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRegistrationToken) DeepCopyInto(out *ClusterRegistrationToken) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
out.Status = in.Status
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationToken.
|
||||
func (in *ClusterRegistrationToken) DeepCopy() *ClusterRegistrationToken {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRegistrationToken)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRegistrationToken) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRegistrationTokenList) DeepCopyInto(out *ClusterRegistrationTokenList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterRegistrationToken, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenList.
|
||||
func (in *ClusterRegistrationTokenList) DeepCopy() *ClusterRegistrationTokenList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRegistrationTokenList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterRegistrationTokenList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRegistrationTokenSpec) DeepCopyInto(out *ClusterRegistrationTokenSpec) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenSpec.
|
||||
func (in *ClusterRegistrationTokenSpec) DeepCopy() *ClusterRegistrationTokenSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRegistrationTokenSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRegistrationTokenStatus) DeepCopyInto(out *ClusterRegistrationTokenStatus) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterRegistrationTokenStatus.
|
||||
func (in *ClusterRegistrationTokenStatus) DeepCopy() *ClusterRegistrationTokenStatus {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterRegistrationTokenStatus)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterRoleTemplateBinding) DeepCopyInto(out *ClusterRoleTemplateBinding) {
|
||||
*out = *in
|
||||
|
@@ -24,6 +24,7 @@ type Interface interface {
|
||||
ProjectRoleTemplateBindingsGetter
|
||||
ClustersGetter
|
||||
ClusterEventsGetter
|
||||
ClusterRegistrationTokensGetter
|
||||
CatalogsGetter
|
||||
TemplatesGetter
|
||||
TemplateVersionsGetter
|
||||
@@ -53,6 +54,7 @@ type Client struct {
|
||||
projectRoleTemplateBindingControllers map[string]ProjectRoleTemplateBindingController
|
||||
clusterControllers map[string]ClusterController
|
||||
clusterEventControllers map[string]ClusterEventController
|
||||
clusterRegistrationTokenControllers map[string]ClusterRegistrationTokenController
|
||||
catalogControllers map[string]CatalogController
|
||||
templateControllers map[string]TemplateController
|
||||
templateVersionControllers map[string]TemplateVersionController
|
||||
@@ -91,6 +93,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
projectRoleTemplateBindingControllers: map[string]ProjectRoleTemplateBindingController{},
|
||||
clusterControllers: map[string]ClusterController{},
|
||||
clusterEventControllers: map[string]ClusterEventController{},
|
||||
clusterRegistrationTokenControllers: map[string]ClusterRegistrationTokenController{},
|
||||
catalogControllers: map[string]CatalogController{},
|
||||
templateControllers: map[string]TemplateController{},
|
||||
templateVersionControllers: map[string]TemplateVersionController{},
|
||||
@@ -248,6 +251,19 @@ func (c *Client) ClusterEvents(namespace string) ClusterEventInterface {
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterRegistrationTokensGetter interface {
|
||||
ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface {
|
||||
objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterRegistrationTokenResource, ClusterRegistrationTokenGroupVersionKind, clusterRegistrationTokenFactory{})
|
||||
return &clusterRegistrationTokenClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type CatalogsGetter interface {
|
||||
Catalogs(namespace string) CatalogInterface
|
||||
}
|
||||
|
Reference in New Issue
Block a user