mirror of
https://github.com/rancher/types.git
synced 2025-07-31 04:49:37 +00:00
generated
This commit is contained in:
parent
8cac937266
commit
db4a9fe544
@ -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 (
|
||||
ClusterAuthTokenGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterAuthToken",
|
||||
}
|
||||
ClusterAuthTokenResource = metav1.APIResource{
|
||||
Name: "clusterauthtokens",
|
||||
SingularName: "clusterauthtoken",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: ClusterAuthTokenGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewClusterAuthToken(namespace, name string, obj ClusterAuthToken) *ClusterAuthToken {
|
||||
obj.APIVersion, obj.Kind = ClusterAuthTokenGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type ClusterAuthTokenList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterAuthToken
|
||||
}
|
||||
|
||||
type ClusterAuthTokenHandlerFunc func(key string, obj *ClusterAuthToken) (runtime.Object, error)
|
||||
|
||||
type ClusterAuthTokenChangeHandlerFunc func(obj *ClusterAuthToken) (runtime.Object, error)
|
||||
|
||||
type ClusterAuthTokenLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*ClusterAuthToken, err error)
|
||||
Get(namespace, name string) (*ClusterAuthToken, error)
|
||||
}
|
||||
|
||||
type ClusterAuthTokenController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ClusterAuthTokenLister
|
||||
AddHandler(ctx context.Context, name string, handler ClusterAuthTokenHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterAuthTokenHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterAuthTokenInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*ClusterAuthToken) (*ClusterAuthToken, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAuthToken, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterAuthToken, error)
|
||||
Update(*ClusterAuthToken) (*ClusterAuthToken, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterAuthTokenList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterAuthTokenController
|
||||
AddHandler(ctx context.Context, name string, sync ClusterAuthTokenHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle ClusterAuthTokenLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAuthTokenHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAuthTokenLifecycle)
|
||||
}
|
||||
|
||||
type clusterAuthTokenLister struct {
|
||||
controller *clusterAuthTokenController
|
||||
}
|
||||
|
||||
func (l *clusterAuthTokenLister) List(namespace string, selector labels.Selector) (ret []*ClusterAuthToken, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*ClusterAuthToken))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *clusterAuthTokenLister) Get(namespace, name string) (*ClusterAuthToken, 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: ClusterAuthTokenGroupVersionKind.Group,
|
||||
Resource: "clusterAuthToken",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*ClusterAuthToken), nil
|
||||
}
|
||||
|
||||
type clusterAuthTokenController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) Lister() ClusterAuthTokenLister {
|
||||
return &clusterAuthTokenLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) AddHandler(ctx context.Context, name string, handler ClusterAuthTokenHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*ClusterAuthToken); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterAuthTokenHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*ClusterAuthToken); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type clusterAuthTokenFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterAuthTokenFactory) Object() runtime.Object {
|
||||
return &ClusterAuthToken{}
|
||||
}
|
||||
|
||||
func (c clusterAuthTokenFactory) List() runtime.Object {
|
||||
return &ClusterAuthTokenList{}
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Controller() ClusterAuthTokenController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterAuthTokenControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterAuthTokenGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterAuthTokenController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterAuthTokenControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterAuthTokenClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller ClusterAuthTokenController
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Create(o *ClusterAuthToken) (*ClusterAuthToken, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterAuthToken), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Get(name string, opts metav1.GetOptions) (*ClusterAuthToken, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterAuthToken), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterAuthToken, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*ClusterAuthToken), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Update(o *ClusterAuthToken) (*ClusterAuthToken, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterAuthToken), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) List(opts metav1.ListOptions) (*ClusterAuthTokenList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterAuthTokenList), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *clusterAuthTokenClient) Patch(o *ClusterAuthToken, patchType types.PatchType, data []byte, subresources ...string) (*ClusterAuthToken, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*ClusterAuthToken), err
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) AddHandler(ctx context.Context, name string, sync ClusterAuthTokenHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterAuthTokenLifecycle) {
|
||||
sync := NewClusterAuthTokenLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterAuthTokenHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *clusterAuthTokenClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterAuthTokenLifecycle) {
|
||||
sync := NewClusterAuthTokenLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type ClusterAuthTokenIndexer func(obj *ClusterAuthToken) ([]string, error)
|
||||
|
||||
type ClusterAuthTokenClientCache interface {
|
||||
Get(namespace, name string) (*ClusterAuthToken, error)
|
||||
List(namespace string, selector labels.Selector) ([]*ClusterAuthToken, error)
|
||||
|
||||
Index(name string, indexer ClusterAuthTokenIndexer)
|
||||
GetIndexed(name, key string) ([]*ClusterAuthToken, error)
|
||||
}
|
||||
|
||||
type ClusterAuthTokenClient interface {
|
||||
Create(*ClusterAuthToken) (*ClusterAuthToken, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*ClusterAuthToken, error)
|
||||
Update(*ClusterAuthToken) (*ClusterAuthToken, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*ClusterAuthTokenList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() ClusterAuthTokenClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() ClusterAuthTokenInterface
|
||||
}
|
||||
|
||||
type clusterAuthTokenClientCache struct {
|
||||
client *clusterAuthTokenClient2
|
||||
}
|
||||
|
||||
type clusterAuthTokenClient2 struct {
|
||||
iface ClusterAuthTokenInterface
|
||||
controller ClusterAuthTokenController
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Interface() ClusterAuthTokenInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Create(obj *ClusterAuthToken) (*ClusterAuthToken, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Get(namespace, name string, opts metav1.GetOptions) (*ClusterAuthToken, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Update(obj *ClusterAuthToken) (*ClusterAuthToken, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) List(namespace string, opts metav1.ListOptions) (*ClusterAuthTokenList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClientCache) Get(namespace, name string) (*ClusterAuthToken, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClientCache) List(namespace string, selector labels.Selector) ([]*ClusterAuthToken, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) Cache() ClusterAuthTokenClientCache {
|
||||
n.loadController()
|
||||
return &clusterAuthTokenClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) OnCreate(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &clusterAuthTokenLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) OnChange(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &clusterAuthTokenLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) OnRemove(ctx context.Context, name string, sync ClusterAuthTokenChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &clusterAuthTokenLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClientCache) Index(name string, indexer ClusterAuthTokenIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*ClusterAuthToken); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClientCache) GetIndexed(name, key string) ([]*ClusterAuthToken, error) {
|
||||
var result []*ClusterAuthToken
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*ClusterAuthToken); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type clusterAuthTokenLifecycleDelegate struct {
|
||||
create ClusterAuthTokenChangeHandlerFunc
|
||||
update ClusterAuthTokenChangeHandlerFunc
|
||||
remove ClusterAuthTokenChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenLifecycleDelegate) Create(obj *ClusterAuthToken) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenLifecycleDelegate) Remove(obj *ClusterAuthToken) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *clusterAuthTokenLifecycleDelegate) Updated(obj *ClusterAuthToken) (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 ClusterAuthTokenLifecycle interface {
|
||||
Create(obj *ClusterAuthToken) (runtime.Object, error)
|
||||
Remove(obj *ClusterAuthToken) (runtime.Object, error)
|
||||
Updated(obj *ClusterAuthToken) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type clusterAuthTokenLifecycleAdapter struct {
|
||||
lifecycle ClusterAuthTokenLifecycle
|
||||
}
|
||||
|
||||
func (w *clusterAuthTokenLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *clusterAuthTokenLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *clusterAuthTokenLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*ClusterAuthToken))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterAuthTokenLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*ClusterAuthToken))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterAuthTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*ClusterAuthToken))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewClusterAuthTokenLifecycleAdapter(name string, clusterScoped bool, client ClusterAuthTokenInterface, l ClusterAuthTokenLifecycle) ClusterAuthTokenHandlerFunc {
|
||||
adapter := &clusterAuthTokenLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterAuthToken) (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 (
|
||||
ClusterUserAttributeGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ClusterUserAttribute",
|
||||
}
|
||||
ClusterUserAttributeResource = metav1.APIResource{
|
||||
Name: "clusteruserattributes",
|
||||
SingularName: "clusteruserattribute",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: ClusterUserAttributeGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewClusterUserAttribute(namespace, name string, obj ClusterUserAttribute) *ClusterUserAttribute {
|
||||
obj.APIVersion, obj.Kind = ClusterUserAttributeGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type ClusterUserAttributeList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []ClusterUserAttribute
|
||||
}
|
||||
|
||||
type ClusterUserAttributeHandlerFunc func(key string, obj *ClusterUserAttribute) (runtime.Object, error)
|
||||
|
||||
type ClusterUserAttributeChangeHandlerFunc func(obj *ClusterUserAttribute) (runtime.Object, error)
|
||||
|
||||
type ClusterUserAttributeLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*ClusterUserAttribute, err error)
|
||||
Get(namespace, name string) (*ClusterUserAttribute, error)
|
||||
}
|
||||
|
||||
type ClusterUserAttributeController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ClusterUserAttributeLister
|
||||
AddHandler(ctx context.Context, name string, handler ClusterUserAttributeHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterUserAttributeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ClusterUserAttributeInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*ClusterUserAttribute) (*ClusterUserAttribute, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterUserAttribute, error)
|
||||
Get(name string, opts metav1.GetOptions) (*ClusterUserAttribute, error)
|
||||
Update(*ClusterUserAttribute) (*ClusterUserAttribute, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ClusterUserAttributeList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ClusterUserAttributeController
|
||||
AddHandler(ctx context.Context, name string, sync ClusterUserAttributeHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle ClusterUserAttributeLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterUserAttributeHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterUserAttributeLifecycle)
|
||||
}
|
||||
|
||||
type clusterUserAttributeLister struct {
|
||||
controller *clusterUserAttributeController
|
||||
}
|
||||
|
||||
func (l *clusterUserAttributeLister) List(namespace string, selector labels.Selector) (ret []*ClusterUserAttribute, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*ClusterUserAttribute))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *clusterUserAttributeLister) Get(namespace, name string) (*ClusterUserAttribute, 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: ClusterUserAttributeGroupVersionKind.Group,
|
||||
Resource: "clusterUserAttribute",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*ClusterUserAttribute), nil
|
||||
}
|
||||
|
||||
type clusterUserAttributeController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) Lister() ClusterUserAttributeLister {
|
||||
return &clusterUserAttributeLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) AddHandler(ctx context.Context, name string, handler ClusterUserAttributeHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*ClusterUserAttribute); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterUserAttributeHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*ClusterUserAttribute); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type clusterUserAttributeFactory struct {
|
||||
}
|
||||
|
||||
func (c clusterUserAttributeFactory) Object() runtime.Object {
|
||||
return &ClusterUserAttribute{}
|
||||
}
|
||||
|
||||
func (c clusterUserAttributeFactory) List() runtime.Object {
|
||||
return &ClusterUserAttributeList{}
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Controller() ClusterUserAttributeController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.clusterUserAttributeControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ClusterUserAttributeGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &clusterUserAttributeController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.clusterUserAttributeControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type clusterUserAttributeClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller ClusterUserAttributeController
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Create(o *ClusterUserAttribute) (*ClusterUserAttribute, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*ClusterUserAttribute), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Get(name string, opts metav1.GetOptions) (*ClusterUserAttribute, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*ClusterUserAttribute), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterUserAttribute, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*ClusterUserAttribute), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Update(o *ClusterUserAttribute) (*ClusterUserAttribute, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*ClusterUserAttribute), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) List(opts metav1.ListOptions) (*ClusterUserAttributeList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ClusterUserAttributeList), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *clusterUserAttributeClient) Patch(o *ClusterUserAttribute, patchType types.PatchType, data []byte, subresources ...string) (*ClusterUserAttribute, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*ClusterUserAttribute), err
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) AddHandler(ctx context.Context, name string, sync ClusterUserAttributeHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterUserAttributeLifecycle) {
|
||||
sync := NewClusterUserAttributeLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterUserAttributeHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *clusterUserAttributeClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterUserAttributeLifecycle) {
|
||||
sync := NewClusterUserAttributeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type ClusterUserAttributeIndexer func(obj *ClusterUserAttribute) ([]string, error)
|
||||
|
||||
type ClusterUserAttributeClientCache interface {
|
||||
Get(namespace, name string) (*ClusterUserAttribute, error)
|
||||
List(namespace string, selector labels.Selector) ([]*ClusterUserAttribute, error)
|
||||
|
||||
Index(name string, indexer ClusterUserAttributeIndexer)
|
||||
GetIndexed(name, key string) ([]*ClusterUserAttribute, error)
|
||||
}
|
||||
|
||||
type ClusterUserAttributeClient interface {
|
||||
Create(*ClusterUserAttribute) (*ClusterUserAttribute, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*ClusterUserAttribute, error)
|
||||
Update(*ClusterUserAttribute) (*ClusterUserAttribute, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*ClusterUserAttributeList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() ClusterUserAttributeClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() ClusterUserAttributeInterface
|
||||
}
|
||||
|
||||
type clusterUserAttributeClientCache struct {
|
||||
client *clusterUserAttributeClient2
|
||||
}
|
||||
|
||||
type clusterUserAttributeClient2 struct {
|
||||
iface ClusterUserAttributeInterface
|
||||
controller ClusterUserAttributeController
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Interface() ClusterUserAttributeInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Create(obj *ClusterUserAttribute) (*ClusterUserAttribute, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Get(namespace, name string, opts metav1.GetOptions) (*ClusterUserAttribute, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Update(obj *ClusterUserAttribute) (*ClusterUserAttribute, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) List(namespace string, opts metav1.ListOptions) (*ClusterUserAttributeList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClientCache) Get(namespace, name string) (*ClusterUserAttribute, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClientCache) List(namespace string, selector labels.Selector) ([]*ClusterUserAttribute, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) Cache() ClusterUserAttributeClientCache {
|
||||
n.loadController()
|
||||
return &clusterUserAttributeClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) OnCreate(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &clusterUserAttributeLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) OnChange(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &clusterUserAttributeLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) OnRemove(ctx context.Context, name string, sync ClusterUserAttributeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &clusterUserAttributeLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClientCache) Index(name string, indexer ClusterUserAttributeIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*ClusterUserAttribute); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClientCache) GetIndexed(name, key string) ([]*ClusterUserAttribute, error) {
|
||||
var result []*ClusterUserAttribute
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*ClusterUserAttribute); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type clusterUserAttributeLifecycleDelegate struct {
|
||||
create ClusterUserAttributeChangeHandlerFunc
|
||||
update ClusterUserAttributeChangeHandlerFunc
|
||||
remove ClusterUserAttributeChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeLifecycleDelegate) Create(obj *ClusterUserAttribute) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeLifecycleDelegate) Remove(obj *ClusterUserAttribute) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *clusterUserAttributeLifecycleDelegate) Updated(obj *ClusterUserAttribute) (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 ClusterUserAttributeLifecycle interface {
|
||||
Create(obj *ClusterUserAttribute) (runtime.Object, error)
|
||||
Remove(obj *ClusterUserAttribute) (runtime.Object, error)
|
||||
Updated(obj *ClusterUserAttribute) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type clusterUserAttributeLifecycleAdapter struct {
|
||||
lifecycle ClusterUserAttributeLifecycle
|
||||
}
|
||||
|
||||
func (w *clusterUserAttributeLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *clusterUserAttributeLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *clusterUserAttributeLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*ClusterUserAttribute))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterUserAttributeLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*ClusterUserAttribute))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *clusterUserAttributeLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*ClusterUserAttribute))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewClusterUserAttributeLifecycleAdapter(name string, clusterScoped bool, client ClusterUserAttributeInterface, l ClusterUserAttributeLifecycle) ClusterUserAttributeHandlerFunc {
|
||||
adapter := &clusterUserAttributeLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterUserAttribute) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
130
apis/cluster.cattle.io/v3/zz_generated_deepcopy.go
Normal file
130
apis/cluster.cattle.io/v3/zz_generated_deepcopy.go
Normal file
@ -0,0 +1,130 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ClusterAuthToken) DeepCopyInto(out *ClusterAuthToken) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAuthToken.
|
||||
func (in *ClusterAuthToken) DeepCopy() *ClusterAuthToken {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterAuthToken)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterAuthToken) 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 *ClusterAuthTokenList) DeepCopyInto(out *ClusterAuthTokenList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterAuthToken, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAuthTokenList.
|
||||
func (in *ClusterAuthTokenList) DeepCopy() *ClusterAuthTokenList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterAuthTokenList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterAuthTokenList) 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 *ClusterUserAttribute) DeepCopyInto(out *ClusterUserAttribute) {
|
||||
*out = *in
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
if in.Groups != nil {
|
||||
in, out := &in.Groups, &out.Groups
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterUserAttribute.
|
||||
func (in *ClusterUserAttribute) DeepCopy() *ClusterUserAttribute {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterUserAttribute)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterUserAttribute) 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 *ClusterUserAttributeList) DeepCopyInto(out *ClusterUserAttributeList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ClusterUserAttribute, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterUserAttributeList.
|
||||
func (in *ClusterUserAttributeList) DeepCopy() *ClusterUserAttributeList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ClusterUserAttributeList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ClusterUserAttributeList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
139
apis/cluster.cattle.io/v3/zz_generated_k8s_client.go
Normal file
139
apis/cluster.cattle.io/v3/zz_generated_k8s_client.go
Normal file
@ -0,0 +1,139 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sync"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"github.com/rancher/norman/objectclient/dynamic"
|
||||
"github.com/rancher/norman/restwatch"
|
||||
"k8s.io/client-go/rest"
|
||||
)
|
||||
|
||||
type (
|
||||
contextKeyType struct{}
|
||||
contextClientsKeyType struct{}
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
RESTClient() rest.Interface
|
||||
controller.Starter
|
||||
|
||||
ClusterAuthTokensGetter
|
||||
ClusterUserAttributesGetter
|
||||
}
|
||||
|
||||
type Clients struct {
|
||||
Interface Interface
|
||||
|
||||
ClusterAuthToken ClusterAuthTokenClient
|
||||
ClusterUserAttribute ClusterUserAttributeClient
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
sync.Mutex
|
||||
restClient rest.Interface
|
||||
starters []controller.Starter
|
||||
|
||||
clusterAuthTokenControllers map[string]ClusterAuthTokenController
|
||||
clusterUserAttributeControllers map[string]ClusterUserAttributeController
|
||||
}
|
||||
|
||||
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
|
||||
c, err := NewForConfig(config)
|
||||
if err != nil {
|
||||
return ctx, nil, err
|
||||
}
|
||||
|
||||
cs := NewClientsFromInterface(c)
|
||||
|
||||
ctx = context.WithValue(ctx, contextKeyType{}, c)
|
||||
ctx = context.WithValue(ctx, contextClientsKeyType{}, cs)
|
||||
return ctx, c, nil
|
||||
}
|
||||
|
||||
func ClientsFrom(ctx context.Context) *Clients {
|
||||
return ctx.Value(contextClientsKeyType{}).(*Clients)
|
||||
}
|
||||
|
||||
func From(ctx context.Context) Interface {
|
||||
return ctx.Value(contextKeyType{}).(Interface)
|
||||
}
|
||||
|
||||
func NewClients(config rest.Config) (*Clients, error) {
|
||||
iface, err := NewForConfig(config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return NewClientsFromInterface(iface), nil
|
||||
}
|
||||
|
||||
func NewClientsFromInterface(iface Interface) *Clients {
|
||||
return &Clients{
|
||||
Interface: iface,
|
||||
|
||||
ClusterAuthToken: &clusterAuthTokenClient2{
|
||||
iface: iface.ClusterAuthTokens(""),
|
||||
},
|
||||
ClusterUserAttribute: &clusterUserAttributeClient2{
|
||||
iface: iface.ClusterUserAttributes(""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
if config.NegotiatedSerializer == nil {
|
||||
config.NegotiatedSerializer = dynamic.NegotiatedSerializer
|
||||
}
|
||||
|
||||
restClient, err := restwatch.UnversionedRESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &Client{
|
||||
restClient: restClient,
|
||||
|
||||
clusterAuthTokenControllers: map[string]ClusterAuthTokenController{},
|
||||
clusterUserAttributeControllers: map[string]ClusterUserAttributeController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *Client) RESTClient() rest.Interface {
|
||||
return c.restClient
|
||||
}
|
||||
|
||||
func (c *Client) Sync(ctx context.Context) error {
|
||||
return controller.Sync(ctx, c.starters...)
|
||||
}
|
||||
|
||||
func (c *Client) Start(ctx context.Context, threadiness int) error {
|
||||
return controller.Start(ctx, threadiness, c.starters...)
|
||||
}
|
||||
|
||||
type ClusterAuthTokensGetter interface {
|
||||
ClusterAuthTokens(namespace string) ClusterAuthTokenInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterAuthTokens(namespace string) ClusterAuthTokenInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterAuthTokenResource, ClusterAuthTokenGroupVersionKind, clusterAuthTokenFactory{})
|
||||
return &clusterAuthTokenClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ClusterUserAttributesGetter interface {
|
||||
ClusterUserAttributes(namespace string) ClusterUserAttributeInterface
|
||||
}
|
||||
|
||||
func (c *Client) ClusterUserAttributes(namespace string) ClusterUserAttributeInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterUserAttributeResource, ClusterUserAttributeGroupVersionKind, clusterUserAttributeFactory{})
|
||||
return &clusterUserAttributeClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
40
apis/cluster.cattle.io/v3/zz_generated_scheme.go
Normal file
40
apis/cluster.cattle.io/v3/zz_generated_scheme.go
Normal file
@ -0,0 +1,40 @@
|
||||
package v3
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
const (
|
||||
GroupName = "cluster.cattle.io"
|
||||
Version = "v3"
|
||||
)
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: Version}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
// TODO this gets cleaned up when the types are fixed
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
|
||||
&ClusterAuthToken{},
|
||||
&ClusterUserAttribute{},
|
||||
)
|
||||
return nil
|
||||
}
|
@ -258,21 +258,35 @@ func (in *AuthConfigList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuthWebhookConfig) DeepCopyInto(out *AuthWebhookConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuthWebhookConfig.
|
||||
func (in *AuthWebhookConfig) DeepCopy() *AuthWebhookConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(AuthWebhookConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *AuthnConfig) DeepCopyInto(out *AuthnConfig) {
|
||||
*out = *in
|
||||
if in.Options != nil {
|
||||
in, out := &in.Options, &out.Options
|
||||
*out = make(map[string]string, len(*in))
|
||||
for key, val := range *in {
|
||||
(*out)[key] = val
|
||||
}
|
||||
}
|
||||
if in.SANs != nil {
|
||||
in, out := &in.SANs, &out.SANs
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Webhook != nil {
|
||||
in, out := &in.Webhook, &out.Webhook
|
||||
*out = new(AuthWebhookConfig)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
34
client/cluster/v3/zz_generated_cluster_auth_token.go
Normal file
34
client/cluster/v3/zz_generated_cluster_auth_token.go
Normal file
@ -0,0 +1,34 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ClusterAuthTokenType = "clusterAuthToken"
|
||||
ClusterAuthTokenFieldAnnotations = "annotations"
|
||||
ClusterAuthTokenFieldCreated = "created"
|
||||
ClusterAuthTokenFieldCreatorID = "creatorId"
|
||||
ClusterAuthTokenFieldEnabled = "enabled"
|
||||
ClusterAuthTokenFieldExpiresAt = "expiresAt"
|
||||
ClusterAuthTokenFieldLabels = "labels"
|
||||
ClusterAuthTokenFieldName = "name"
|
||||
ClusterAuthTokenFieldNamespaceId = "namespaceId"
|
||||
ClusterAuthTokenFieldOwnerReferences = "ownerReferences"
|
||||
ClusterAuthTokenFieldRemoved = "removed"
|
||||
ClusterAuthTokenFieldSecretKeyHash = "hash"
|
||||
ClusterAuthTokenFieldUUID = "uuid"
|
||||
ClusterAuthTokenFieldUserName = "userName"
|
||||
)
|
||||
|
||||
type ClusterAuthToken struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
|
||||
ExpiresAt string `json:"expiresAt,omitempty" yaml:"expiresAt,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
SecretKeyHash string `json:"hash,omitempty" yaml:"hash,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
UserName string `json:"userName,omitempty" yaml:"userName,omitempty"`
|
||||
}
|
34
client/cluster/v3/zz_generated_cluster_user_attribute.go
Normal file
34
client/cluster/v3/zz_generated_cluster_user_attribute.go
Normal file
@ -0,0 +1,34 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ClusterUserAttributeType = "clusterUserAttribute"
|
||||
ClusterUserAttributeFieldAnnotations = "annotations"
|
||||
ClusterUserAttributeFieldCreated = "created"
|
||||
ClusterUserAttributeFieldCreatorID = "creatorId"
|
||||
ClusterUserAttributeFieldEnabled = "enabled"
|
||||
ClusterUserAttributeFieldGroups = "groups"
|
||||
ClusterUserAttributeFieldLabels = "labels"
|
||||
ClusterUserAttributeFieldLastRefresh = "lastRefresh"
|
||||
ClusterUserAttributeFieldName = "name"
|
||||
ClusterUserAttributeFieldNamespaceId = "namespaceId"
|
||||
ClusterUserAttributeFieldNeedsRefresh = "needsRefresh"
|
||||
ClusterUserAttributeFieldOwnerReferences = "ownerReferences"
|
||||
ClusterUserAttributeFieldRemoved = "removed"
|
||||
ClusterUserAttributeFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type ClusterUserAttribute struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Enabled bool `json:"enabled,omitempty" yaml:"enabled,omitempty"`
|
||||
Groups []string `json:"groups,omitempty" yaml:"groups,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
LastRefresh string `json:"lastRefresh,omitempty" yaml:"lastRefresh,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"`
|
||||
NeedsRefresh bool `json:"needsRefresh,omitempty" yaml:"needsRefresh,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
12
client/management/v3/zz_generated_auth_webhook_config.go
Normal file
12
client/management/v3/zz_generated_auth_webhook_config.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
AuthWebhookConfigType = "authWebhookConfig"
|
||||
AuthWebhookConfigFieldCacheTimeout = "cacheTimeout"
|
||||
AuthWebhookConfigFieldConfigFile = "configFile"
|
||||
)
|
||||
|
||||
type AuthWebhookConfig struct {
|
||||
CacheTimeout string `json:"cacheTimeout,omitempty" yaml:"cacheTimeout,omitempty"`
|
||||
ConfigFile string `json:"configFile,omitempty" yaml:"configFile,omitempty"`
|
||||
}
|
@ -2,13 +2,13 @@ package client
|
||||
|
||||
const (
|
||||
AuthnConfigType = "authnConfig"
|
||||
AuthnConfigFieldOptions = "options"
|
||||
AuthnConfigFieldSANs = "sans"
|
||||
AuthnConfigFieldStrategy = "strategy"
|
||||
AuthnConfigFieldWebhook = "webhook"
|
||||
)
|
||||
|
||||
type AuthnConfig struct {
|
||||
Options map[string]string `json:"options,omitempty" yaml:"options,omitempty"`
|
||||
SANs []string `json:"sans,omitempty" yaml:"sans,omitempty"`
|
||||
Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
|
||||
SANs []string `json:"sans,omitempty" yaml:"sans,omitempty"`
|
||||
Strategy string `json:"strategy,omitempty" yaml:"strategy,omitempty"`
|
||||
Webhook *AuthWebhookConfig `json:"webhook,omitempty" yaml:"webhook,omitempty"`
|
||||
}
|
||||
|
@ -10,12 +10,16 @@ const (
|
||||
ClusterFieldAgentImage = "agentImage"
|
||||
ClusterFieldAllocatable = "allocatable"
|
||||
ClusterFieldAnnotations = "annotations"
|
||||
ClusterFieldAppliedEnableClusterAuth = "appliedEnableAuth"
|
||||
ClusterFieldAppliedEnableNetworkPolicy = "appliedEnableNetworkPolicy"
|
||||
ClusterFieldAppliedPodSecurityPolicyTemplateName = "appliedPodSecurityPolicyTemplateId"
|
||||
ClusterFieldAppliedSpec = "appliedSpec"
|
||||
ClusterFieldAuthImage = "authImage"
|
||||
ClusterFieldCACert = "caCert"
|
||||
ClusterFieldCapabilities = "capabilities"
|
||||
ClusterFieldCapacity = "capacity"
|
||||
ClusterFieldClusterEndpointFQDN = "clusterEndpointFQDN"
|
||||
ClusterFieldClusterEndpointFQDNCaCert = "clusterEndpointFQDNCaCert"
|
||||
ClusterFieldComponentStatuses = "componentStatuses"
|
||||
ClusterFieldConditions = "conditions"
|
||||
ClusterFieldCreated = "created"
|
||||
@ -24,9 +28,11 @@ const (
|
||||
ClusterFieldDefaultPodSecurityPolicyTemplateID = "defaultPodSecurityPolicyTemplateId"
|
||||
ClusterFieldDescription = "description"
|
||||
ClusterFieldDesiredAgentImage = "desiredAgentImage"
|
||||
ClusterFieldDesiredAuthImage = "desiredAuthImage"
|
||||
ClusterFieldDockerRootDir = "dockerRootDir"
|
||||
ClusterFieldDriver = "driver"
|
||||
ClusterFieldEnableClusterAlerting = "enableClusterAlerting"
|
||||
ClusterFieldEnableClusterAuth = "enableClusterAuth"
|
||||
ClusterFieldEnableClusterMonitoring = "enableClusterMonitoring"
|
||||
ClusterFieldEnableNetworkPolicy = "enableNetworkPolicy"
|
||||
ClusterFieldFailedSpec = "failedSpec"
|
||||
@ -53,12 +59,16 @@ type Cluster struct {
|
||||
AgentImage string `json:"agentImage,omitempty" yaml:"agentImage,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"`
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
AppliedEnableClusterAuth bool `json:"appliedEnableAuth,omitempty" yaml:"appliedEnableAuth,omitempty"`
|
||||
AppliedEnableNetworkPolicy bool `json:"appliedEnableNetworkPolicy,omitempty" yaml:"appliedEnableNetworkPolicy,omitempty"`
|
||||
AppliedPodSecurityPolicyTemplateName string `json:"appliedPodSecurityPolicyTemplateId,omitempty" yaml:"appliedPodSecurityPolicyTemplateId,omitempty"`
|
||||
AppliedSpec *ClusterSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"`
|
||||
AuthImage string `json:"authImage,omitempty" yaml:"authImage,omitempty"`
|
||||
CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"`
|
||||
Capabilities *Capabilities `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"`
|
||||
ClusterEndpointFQDN string `json:"clusterEndpointFQDN,omitempty" yaml:"clusterEndpointFQDN,omitempty"`
|
||||
ClusterEndpointFQDNCaCert string `json:"clusterEndpointFQDNCaCert,omitempty" yaml:"clusterEndpointFQDNCaCert,omitempty"`
|
||||
ComponentStatuses []ClusterComponentStatus `json:"componentStatuses,omitempty" yaml:"componentStatuses,omitempty"`
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
@ -67,9 +77,11 @@ type Cluster struct {
|
||||
DefaultPodSecurityPolicyTemplateID string `json:"defaultPodSecurityPolicyTemplateId,omitempty" yaml:"defaultPodSecurityPolicyTemplateId,omitempty"`
|
||||
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
DesiredAgentImage string `json:"desiredAgentImage,omitempty" yaml:"desiredAgentImage,omitempty"`
|
||||
DesiredAuthImage string `json:"desiredAuthImage,omitempty" yaml:"desiredAuthImage,omitempty"`
|
||||
DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"`
|
||||
Driver string `json:"driver,omitempty" yaml:"driver,omitempty"`
|
||||
EnableClusterAlerting bool `json:"enableClusterAlerting,omitempty" yaml:"enableClusterAlerting,omitempty"`
|
||||
EnableClusterAuth bool `json:"enableClusterAuth,omitempty" yaml:"enableClusterAuth,omitempty"`
|
||||
EnableClusterMonitoring bool `json:"enableClusterMonitoring,omitempty" yaml:"enableClusterMonitoring,omitempty"`
|
||||
EnableNetworkPolicy *bool `json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy,omitempty"`
|
||||
FailedSpec *ClusterSpec `json:"failedSpec,omitempty" yaml:"failedSpec,omitempty"`
|
||||
|
@ -4,13 +4,17 @@ const (
|
||||
ClusterSpecType = "clusterSpec"
|
||||
ClusterSpecFieldAmazonElasticContainerServiceConfig = "amazonElasticContainerServiceConfig"
|
||||
ClusterSpecFieldAzureKubernetesServiceConfig = "azureKubernetesServiceConfig"
|
||||
ClusterSpecFieldClusterEndpointFQDN = "clusterEndpointFQDN"
|
||||
ClusterSpecFieldClusterEndpointFQDNCaCert = "clusterEndpointFQDNCaCert"
|
||||
ClusterSpecFieldDefaultClusterRoleForProjectMembers = "defaultClusterRoleForProjectMembers"
|
||||
ClusterSpecFieldDefaultPodSecurityPolicyTemplateID = "defaultPodSecurityPolicyTemplateId"
|
||||
ClusterSpecFieldDescription = "description"
|
||||
ClusterSpecFieldDesiredAgentImage = "desiredAgentImage"
|
||||
ClusterSpecFieldDesiredAuthImage = "desiredAuthImage"
|
||||
ClusterSpecFieldDisplayName = "displayName"
|
||||
ClusterSpecFieldDockerRootDir = "dockerRootDir"
|
||||
ClusterSpecFieldEnableClusterAlerting = "enableClusterAlerting"
|
||||
ClusterSpecFieldEnableClusterAuth = "enableClusterAuth"
|
||||
ClusterSpecFieldEnableClusterMonitoring = "enableClusterMonitoring"
|
||||
ClusterSpecFieldEnableNetworkPolicy = "enableNetworkPolicy"
|
||||
ClusterSpecFieldGenericEngineConfig = "genericEngineConfig"
|
||||
@ -23,13 +27,17 @@ const (
|
||||
type ClusterSpec struct {
|
||||
AmazonElasticContainerServiceConfig map[string]interface{} `json:"amazonElasticContainerServiceConfig,omitempty" yaml:"amazonElasticContainerServiceConfig,omitempty"`
|
||||
AzureKubernetesServiceConfig map[string]interface{} `json:"azureKubernetesServiceConfig,omitempty" yaml:"azureKubernetesServiceConfig,omitempty"`
|
||||
ClusterEndpointFQDN string `json:"clusterEndpointFQDN,omitempty" yaml:"clusterEndpointFQDN,omitempty"`
|
||||
ClusterEndpointFQDNCaCert string `json:"clusterEndpointFQDNCaCert,omitempty" yaml:"clusterEndpointFQDNCaCert,omitempty"`
|
||||
DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" yaml:"defaultClusterRoleForProjectMembers,omitempty"`
|
||||
DefaultPodSecurityPolicyTemplateID string `json:"defaultPodSecurityPolicyTemplateId,omitempty" yaml:"defaultPodSecurityPolicyTemplateId,omitempty"`
|
||||
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
DesiredAgentImage string `json:"desiredAgentImage,omitempty" yaml:"desiredAgentImage,omitempty"`
|
||||
DesiredAuthImage string `json:"desiredAuthImage,omitempty" yaml:"desiredAuthImage,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
|
||||
DockerRootDir string `json:"dockerRootDir,omitempty" yaml:"dockerRootDir,omitempty"`
|
||||
EnableClusterAlerting bool `json:"enableClusterAlerting,omitempty" yaml:"enableClusterAlerting,omitempty"`
|
||||
EnableClusterAuth bool `json:"enableClusterAuth,omitempty" yaml:"enableClusterAuth,omitempty"`
|
||||
EnableClusterMonitoring bool `json:"enableClusterMonitoring,omitempty" yaml:"enableClusterMonitoring,omitempty"`
|
||||
EnableNetworkPolicy *bool `json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy,omitempty"`
|
||||
GenericEngineConfig map[string]interface{} `json:"genericEngineConfig,omitempty" yaml:"genericEngineConfig,omitempty"`
|
||||
|
@ -5,9 +5,11 @@ const (
|
||||
ClusterStatusFieldAPIEndpoint = "apiEndpoint"
|
||||
ClusterStatusFieldAgentImage = "agentImage"
|
||||
ClusterStatusFieldAllocatable = "allocatable"
|
||||
ClusterStatusFieldAppliedEnableClusterAuth = "appliedEnableAuth"
|
||||
ClusterStatusFieldAppliedEnableNetworkPolicy = "appliedEnableNetworkPolicy"
|
||||
ClusterStatusFieldAppliedPodSecurityPolicyTemplateName = "appliedPodSecurityPolicyTemplateId"
|
||||
ClusterStatusFieldAppliedSpec = "appliedSpec"
|
||||
ClusterStatusFieldAuthImage = "authImage"
|
||||
ClusterStatusFieldCACert = "caCert"
|
||||
ClusterStatusFieldCapabilities = "capabilities"
|
||||
ClusterStatusFieldCapacity = "capacity"
|
||||
@ -25,9 +27,11 @@ type ClusterStatus struct {
|
||||
APIEndpoint string `json:"apiEndpoint,omitempty" yaml:"apiEndpoint,omitempty"`
|
||||
AgentImage string `json:"agentImage,omitempty" yaml:"agentImage,omitempty"`
|
||||
Allocatable map[string]string `json:"allocatable,omitempty" yaml:"allocatable,omitempty"`
|
||||
AppliedEnableClusterAuth bool `json:"appliedEnableAuth,omitempty" yaml:"appliedEnableAuth,omitempty"`
|
||||
AppliedEnableNetworkPolicy bool `json:"appliedEnableNetworkPolicy,omitempty" yaml:"appliedEnableNetworkPolicy,omitempty"`
|
||||
AppliedPodSecurityPolicyTemplateName string `json:"appliedPodSecurityPolicyTemplateId,omitempty" yaml:"appliedPodSecurityPolicyTemplateId,omitempty"`
|
||||
AppliedSpec *ClusterSpec `json:"appliedSpec,omitempty" yaml:"appliedSpec,omitempty"`
|
||||
AuthImage string `json:"authImage,omitempty" yaml:"authImage,omitempty"`
|
||||
CACert string `json:"caCert,omitempty" yaml:"caCert,omitempty"`
|
||||
Capabilities *Capabilities `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
|
||||
Capacity map[string]string `json:"capacity,omitempty" yaml:"capacity,omitempty"`
|
||||
|
@ -8,6 +8,7 @@ const (
|
||||
TokenType = "token"
|
||||
TokenFieldAnnotations = "annotations"
|
||||
TokenFieldAuthProvider = "authProvider"
|
||||
TokenFieldClusterID = "clusterId"
|
||||
TokenFieldCreated = "created"
|
||||
TokenFieldCreatorID = "creatorId"
|
||||
TokenFieldCurrent = "current"
|
||||
@ -34,6 +35,7 @@ type Token struct {
|
||||
types.Resource
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
AuthProvider string `json:"authProvider,omitempty" yaml:"authProvider,omitempty"`
|
||||
ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Current bool `json:"current,omitempty" yaml:"current,omitempty"`
|
||||
|
@ -4,6 +4,7 @@ const (
|
||||
TokenType = "token"
|
||||
TokenFieldAnnotations = "annotations"
|
||||
TokenFieldAuthProvider = "authProvider"
|
||||
TokenFieldClusterID = "clusterId"
|
||||
TokenFieldCreated = "created"
|
||||
TokenFieldCreatorID = "creatorId"
|
||||
TokenFieldCurrent = "current"
|
||||
@ -29,6 +30,7 @@ const (
|
||||
type Token struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
AuthProvider string `json:"authProvider,omitempty" yaml:"authProvider,omitempty"`
|
||||
ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Current bool `json:"current,omitempty" yaml:"current,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user