mirror of
https://github.com/rancher/types.git
synced 2025-04-28 02:30:07 +00:00
go generate
This commit is contained in:
parent
b5f3a23193
commit
1e6b3e4c5f
@ -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 (
|
||||
CloudCredentialGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "CloudCredential",
|
||||
}
|
||||
CloudCredentialResource = metav1.APIResource{
|
||||
Name: "cloudcredentials",
|
||||
SingularName: "cloudcredential",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: CloudCredentialGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewCloudCredential(namespace, name string, obj CloudCredential) *CloudCredential {
|
||||
obj.APIVersion, obj.Kind = CloudCredentialGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type CloudCredentialList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []CloudCredential
|
||||
}
|
||||
|
||||
type CloudCredentialHandlerFunc func(key string, obj *CloudCredential) (runtime.Object, error)
|
||||
|
||||
type CloudCredentialChangeHandlerFunc func(obj *CloudCredential) (runtime.Object, error)
|
||||
|
||||
type CloudCredentialLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*CloudCredential, err error)
|
||||
Get(namespace, name string) (*CloudCredential, error)
|
||||
}
|
||||
|
||||
type CloudCredentialController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() CloudCredentialLister
|
||||
AddHandler(ctx context.Context, name string, handler CloudCredentialHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler CloudCredentialHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type CloudCredentialInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*CloudCredential) (*CloudCredential, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error)
|
||||
Get(name string, opts metav1.GetOptions) (*CloudCredential, error)
|
||||
Update(*CloudCredential) (*CloudCredential, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*CloudCredentialList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() CloudCredentialController
|
||||
AddHandler(ctx context.Context, name string, sync CloudCredentialHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle CloudCredentialLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CloudCredentialHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CloudCredentialLifecycle)
|
||||
}
|
||||
|
||||
type cloudCredentialLister struct {
|
||||
controller *cloudCredentialController
|
||||
}
|
||||
|
||||
func (l *cloudCredentialLister) List(namespace string, selector labels.Selector) (ret []*CloudCredential, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*CloudCredential))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *cloudCredentialLister) Get(namespace, name string) (*CloudCredential, 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: CloudCredentialGroupVersionKind.Group,
|
||||
Resource: "cloudCredential",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*CloudCredential), nil
|
||||
}
|
||||
|
||||
type cloudCredentialController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *cloudCredentialController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *cloudCredentialController) Lister() CloudCredentialLister {
|
||||
return &cloudCredentialLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *cloudCredentialController) AddHandler(ctx context.Context, name string, handler CloudCredentialHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CloudCredential); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *cloudCredentialController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CloudCredentialHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*CloudCredential); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type cloudCredentialFactory struct {
|
||||
}
|
||||
|
||||
func (c cloudCredentialFactory) Object() runtime.Object {
|
||||
return &CloudCredential{}
|
||||
}
|
||||
|
||||
func (c cloudCredentialFactory) List() runtime.Object {
|
||||
return &CloudCredentialList{}
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Controller() CloudCredentialController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.cloudCredentialControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(CloudCredentialGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &cloudCredentialController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.cloudCredentialControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type cloudCredentialClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller CloudCredentialController
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Create(o *CloudCredential) (*CloudCredential, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*CloudCredential), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Get(name string, opts metav1.GetOptions) (*CloudCredential, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*CloudCredential), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*CloudCredential), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Update(o *CloudCredential) (*CloudCredential, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*CloudCredential), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) List(opts metav1.ListOptions) (*CloudCredentialList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*CloudCredentialList), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *cloudCredentialClient) Patch(o *CloudCredential, patchType types.PatchType, data []byte, subresources ...string) (*CloudCredential, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*CloudCredential), err
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) AddHandler(ctx context.Context, name string, sync CloudCredentialHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) AddLifecycle(ctx context.Context, name string, lifecycle CloudCredentialLifecycle) {
|
||||
sync := NewCloudCredentialLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync CloudCredentialHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *cloudCredentialClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle CloudCredentialLifecycle) {
|
||||
sync := NewCloudCredentialLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type CloudCredentialIndexer func(obj *CloudCredential) ([]string, error)
|
||||
|
||||
type CloudCredentialClientCache interface {
|
||||
Get(namespace, name string) (*CloudCredential, error)
|
||||
List(namespace string, selector labels.Selector) ([]*CloudCredential, error)
|
||||
|
||||
Index(name string, indexer CloudCredentialIndexer)
|
||||
GetIndexed(name, key string) ([]*CloudCredential, error)
|
||||
}
|
||||
|
||||
type CloudCredentialClient interface {
|
||||
Create(*CloudCredential) (*CloudCredential, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error)
|
||||
Update(*CloudCredential) (*CloudCredential, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*CloudCredentialList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() CloudCredentialClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() CloudCredentialInterface
|
||||
}
|
||||
|
||||
type cloudCredentialClientCache struct {
|
||||
client *cloudCredentialClient2
|
||||
}
|
||||
|
||||
type cloudCredentialClient2 struct {
|
||||
iface CloudCredentialInterface
|
||||
controller CloudCredentialController
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Interface() CloudCredentialInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Create(obj *CloudCredential) (*CloudCredential, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Get(namespace, name string, opts metav1.GetOptions) (*CloudCredential, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Update(obj *CloudCredential) (*CloudCredential, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) List(namespace string, opts metav1.ListOptions) (*CloudCredentialList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClientCache) Get(namespace, name string) (*CloudCredential, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClientCache) List(namespace string, selector labels.Selector) ([]*CloudCredential, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) Cache() CloudCredentialClientCache {
|
||||
n.loadController()
|
||||
return &cloudCredentialClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) OnCreate(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &cloudCredentialLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) OnChange(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &cloudCredentialLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) OnRemove(ctx context.Context, name string, sync CloudCredentialChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &cloudCredentialLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClientCache) Index(name string, indexer CloudCredentialIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*CloudCredential); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClientCache) GetIndexed(name, key string) ([]*CloudCredential, error) {
|
||||
var result []*CloudCredential
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*CloudCredential); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *cloudCredentialClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type cloudCredentialLifecycleDelegate struct {
|
||||
create CloudCredentialChangeHandlerFunc
|
||||
update CloudCredentialChangeHandlerFunc
|
||||
remove CloudCredentialChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *cloudCredentialLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *cloudCredentialLifecycleDelegate) Create(obj *CloudCredential) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *cloudCredentialLifecycleDelegate) Remove(obj *CloudCredential) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *cloudCredentialLifecycleDelegate) Updated(obj *CloudCredential) (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 CloudCredentialLifecycle interface {
|
||||
Create(obj *CloudCredential) (runtime.Object, error)
|
||||
Remove(obj *CloudCredential) (runtime.Object, error)
|
||||
Updated(obj *CloudCredential) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type cloudCredentialLifecycleAdapter struct {
|
||||
lifecycle CloudCredentialLifecycle
|
||||
}
|
||||
|
||||
func (w *cloudCredentialLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *cloudCredentialLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *cloudCredentialLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*CloudCredential))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *cloudCredentialLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*CloudCredential))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *cloudCredentialLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*CloudCredential))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewCloudCredentialLifecycleAdapter(name string, clusterScoped bool, client CloudCredentialInterface, l CloudCredentialLifecycle) CloudCredentialHandlerFunc {
|
||||
adapter := &cloudCredentialLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *CloudCredential) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -800,6 +800,66 @@ func (in *ChangePasswordInput) DeepCopy() *ChangePasswordInput {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CloudCredential) DeepCopyInto(out *CloudCredential) {
|
||||
*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 CloudCredential.
|
||||
func (in *CloudCredential) DeepCopy() *CloudCredential {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudCredential)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CloudCredential) 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 *CloudCredentialList) DeepCopyInto(out *CloudCredentialList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]CloudCredential, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudCredentialList.
|
||||
func (in *CloudCredentialList) DeepCopy() *CloudCredentialList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CloudCredentialList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *CloudCredentialList) 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 *CloudProvider) DeepCopyInto(out *CloudProvider) {
|
||||
*out = *in
|
||||
|
@ -74,6 +74,7 @@ type Interface interface {
|
||||
MonitorMetricsGetter
|
||||
ClusterMonitorGraphsGetter
|
||||
ProjectMonitorGraphsGetter
|
||||
CloudCredentialsGetter
|
||||
}
|
||||
|
||||
type Clients struct {
|
||||
@ -133,6 +134,7 @@ type Clients struct {
|
||||
MonitorMetric MonitorMetricClient
|
||||
ClusterMonitorGraph ClusterMonitorGraphClient
|
||||
ProjectMonitorGraph ProjectMonitorGraphClient
|
||||
CloudCredential CloudCredentialClient
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@ -194,6 +196,7 @@ type Client struct {
|
||||
monitorMetricControllers map[string]MonitorMetricController
|
||||
clusterMonitorGraphControllers map[string]ClusterMonitorGraphController
|
||||
projectMonitorGraphControllers map[string]ProjectMonitorGraphController
|
||||
cloudCredentialControllers map[string]CloudCredentialController
|
||||
}
|
||||
|
||||
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
|
||||
@ -391,6 +394,9 @@ func NewClientsFromInterface(iface Interface) *Clients {
|
||||
ProjectMonitorGraph: &projectMonitorGraphClient2{
|
||||
iface: iface.ProjectMonitorGraphs(""),
|
||||
},
|
||||
CloudCredential: &cloudCredentialClient2{
|
||||
iface: iface.CloudCredentials(""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -461,6 +467,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
monitorMetricControllers: map[string]MonitorMetricController{},
|
||||
clusterMonitorGraphControllers: map[string]ClusterMonitorGraphController{},
|
||||
projectMonitorGraphControllers: map[string]ProjectMonitorGraphController{},
|
||||
cloudCredentialControllers: map[string]CloudCredentialController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -1177,3 +1184,16 @@ func (c *Client) ProjectMonitorGraphs(namespace string) ProjectMonitorGraphInter
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type CloudCredentialsGetter interface {
|
||||
CloudCredentials(namespace string) CloudCredentialInterface
|
||||
}
|
||||
|
||||
func (c *Client) CloudCredentials(namespace string) CloudCredentialInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &CloudCredentialResource, CloudCredentialGroupVersionKind, cloudCredentialFactory{})
|
||||
return &cloudCredentialClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
@ -140,6 +140,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&ClusterMonitorGraphList{},
|
||||
&ProjectMonitorGraph{},
|
||||
&ProjectMonitorGraphList{},
|
||||
&CloudCredential{},
|
||||
&CloudCredentialList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ type Client struct {
|
||||
MonitorMetric MonitorMetricOperations
|
||||
ClusterMonitorGraph ClusterMonitorGraphOperations
|
||||
ProjectMonitorGraph ProjectMonitorGraphOperations
|
||||
CloudCredential CloudCredentialOperations
|
||||
ManagementSecret ManagementSecretOperations
|
||||
}
|
||||
|
||||
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
@ -125,6 +127,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
client.MonitorMetric = newMonitorMetricClient(client)
|
||||
client.ClusterMonitorGraph = newClusterMonitorGraphClient(client)
|
||||
client.ProjectMonitorGraph = newProjectMonitorGraphClient(client)
|
||||
client.CloudCredential = newCloudCredentialClient(client)
|
||||
client.ManagementSecret = newManagementSecretClient(client)
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
97
client/management/v3/zz_generated_cloud_credential.go
Normal file
97
client/management/v3/zz_generated_cloud_credential.go
Normal file
@ -0,0 +1,97 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
CloudCredentialType = "cloudCredential"
|
||||
CloudCredentialFieldAnnotations = "annotations"
|
||||
CloudCredentialFieldCreated = "created"
|
||||
CloudCredentialFieldCreatorID = "creatorId"
|
||||
CloudCredentialFieldLabels = "labels"
|
||||
CloudCredentialFieldOwnerReferences = "ownerReferences"
|
||||
CloudCredentialFieldRemoved = "removed"
|
||||
CloudCredentialFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type CloudCredential struct {
|
||||
types.Resource
|
||||
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"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,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"`
|
||||
}
|
||||
|
||||
type CloudCredentialCollection struct {
|
||||
types.Collection
|
||||
Data []CloudCredential `json:"data,omitempty"`
|
||||
client *CloudCredentialClient
|
||||
}
|
||||
|
||||
type CloudCredentialClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type CloudCredentialOperations interface {
|
||||
List(opts *types.ListOpts) (*CloudCredentialCollection, error)
|
||||
Create(opts *CloudCredential) (*CloudCredential, error)
|
||||
Update(existing *CloudCredential, updates interface{}) (*CloudCredential, error)
|
||||
Replace(existing *CloudCredential) (*CloudCredential, error)
|
||||
ByID(id string) (*CloudCredential, error)
|
||||
Delete(container *CloudCredential) error
|
||||
}
|
||||
|
||||
func newCloudCredentialClient(apiClient *Client) *CloudCredentialClient {
|
||||
return &CloudCredentialClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) Create(container *CloudCredential) (*CloudCredential, error) {
|
||||
resp := &CloudCredential{}
|
||||
err := c.apiClient.Ops.DoCreate(CloudCredentialType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) Update(existing *CloudCredential, updates interface{}) (*CloudCredential, error) {
|
||||
resp := &CloudCredential{}
|
||||
err := c.apiClient.Ops.DoUpdate(CloudCredentialType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) Replace(obj *CloudCredential) (*CloudCredential, error) {
|
||||
resp := &CloudCredential{}
|
||||
err := c.apiClient.Ops.DoReplace(CloudCredentialType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) List(opts *types.ListOpts) (*CloudCredentialCollection, error) {
|
||||
resp := &CloudCredentialCollection{}
|
||||
err := c.apiClient.Ops.DoList(CloudCredentialType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *CloudCredentialCollection) Next() (*CloudCredentialCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &CloudCredentialCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) ByID(id string) (*CloudCredential, error) {
|
||||
resp := &CloudCredential{}
|
||||
err := c.apiClient.Ops.DoByID(CloudCredentialType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *CloudCredentialClient) Delete(container *CloudCredential) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(CloudCredentialType, &container.Resource)
|
||||
}
|
105
client/management/v3/zz_generated_management_secret.go
Normal file
105
client/management/v3/zz_generated_management_secret.go
Normal file
@ -0,0 +1,105 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/types"
|
||||
)
|
||||
|
||||
const (
|
||||
ManagementSecretType = "managementSecret"
|
||||
ManagementSecretFieldAnnotations = "annotations"
|
||||
ManagementSecretFieldCreated = "created"
|
||||
ManagementSecretFieldCreatorID = "creatorId"
|
||||
ManagementSecretFieldData = "data"
|
||||
ManagementSecretFieldLabels = "labels"
|
||||
ManagementSecretFieldName = "name"
|
||||
ManagementSecretFieldOwnerReferences = "ownerReferences"
|
||||
ManagementSecretFieldRemoved = "removed"
|
||||
ManagementSecretFieldStringData = "stringData"
|
||||
ManagementSecretFieldType = "type"
|
||||
ManagementSecretFieldUUID = "uuid"
|
||||
)
|
||||
|
||||
type ManagementSecret struct {
|
||||
types.Resource
|
||||
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"`
|
||||
Data map[string]string `json:"data,omitempty" yaml:"data,omitempty"`
|
||||
Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
|
||||
Removed string `json:"removed,omitempty" yaml:"removed,omitempty"`
|
||||
StringData map[string]string `json:"stringData,omitempty" yaml:"stringData,omitempty"`
|
||||
Type string `json:"type,omitempty" yaml:"type,omitempty"`
|
||||
UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"`
|
||||
}
|
||||
|
||||
type ManagementSecretCollection struct {
|
||||
types.Collection
|
||||
Data []ManagementSecret `json:"data,omitempty"`
|
||||
client *ManagementSecretClient
|
||||
}
|
||||
|
||||
type ManagementSecretClient struct {
|
||||
apiClient *Client
|
||||
}
|
||||
|
||||
type ManagementSecretOperations interface {
|
||||
List(opts *types.ListOpts) (*ManagementSecretCollection, error)
|
||||
Create(opts *ManagementSecret) (*ManagementSecret, error)
|
||||
Update(existing *ManagementSecret, updates interface{}) (*ManagementSecret, error)
|
||||
Replace(existing *ManagementSecret) (*ManagementSecret, error)
|
||||
ByID(id string) (*ManagementSecret, error)
|
||||
Delete(container *ManagementSecret) error
|
||||
}
|
||||
|
||||
func newManagementSecretClient(apiClient *Client) *ManagementSecretClient {
|
||||
return &ManagementSecretClient{
|
||||
apiClient: apiClient,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) Create(container *ManagementSecret) (*ManagementSecret, error) {
|
||||
resp := &ManagementSecret{}
|
||||
err := c.apiClient.Ops.DoCreate(ManagementSecretType, container, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) Update(existing *ManagementSecret, updates interface{}) (*ManagementSecret, error) {
|
||||
resp := &ManagementSecret{}
|
||||
err := c.apiClient.Ops.DoUpdate(ManagementSecretType, &existing.Resource, updates, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) Replace(obj *ManagementSecret) (*ManagementSecret, error) {
|
||||
resp := &ManagementSecret{}
|
||||
err := c.apiClient.Ops.DoReplace(ManagementSecretType, &obj.Resource, obj, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) List(opts *types.ListOpts) (*ManagementSecretCollection, error) {
|
||||
resp := &ManagementSecretCollection{}
|
||||
err := c.apiClient.Ops.DoList(ManagementSecretType, opts, resp)
|
||||
resp.client = c
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (cc *ManagementSecretCollection) Next() (*ManagementSecretCollection, error) {
|
||||
if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
|
||||
resp := &ManagementSecretCollection{}
|
||||
err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
|
||||
resp.client = cc.client
|
||||
return resp, err
|
||||
}
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) ByID(id string) (*ManagementSecret, error) {
|
||||
resp := &ManagementSecret{}
|
||||
err := c.apiClient.Ops.DoByID(ManagementSecretType, id, resp)
|
||||
return resp, err
|
||||
}
|
||||
|
||||
func (c *ManagementSecretClient) Delete(container *ManagementSecret) error {
|
||||
return c.apiClient.Ops.DoResourceDelete(ManagementSecretType, &container.Resource)
|
||||
}
|
@ -9,6 +9,7 @@ const (
|
||||
NodeTemplateFieldAnnotations = "annotations"
|
||||
NodeTemplateFieldAuthCertificateAuthority = "authCertificateAuthority"
|
||||
NodeTemplateFieldAuthKey = "authKey"
|
||||
NodeTemplateFieldCloudCredentialID = "cloudCredentialId"
|
||||
NodeTemplateFieldCreated = "created"
|
||||
NodeTemplateFieldCreatorID = "creatorId"
|
||||
NodeTemplateFieldDescription = "description"
|
||||
@ -38,6 +39,7 @@ type NodeTemplate struct {
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"authCertificateAuthority,omitempty"`
|
||||
AuthKey string `json:"authKey,omitempty" yaml:"authKey,omitempty"`
|
||||
CloudCredentialID string `json:"cloudCredentialId,omitempty" yaml:"cloudCredentialId,omitempty"`
|
||||
Created string `json:"created,omitempty" yaml:"created,omitempty"`
|
||||
CreatorID string `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
|
||||
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
|
@ -4,6 +4,7 @@ const (
|
||||
NodeTemplateSpecType = "nodeTemplateSpec"
|
||||
NodeTemplateSpecFieldAuthCertificateAuthority = "authCertificateAuthority"
|
||||
NodeTemplateSpecFieldAuthKey = "authKey"
|
||||
NodeTemplateSpecFieldCloudCredentialID = "cloudCredentialId"
|
||||
NodeTemplateSpecFieldDescription = "description"
|
||||
NodeTemplateSpecFieldDisplayName = "displayName"
|
||||
NodeTemplateSpecFieldDockerVersion = "dockerVersion"
|
||||
@ -21,6 +22,7 @@ const (
|
||||
type NodeTemplateSpec struct {
|
||||
AuthCertificateAuthority string `json:"authCertificateAuthority,omitempty" yaml:"authCertificateAuthority,omitempty"`
|
||||
AuthKey string `json:"authKey,omitempty" yaml:"authKey,omitempty"`
|
||||
CloudCredentialID string `json:"cloudCredentialId,omitempty" yaml:"cloudCredentialId,omitempty"`
|
||||
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
|
||||
DockerVersion string `json:"dockerVersion,omitempty" yaml:"dockerVersion,omitempty"`
|
||||
|
@ -59,6 +59,8 @@ type Config struct {
|
||||
MonitorMetrics map[string]managementClient.MonitorMetric `json:"monitorMetrics,omitempty" yaml:"monitorMetrics,omitempty"`
|
||||
ClusterMonitorGraphs map[string]managementClient.ClusterMonitorGraph `json:"clusterMonitorGraphs,omitempty" yaml:"clusterMonitorGraphs,omitempty"`
|
||||
ProjectMonitorGraphs map[string]managementClient.ProjectMonitorGraph `json:"projectMonitorGraphs,omitempty" yaml:"projectMonitorGraphs,omitempty"`
|
||||
CloudCredentials map[string]managementClient.CloudCredential `json:"cloudCredentials,omitempty" yaml:"cloudCredentials,omitempty"`
|
||||
ManagementSecrets map[string]managementClient.ManagementSecret `json:"managementSecrets,omitempty" yaml:"managementSecrets,omitempty"`
|
||||
|
||||
// Cluster Client
|
||||
Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user