From 52e7fdabc820c019683a2d8ee7e0416d0367cde2 Mon Sep 17 00:00:00 2001 From: Daishan Peng Date: Mon, 19 Mar 2018 09:41:22 -0700 Subject: [PATCH] generate changes --- ...rated_cluster_compose_config_controller.go | 252 ++++++++++++++++++ ...luster_compose_config_lifecycle_adapter.go | 51 ++++ .../v3/zz_generated_deepcopy.go | 228 ++++++++++++++++ ...erated_global_compose_config_controller.go | 251 +++++++++++++++++ ...global_compose_config_lifecycle_adapter.go | 51 ++++ .../v3/zz_generated_k8s_client.go | 32 +++ .../v3/zz_generated_scheme.go | 4 + .../v3/zz_generated_deepcopy.go | 137 ++++++++++ .../v3/zz_generated_k8s_client.go | 16 ++ ...ted_namespace_compose_config_controller.go | 252 ++++++++++++++++++ ...espace_compose_config_lifecycle_adapter.go | 51 ++++ .../v3/zz_generated_scheme.go | 2 + client/management/v3/zz_generated_client.go | 4 + .../v3/zz_generated_cluster_compose_config.go | 105 ++++++++ .../v3/zz_generated_cluster_compose_spec.go | 12 + .../v3/zz_generated_compose_condition.go | 20 ++ .../v3/zz_generated_compose_spec.go | 10 + .../v3/zz_generated_compose_status.go | 10 + .../v3/zz_generated_global_compose_config.go | 101 +++++++ client/project/v3/zz_generated_client.go | 2 + .../v3/zz_generated_compose_condition.go | 20 ++ .../project/v3/zz_generated_compose_status.go | 10 + .../zz_generated_namespace_compose_config.go | 107 ++++++++ .../v3/zz_generated_namespace_compose_spec.go | 14 + compose/zz_generated_compose.go | 86 ++++++ 25 files changed, 1828 insertions(+) create mode 100644 apis/management.cattle.io/v3/zz_generated_cluster_compose_config_controller.go create mode 100644 apis/management.cattle.io/v3/zz_generated_cluster_compose_config_lifecycle_adapter.go create mode 100644 apis/management.cattle.io/v3/zz_generated_global_compose_config_controller.go create mode 100644 apis/management.cattle.io/v3/zz_generated_global_compose_config_lifecycle_adapter.go create mode 100644 apis/project.cattle.io/v3/zz_generated_namespace_compose_config_controller.go create mode 100644 apis/project.cattle.io/v3/zz_generated_namespace_compose_config_lifecycle_adapter.go create mode 100644 client/management/v3/zz_generated_cluster_compose_config.go create mode 100644 client/management/v3/zz_generated_cluster_compose_spec.go create mode 100644 client/management/v3/zz_generated_compose_condition.go create mode 100644 client/management/v3/zz_generated_compose_spec.go create mode 100644 client/management/v3/zz_generated_compose_status.go create mode 100644 client/management/v3/zz_generated_global_compose_config.go create mode 100644 client/project/v3/zz_generated_compose_condition.go create mode 100644 client/project/v3/zz_generated_compose_status.go create mode 100644 client/project/v3/zz_generated_namespace_compose_config.go create mode 100644 client/project/v3/zz_generated_namespace_compose_spec.go create mode 100644 compose/zz_generated_compose.go diff --git a/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_controller.go b/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_controller.go new file mode 100644 index 0000000000..7ec062d366 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_controller.go @@ -0,0 +1,252 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/clientbase" + "github.com/rancher/norman/controller" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + ClusterComposeConfigGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "ClusterComposeConfig", + } + ClusterComposeConfigResource = metav1.APIResource{ + Name: "clustercomposeconfigs", + SingularName: "clustercomposeconfig", + Namespaced: true, + + Kind: ClusterComposeConfigGroupVersionKind.Kind, + } +) + +type ClusterComposeConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterComposeConfig +} + +type ClusterComposeConfigHandlerFunc func(key string, obj *ClusterComposeConfig) error + +type ClusterComposeConfigLister interface { + List(namespace string, selector labels.Selector) (ret []*ClusterComposeConfig, err error) + Get(namespace, name string) (*ClusterComposeConfig, error) +} + +type ClusterComposeConfigController interface { + Informer() cache.SharedIndexInformer + Lister() ClusterComposeConfigLister + AddHandler(name string, handler ClusterComposeConfigHandlerFunc) + AddClusterScopedHandler(name, clusterName string, handler ClusterComposeConfigHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type ClusterComposeConfigInterface interface { + ObjectClient() *clientbase.ObjectClient + Create(*ClusterComposeConfig) (*ClusterComposeConfig, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) + Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) + Update(*ClusterComposeConfig) (*ClusterComposeConfig, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*ClusterComposeConfigList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() ClusterComposeConfigController + AddHandler(name string, sync ClusterComposeConfigHandlerFunc) + AddLifecycle(name string, lifecycle ClusterComposeConfigLifecycle) + AddClusterScopedHandler(name, clusterName string, sync ClusterComposeConfigHandlerFunc) + AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterComposeConfigLifecycle) +} + +type clusterComposeConfigLister struct { + controller *clusterComposeConfigController +} + +func (l *clusterComposeConfigLister) List(namespace string, selector labels.Selector) (ret []*ClusterComposeConfig, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*ClusterComposeConfig)) + }) + return +} + +func (l *clusterComposeConfigLister) Get(namespace, name string) (*ClusterComposeConfig, 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: ClusterComposeConfigGroupVersionKind.Group, + Resource: "clusterComposeConfig", + }, name) + } + return obj.(*ClusterComposeConfig), nil +} + +type clusterComposeConfigController struct { + controller.GenericController +} + +func (c *clusterComposeConfigController) Lister() ClusterComposeConfigLister { + return &clusterComposeConfigLister{ + controller: c, + } +} + +func (c *clusterComposeConfigController) AddHandler(name string, handler ClusterComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + return handler(key, obj.(*ClusterComposeConfig)) + }) +} + +func (c *clusterComposeConfigController) AddClusterScopedHandler(name, cluster string, handler ClusterComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + + if !controller.ObjectInCluster(cluster, obj) { + return nil + } + + return handler(key, obj.(*ClusterComposeConfig)) + }) +} + +type clusterComposeConfigFactory struct { +} + +func (c clusterComposeConfigFactory) Object() runtime.Object { + return &ClusterComposeConfig{} +} + +func (c clusterComposeConfigFactory) List() runtime.Object { + return &ClusterComposeConfigList{} +} + +func (s *clusterComposeConfigClient) Controller() ClusterComposeConfigController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.clusterComposeConfigControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(ClusterComposeConfigGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &clusterComposeConfigController{ + GenericController: genericController, + } + + s.client.clusterComposeConfigControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type clusterComposeConfigClient struct { + client *Client + ns string + objectClient *clientbase.ObjectClient + controller ClusterComposeConfigController +} + +func (s *clusterComposeConfigClient) ObjectClient() *clientbase.ObjectClient { + return s.objectClient +} + +func (s *clusterComposeConfigClient) Create(o *ClusterComposeConfig) (*ClusterComposeConfig, error) { + obj, err := s.objectClient.Create(o) + return obj.(*ClusterComposeConfig), err +} + +func (s *clusterComposeConfigClient) Get(name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*ClusterComposeConfig), err +} + +func (s *clusterComposeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterComposeConfig, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*ClusterComposeConfig), err +} + +func (s *clusterComposeConfigClient) Update(o *ClusterComposeConfig) (*ClusterComposeConfig, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*ClusterComposeConfig), err +} + +func (s *clusterComposeConfigClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *clusterComposeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *clusterComposeConfigClient) List(opts metav1.ListOptions) (*ClusterComposeConfigList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*ClusterComposeConfigList), err +} + +func (s *clusterComposeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *clusterComposeConfigClient) Patch(o *ClusterComposeConfig, data []byte, subresources ...string) (*ClusterComposeConfig, error) { + obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) + return obj.(*ClusterComposeConfig), err +} + +func (s *clusterComposeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *clusterComposeConfigClient) AddHandler(name string, sync ClusterComposeConfigHandlerFunc) { + s.Controller().AddHandler(name, sync) +} + +func (s *clusterComposeConfigClient) AddLifecycle(name string, lifecycle ClusterComposeConfigLifecycle) { + sync := NewClusterComposeConfigLifecycleAdapter(name, false, s, lifecycle) + s.AddHandler(name, sync) +} + +func (s *clusterComposeConfigClient) AddClusterScopedHandler(name, clusterName string, sync ClusterComposeConfigHandlerFunc) { + s.Controller().AddClusterScopedHandler(name, clusterName, sync) +} + +func (s *clusterComposeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ClusterComposeConfigLifecycle) { + sync := NewClusterComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.AddClusterScopedHandler(name, clusterName, sync) +} diff --git a/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_lifecycle_adapter.go new file mode 100644 index 0000000000..457d39d066 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_cluster_compose_config_lifecycle_adapter.go @@ -0,0 +1,51 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type ClusterComposeConfigLifecycle interface { + Create(obj *ClusterComposeConfig) (*ClusterComposeConfig, error) + Remove(obj *ClusterComposeConfig) (*ClusterComposeConfig, error) + Updated(obj *ClusterComposeConfig) (*ClusterComposeConfig, error) +} + +type clusterComposeConfigLifecycleAdapter struct { + lifecycle ClusterComposeConfigLifecycle +} + +func (w *clusterComposeConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*ClusterComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *clusterComposeConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*ClusterComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *clusterComposeConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*ClusterComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func NewClusterComposeConfigLifecycleAdapter(name string, clusterScoped bool, client ClusterComposeConfigInterface, l ClusterComposeConfigLifecycle) ClusterComposeConfigHandlerFunc { + adapter := &clusterComposeConfigLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *ClusterComposeConfig) error { + if obj == nil { + return syncFn(key, nil) + } + return syncFn(key, obj) + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/apis/management.cattle.io/v3/zz_generated_deepcopy.go index a763ce0ab9..2d553129ee 100644 --- a/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -115,6 +115,18 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*ClusterComponentStatus).DeepCopyInto(out.(*ClusterComponentStatus)) return nil }, InType: reflect.TypeOf(&ClusterComponentStatus{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ClusterComposeConfig).DeepCopyInto(out.(*ClusterComposeConfig)) + return nil + }, InType: reflect.TypeOf(&ClusterComposeConfig{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ClusterComposeConfigList).DeepCopyInto(out.(*ClusterComposeConfigList)) + return nil + }, InType: reflect.TypeOf(&ClusterComposeConfigList{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ClusterComposeSpec).DeepCopyInto(out.(*ClusterComposeSpec)) + return nil + }, InType: reflect.TypeOf(&ClusterComposeSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*ClusterCondition).DeepCopyInto(out.(*ClusterCondition)) return nil @@ -191,6 +203,18 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*ClusterStatus).DeepCopyInto(out.(*ClusterStatus)) return nil }, InType: reflect.TypeOf(&ClusterStatus{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ComposeCondition).DeepCopyInto(out.(*ComposeCondition)) + return nil + }, InType: reflect.TypeOf(&ComposeCondition{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ComposeSpec).DeepCopyInto(out.(*ComposeSpec)) + return nil + }, InType: reflect.TypeOf(&ComposeSpec{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ComposeStatus).DeepCopyInto(out.(*ComposeStatus)) + return nil + }, InType: reflect.TypeOf(&ComposeStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*Condition).DeepCopyInto(out.(*Condition)) return nil @@ -255,6 +279,14 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*GithubConfigTestOutput).DeepCopyInto(out.(*GithubConfigTestOutput)) return nil }, InType: reflect.TypeOf(&GithubConfigTestOutput{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*GlobalComposeConfig).DeepCopyInto(out.(*GlobalComposeConfig)) + return nil + }, InType: reflect.TypeOf(&GlobalComposeConfig{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*GlobalComposeConfigList).DeepCopyInto(out.(*GlobalComposeConfigList)) + return nil + }, InType: reflect.TypeOf(&GlobalComposeConfigList{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*GlobalRole).DeepCopyInto(out.(*GlobalRole)) return nil @@ -1400,6 +1432,86 @@ func (in *ClusterComponentStatus) DeepCopy() *ClusterComponentStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterComposeConfig) DeepCopyInto(out *ClusterComposeConfig) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeConfig. +func (in *ClusterComposeConfig) DeepCopy() *ClusterComposeConfig { + if in == nil { + return nil + } + out := new(ClusterComposeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterComposeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterComposeConfigList) DeepCopyInto(out *ClusterComposeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterComposeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeConfigList. +func (in *ClusterComposeConfigList) DeepCopy() *ClusterComposeConfigList { + if in == nil { + return nil + } + out := new(ClusterComposeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterComposeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterComposeSpec) DeepCopyInto(out *ClusterComposeSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterComposeSpec. +func (in *ClusterComposeSpec) DeepCopy() *ClusterComposeSpec { + if in == nil { + return nil + } + out := new(ClusterComposeSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterCondition) DeepCopyInto(out *ClusterCondition) { *out = *in @@ -1982,6 +2094,59 @@ func (in *ClusterStatus) DeepCopy() *ClusterStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComposeCondition) DeepCopyInto(out *ComposeCondition) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeCondition. +func (in *ComposeCondition) DeepCopy() *ComposeCondition { + if in == nil { + return nil + } + out := new(ComposeCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComposeSpec) DeepCopyInto(out *ComposeSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeSpec. +func (in *ComposeSpec) DeepCopy() *ComposeSpec { + if in == nil { + return nil + } + out := new(ComposeSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComposeStatus) DeepCopyInto(out *ComposeStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ComposeCondition, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeStatus. +func (in *ComposeStatus) DeepCopy() *ComposeStatus { + if in == nil { + return nil + } + out := new(ComposeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Condition) DeepCopyInto(out *Condition) { *out = *in @@ -2349,6 +2514,69 @@ func (in *GithubConfigTestOutput) DeepCopy() *GithubConfigTestOutput { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalComposeConfig) DeepCopyInto(out *GlobalComposeConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalComposeConfig. +func (in *GlobalComposeConfig) DeepCopy() *GlobalComposeConfig { + if in == nil { + return nil + } + out := new(GlobalComposeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalComposeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalComposeConfigList) DeepCopyInto(out *GlobalComposeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]GlobalComposeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalComposeConfigList. +func (in *GlobalComposeConfigList) DeepCopy() *GlobalComposeConfigList { + if in == nil { + return nil + } + out := new(GlobalComposeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *GlobalComposeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GlobalRole) DeepCopyInto(out *GlobalRole) { *out = *in diff --git a/apis/management.cattle.io/v3/zz_generated_global_compose_config_controller.go b/apis/management.cattle.io/v3/zz_generated_global_compose_config_controller.go new file mode 100644 index 0000000000..fe7600dc8c --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_global_compose_config_controller.go @@ -0,0 +1,251 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/clientbase" + "github.com/rancher/norman/controller" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + GlobalComposeConfigGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "GlobalComposeConfig", + } + GlobalComposeConfigResource = metav1.APIResource{ + Name: "globalcomposeconfigs", + SingularName: "globalcomposeconfig", + Namespaced: false, + Kind: GlobalComposeConfigGroupVersionKind.Kind, + } +) + +type GlobalComposeConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []GlobalComposeConfig +} + +type GlobalComposeConfigHandlerFunc func(key string, obj *GlobalComposeConfig) error + +type GlobalComposeConfigLister interface { + List(namespace string, selector labels.Selector) (ret []*GlobalComposeConfig, err error) + Get(namespace, name string) (*GlobalComposeConfig, error) +} + +type GlobalComposeConfigController interface { + Informer() cache.SharedIndexInformer + Lister() GlobalComposeConfigLister + AddHandler(name string, handler GlobalComposeConfigHandlerFunc) + AddClusterScopedHandler(name, clusterName string, handler GlobalComposeConfigHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type GlobalComposeConfigInterface interface { + ObjectClient() *clientbase.ObjectClient + Create(*GlobalComposeConfig) (*GlobalComposeConfig, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) + Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) + Update(*GlobalComposeConfig) (*GlobalComposeConfig, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*GlobalComposeConfigList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() GlobalComposeConfigController + AddHandler(name string, sync GlobalComposeConfigHandlerFunc) + AddLifecycle(name string, lifecycle GlobalComposeConfigLifecycle) + AddClusterScopedHandler(name, clusterName string, sync GlobalComposeConfigHandlerFunc) + AddClusterScopedLifecycle(name, clusterName string, lifecycle GlobalComposeConfigLifecycle) +} + +type globalComposeConfigLister struct { + controller *globalComposeConfigController +} + +func (l *globalComposeConfigLister) List(namespace string, selector labels.Selector) (ret []*GlobalComposeConfig, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*GlobalComposeConfig)) + }) + return +} + +func (l *globalComposeConfigLister) Get(namespace, name string) (*GlobalComposeConfig, 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: GlobalComposeConfigGroupVersionKind.Group, + Resource: "globalComposeConfig", + }, name) + } + return obj.(*GlobalComposeConfig), nil +} + +type globalComposeConfigController struct { + controller.GenericController +} + +func (c *globalComposeConfigController) Lister() GlobalComposeConfigLister { + return &globalComposeConfigLister{ + controller: c, + } +} + +func (c *globalComposeConfigController) AddHandler(name string, handler GlobalComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + return handler(key, obj.(*GlobalComposeConfig)) + }) +} + +func (c *globalComposeConfigController) AddClusterScopedHandler(name, cluster string, handler GlobalComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + + if !controller.ObjectInCluster(cluster, obj) { + return nil + } + + return handler(key, obj.(*GlobalComposeConfig)) + }) +} + +type globalComposeConfigFactory struct { +} + +func (c globalComposeConfigFactory) Object() runtime.Object { + return &GlobalComposeConfig{} +} + +func (c globalComposeConfigFactory) List() runtime.Object { + return &GlobalComposeConfigList{} +} + +func (s *globalComposeConfigClient) Controller() GlobalComposeConfigController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.globalComposeConfigControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(GlobalComposeConfigGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &globalComposeConfigController{ + GenericController: genericController, + } + + s.client.globalComposeConfigControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type globalComposeConfigClient struct { + client *Client + ns string + objectClient *clientbase.ObjectClient + controller GlobalComposeConfigController +} + +func (s *globalComposeConfigClient) ObjectClient() *clientbase.ObjectClient { + return s.objectClient +} + +func (s *globalComposeConfigClient) Create(o *GlobalComposeConfig) (*GlobalComposeConfig, error) { + obj, err := s.objectClient.Create(o) + return obj.(*GlobalComposeConfig), err +} + +func (s *globalComposeConfigClient) Get(name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*GlobalComposeConfig), err +} + +func (s *globalComposeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*GlobalComposeConfig, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*GlobalComposeConfig), err +} + +func (s *globalComposeConfigClient) Update(o *GlobalComposeConfig) (*GlobalComposeConfig, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*GlobalComposeConfig), err +} + +func (s *globalComposeConfigClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *globalComposeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *globalComposeConfigClient) List(opts metav1.ListOptions) (*GlobalComposeConfigList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*GlobalComposeConfigList), err +} + +func (s *globalComposeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *globalComposeConfigClient) Patch(o *GlobalComposeConfig, data []byte, subresources ...string) (*GlobalComposeConfig, error) { + obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) + return obj.(*GlobalComposeConfig), err +} + +func (s *globalComposeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *globalComposeConfigClient) AddHandler(name string, sync GlobalComposeConfigHandlerFunc) { + s.Controller().AddHandler(name, sync) +} + +func (s *globalComposeConfigClient) AddLifecycle(name string, lifecycle GlobalComposeConfigLifecycle) { + sync := NewGlobalComposeConfigLifecycleAdapter(name, false, s, lifecycle) + s.AddHandler(name, sync) +} + +func (s *globalComposeConfigClient) AddClusterScopedHandler(name, clusterName string, sync GlobalComposeConfigHandlerFunc) { + s.Controller().AddClusterScopedHandler(name, clusterName, sync) +} + +func (s *globalComposeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle GlobalComposeConfigLifecycle) { + sync := NewGlobalComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.AddClusterScopedHandler(name, clusterName, sync) +} diff --git a/apis/management.cattle.io/v3/zz_generated_global_compose_config_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_global_compose_config_lifecycle_adapter.go new file mode 100644 index 0000000000..586710ffb2 --- /dev/null +++ b/apis/management.cattle.io/v3/zz_generated_global_compose_config_lifecycle_adapter.go @@ -0,0 +1,51 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type GlobalComposeConfigLifecycle interface { + Create(obj *GlobalComposeConfig) (*GlobalComposeConfig, error) + Remove(obj *GlobalComposeConfig) (*GlobalComposeConfig, error) + Updated(obj *GlobalComposeConfig) (*GlobalComposeConfig, error) +} + +type globalComposeConfigLifecycleAdapter struct { + lifecycle GlobalComposeConfigLifecycle +} + +func (w *globalComposeConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*GlobalComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *globalComposeConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*GlobalComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *globalComposeConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*GlobalComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func NewGlobalComposeConfigLifecycleAdapter(name string, clusterScoped bool, client GlobalComposeConfigInterface, l GlobalComposeConfigLifecycle) GlobalComposeConfigHandlerFunc { + adapter := &globalComposeConfigLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *GlobalComposeConfig) error { + if obj == nil { + return syncFn(key, nil) + } + return syncFn(key, obj) + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_k8s_client.go b/apis/management.cattle.io/v3/zz_generated_k8s_client.go index c8d39a97be..a24922614d 100644 --- a/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -53,6 +53,8 @@ type Interface interface { PipelineExecutionsGetter PipelineExecutionLogsGetter SourceCodeRepositoriesGetter + GlobalComposeConfigsGetter + ClusterComposeConfigsGetter } type Client struct { @@ -99,6 +101,8 @@ type Client struct { pipelineExecutionControllers map[string]PipelineExecutionController pipelineExecutionLogControllers map[string]PipelineExecutionLogController sourceCodeRepositoryControllers map[string]SourceCodeRepositoryController + globalComposeConfigControllers map[string]GlobalComposeConfigController + clusterComposeConfigControllers map[string]ClusterComposeConfigController } func NewForConfig(config rest.Config) (Interface, error) { @@ -154,6 +158,8 @@ func NewForConfig(config rest.Config) (Interface, error) { pipelineExecutionControllers: map[string]PipelineExecutionController{}, pipelineExecutionLogControllers: map[string]PipelineExecutionLogController{}, sourceCodeRepositoryControllers: map[string]SourceCodeRepositoryController{}, + globalComposeConfigControllers: map[string]GlobalComposeConfigController{}, + clusterComposeConfigControllers: map[string]ClusterComposeConfigController{}, }, nil } @@ -675,3 +681,29 @@ func (c *Client) SourceCodeRepositories(namespace string) SourceCodeRepositoryIn objectClient: objectClient, } } + +type GlobalComposeConfigsGetter interface { + GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface +} + +func (c *Client) GlobalComposeConfigs(namespace string) GlobalComposeConfigInterface { + objectClient := clientbase.NewObjectClient(namespace, c.restClient, &GlobalComposeConfigResource, GlobalComposeConfigGroupVersionKind, globalComposeConfigFactory{}) + return &globalComposeConfigClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} + +type ClusterComposeConfigsGetter interface { + ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface +} + +func (c *Client) ClusterComposeConfigs(namespace string) ClusterComposeConfigInterface { + objectClient := clientbase.NewObjectClient(namespace, c.restClient, &ClusterComposeConfigResource, ClusterComposeConfigGroupVersionKind, clusterComposeConfigFactory{}) + return &clusterComposeConfigClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/management.cattle.io/v3/zz_generated_scheme.go b/apis/management.cattle.io/v3/zz_generated_scheme.go index fb2e9a6cd5..ca546823c6 100644 --- a/apis/management.cattle.io/v3/zz_generated_scheme.go +++ b/apis/management.cattle.io/v3/zz_generated_scheme.go @@ -111,6 +111,10 @@ func addKnownTypes(scheme *runtime.Scheme) error { &PipelineExecutionLogList{}, &SourceCodeRepository{}, &SourceCodeRepositoryList{}, + &GlobalComposeConfig{}, + &GlobalComposeConfigList{}, + &ClusterComposeConfig{}, + &ClusterComposeConfigList{}, ) return nil } diff --git a/apis/project.cattle.io/v3/zz_generated_deepcopy.go b/apis/project.cattle.io/v3/zz_generated_deepcopy.go index 8ad711a814..7c71fda991 100644 --- a/apis/project.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/project.cattle.io/v3/zz_generated_deepcopy.go @@ -53,6 +53,14 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*CertificateList).DeepCopyInto(out.(*CertificateList)) return nil }, InType: reflect.TypeOf(&CertificateList{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ComposeCondition).DeepCopyInto(out.(*ComposeCondition)) + return nil + }, InType: reflect.TypeOf(&ComposeCondition{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*ComposeStatus).DeepCopyInto(out.(*ComposeStatus)) + return nil + }, InType: reflect.TypeOf(&ComposeStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*DockerCredential).DeepCopyInto(out.(*DockerCredential)) return nil @@ -61,6 +69,18 @@ func RegisterDeepCopies(scheme *runtime.Scheme) error { in.(*DockerCredentialList).DeepCopyInto(out.(*DockerCredentialList)) return nil }, InType: reflect.TypeOf(&DockerCredentialList{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*NamespaceComposeConfig).DeepCopyInto(out.(*NamespaceComposeConfig)) + return nil + }, InType: reflect.TypeOf(&NamespaceComposeConfig{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*NamespaceComposeConfigList).DeepCopyInto(out.(*NamespaceComposeConfigList)) + return nil + }, InType: reflect.TypeOf(&NamespaceComposeConfigList{})}, + conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { + in.(*NamespaceComposeSpec).DeepCopyInto(out.(*NamespaceComposeSpec)) + return nil + }, InType: reflect.TypeOf(&NamespaceComposeSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: func(in interface{}, out interface{}, c *conversion.Cloner) error { in.(*NamespacedBasicAuth).DeepCopyInto(out.(*NamespacedBasicAuth)) return nil @@ -405,6 +425,43 @@ func (in *CertificateList) DeepCopyObject() runtime.Object { } } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComposeCondition) DeepCopyInto(out *ComposeCondition) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeCondition. +func (in *ComposeCondition) DeepCopy() *ComposeCondition { + if in == nil { + return nil + } + out := new(ComposeCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ComposeStatus) DeepCopyInto(out *ComposeStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ComposeCondition, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComposeStatus. +func (in *ComposeStatus) DeepCopy() *ComposeStatus { + if in == nil { + return nil + } + out := new(ComposeStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DockerCredential) DeepCopyInto(out *DockerCredential) { *out = *in @@ -474,6 +531,86 @@ func (in *DockerCredentialList) DeepCopyObject() runtime.Object { } } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceComposeConfig) DeepCopyInto(out *NamespaceComposeConfig) { + *out = *in + out.Namespaced = in.Namespaced + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceComposeConfig. +func (in *NamespaceComposeConfig) DeepCopy() *NamespaceComposeConfig { + if in == nil { + return nil + } + out := new(NamespaceComposeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespaceComposeConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceComposeConfigList) DeepCopyInto(out *NamespaceComposeConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NamespaceComposeConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceComposeConfigList. +func (in *NamespaceComposeConfigList) DeepCopy() *NamespaceComposeConfigList { + if in == nil { + return nil + } + out := new(NamespaceComposeConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NamespaceComposeConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } else { + return nil + } +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceComposeSpec) DeepCopyInto(out *NamespaceComposeSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceComposeSpec. +func (in *NamespaceComposeSpec) DeepCopy() *NamespaceComposeSpec { + if in == nil { + return nil + } + out := new(NamespaceComposeSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NamespacedBasicAuth) DeepCopyInto(out *NamespacedBasicAuth) { *out = *in diff --git a/apis/project.cattle.io/v3/zz_generated_k8s_client.go b/apis/project.cattle.io/v3/zz_generated_k8s_client.go index 505a86dd36..df6ef371a7 100644 --- a/apis/project.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/project.cattle.io/v3/zz_generated_k8s_client.go @@ -26,6 +26,7 @@ type Interface interface { NamespacedSSHAuthsGetter WorkloadsGetter AppsGetter + NamespaceComposeConfigsGetter } type Client struct { @@ -45,6 +46,7 @@ type Client struct { namespacedSshAuthControllers map[string]NamespacedSSHAuthController workloadControllers map[string]WorkloadController appControllers map[string]AppController + namespaceComposeConfigControllers map[string]NamespaceComposeConfigController } func NewForConfig(config rest.Config) (Interface, error) { @@ -73,6 +75,7 @@ func NewForConfig(config rest.Config) (Interface, error) { namespacedSshAuthControllers: map[string]NamespacedSSHAuthController{}, workloadControllers: map[string]WorkloadController{}, appControllers: map[string]AppController{}, + namespaceComposeConfigControllers: map[string]NamespaceComposeConfigController{}, }, nil } @@ -243,3 +246,16 @@ func (c *Client) Apps(namespace string) AppInterface { objectClient: objectClient, } } + +type NamespaceComposeConfigsGetter interface { + NamespaceComposeConfigs(namespace string) NamespaceComposeConfigInterface +} + +func (c *Client) NamespaceComposeConfigs(namespace string) NamespaceComposeConfigInterface { + objectClient := clientbase.NewObjectClient(namespace, c.restClient, &NamespaceComposeConfigResource, NamespaceComposeConfigGroupVersionKind, namespaceComposeConfigFactory{}) + return &namespaceComposeConfigClient{ + ns: namespace, + client: c, + objectClient: objectClient, + } +} diff --git a/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_controller.go b/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_controller.go new file mode 100644 index 0000000000..048d51395a --- /dev/null +++ b/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_controller.go @@ -0,0 +1,252 @@ +package v3 + +import ( + "context" + + "github.com/rancher/norman/clientbase" + "github.com/rancher/norman/controller" + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/tools/cache" +) + +var ( + NamespaceComposeConfigGroupVersionKind = schema.GroupVersionKind{ + Version: Version, + Group: GroupName, + Kind: "NamespaceComposeConfig", + } + NamespaceComposeConfigResource = metav1.APIResource{ + Name: "namespacecomposeconfigs", + SingularName: "namespacecomposeconfig", + Namespaced: true, + + Kind: NamespaceComposeConfigGroupVersionKind.Kind, + } +) + +type NamespaceComposeConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NamespaceComposeConfig +} + +type NamespaceComposeConfigHandlerFunc func(key string, obj *NamespaceComposeConfig) error + +type NamespaceComposeConfigLister interface { + List(namespace string, selector labels.Selector) (ret []*NamespaceComposeConfig, err error) + Get(namespace, name string) (*NamespaceComposeConfig, error) +} + +type NamespaceComposeConfigController interface { + Informer() cache.SharedIndexInformer + Lister() NamespaceComposeConfigLister + AddHandler(name string, handler NamespaceComposeConfigHandlerFunc) + AddClusterScopedHandler(name, clusterName string, handler NamespaceComposeConfigHandlerFunc) + Enqueue(namespace, name string) + Sync(ctx context.Context) error + Start(ctx context.Context, threadiness int) error +} + +type NamespaceComposeConfigInterface interface { + ObjectClient() *clientbase.ObjectClient + Create(*NamespaceComposeConfig) (*NamespaceComposeConfig, error) + GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespaceComposeConfig, error) + Get(name string, opts metav1.GetOptions) (*NamespaceComposeConfig, error) + Update(*NamespaceComposeConfig) (*NamespaceComposeConfig, error) + Delete(name string, options *metav1.DeleteOptions) error + DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error + List(opts metav1.ListOptions) (*NamespaceComposeConfigList, error) + Watch(opts metav1.ListOptions) (watch.Interface, error) + DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error + Controller() NamespaceComposeConfigController + AddHandler(name string, sync NamespaceComposeConfigHandlerFunc) + AddLifecycle(name string, lifecycle NamespaceComposeConfigLifecycle) + AddClusterScopedHandler(name, clusterName string, sync NamespaceComposeConfigHandlerFunc) + AddClusterScopedLifecycle(name, clusterName string, lifecycle NamespaceComposeConfigLifecycle) +} + +type namespaceComposeConfigLister struct { + controller *namespaceComposeConfigController +} + +func (l *namespaceComposeConfigLister) List(namespace string, selector labels.Selector) (ret []*NamespaceComposeConfig, err error) { + err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { + ret = append(ret, obj.(*NamespaceComposeConfig)) + }) + return +} + +func (l *namespaceComposeConfigLister) Get(namespace, name string) (*NamespaceComposeConfig, 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: NamespaceComposeConfigGroupVersionKind.Group, + Resource: "namespaceComposeConfig", + }, name) + } + return obj.(*NamespaceComposeConfig), nil +} + +type namespaceComposeConfigController struct { + controller.GenericController +} + +func (c *namespaceComposeConfigController) Lister() NamespaceComposeConfigLister { + return &namespaceComposeConfigLister{ + controller: c, + } +} + +func (c *namespaceComposeConfigController) AddHandler(name string, handler NamespaceComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + return handler(key, obj.(*NamespaceComposeConfig)) + }) +} + +func (c *namespaceComposeConfigController) AddClusterScopedHandler(name, cluster string, handler NamespaceComposeConfigHandlerFunc) { + c.GenericController.AddHandler(name, func(key string) error { + obj, exists, err := c.Informer().GetStore().GetByKey(key) + if err != nil { + return err + } + if !exists { + return handler(key, nil) + } + + if !controller.ObjectInCluster(cluster, obj) { + return nil + } + + return handler(key, obj.(*NamespaceComposeConfig)) + }) +} + +type namespaceComposeConfigFactory struct { +} + +func (c namespaceComposeConfigFactory) Object() runtime.Object { + return &NamespaceComposeConfig{} +} + +func (c namespaceComposeConfigFactory) List() runtime.Object { + return &NamespaceComposeConfigList{} +} + +func (s *namespaceComposeConfigClient) Controller() NamespaceComposeConfigController { + s.client.Lock() + defer s.client.Unlock() + + c, ok := s.client.namespaceComposeConfigControllers[s.ns] + if ok { + return c + } + + genericController := controller.NewGenericController(NamespaceComposeConfigGroupVersionKind.Kind+"Controller", + s.objectClient) + + c = &namespaceComposeConfigController{ + GenericController: genericController, + } + + s.client.namespaceComposeConfigControllers[s.ns] = c + s.client.starters = append(s.client.starters, c) + + return c +} + +type namespaceComposeConfigClient struct { + client *Client + ns string + objectClient *clientbase.ObjectClient + controller NamespaceComposeConfigController +} + +func (s *namespaceComposeConfigClient) ObjectClient() *clientbase.ObjectClient { + return s.objectClient +} + +func (s *namespaceComposeConfigClient) Create(o *NamespaceComposeConfig) (*NamespaceComposeConfig, error) { + obj, err := s.objectClient.Create(o) + return obj.(*NamespaceComposeConfig), err +} + +func (s *namespaceComposeConfigClient) Get(name string, opts metav1.GetOptions) (*NamespaceComposeConfig, error) { + obj, err := s.objectClient.Get(name, opts) + return obj.(*NamespaceComposeConfig), err +} + +func (s *namespaceComposeConfigClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*NamespaceComposeConfig, error) { + obj, err := s.objectClient.GetNamespaced(namespace, name, opts) + return obj.(*NamespaceComposeConfig), err +} + +func (s *namespaceComposeConfigClient) Update(o *NamespaceComposeConfig) (*NamespaceComposeConfig, error) { + obj, err := s.objectClient.Update(o.Name, o) + return obj.(*NamespaceComposeConfig), err +} + +func (s *namespaceComposeConfigClient) Delete(name string, options *metav1.DeleteOptions) error { + return s.objectClient.Delete(name, options) +} + +func (s *namespaceComposeConfigClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { + return s.objectClient.DeleteNamespaced(namespace, name, options) +} + +func (s *namespaceComposeConfigClient) List(opts metav1.ListOptions) (*NamespaceComposeConfigList, error) { + obj, err := s.objectClient.List(opts) + return obj.(*NamespaceComposeConfigList), err +} + +func (s *namespaceComposeConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return s.objectClient.Watch(opts) +} + +// Patch applies the patch and returns the patched deployment. +func (s *namespaceComposeConfigClient) Patch(o *NamespaceComposeConfig, data []byte, subresources ...string) (*NamespaceComposeConfig, error) { + obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) + return obj.(*NamespaceComposeConfig), err +} + +func (s *namespaceComposeConfigClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { + return s.objectClient.DeleteCollection(deleteOpts, listOpts) +} + +func (s *namespaceComposeConfigClient) AddHandler(name string, sync NamespaceComposeConfigHandlerFunc) { + s.Controller().AddHandler(name, sync) +} + +func (s *namespaceComposeConfigClient) AddLifecycle(name string, lifecycle NamespaceComposeConfigLifecycle) { + sync := NewNamespaceComposeConfigLifecycleAdapter(name, false, s, lifecycle) + s.AddHandler(name, sync) +} + +func (s *namespaceComposeConfigClient) AddClusterScopedHandler(name, clusterName string, sync NamespaceComposeConfigHandlerFunc) { + s.Controller().AddClusterScopedHandler(name, clusterName, sync) +} + +func (s *namespaceComposeConfigClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle NamespaceComposeConfigLifecycle) { + sync := NewNamespaceComposeConfigLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) + s.AddClusterScopedHandler(name, clusterName, sync) +} diff --git a/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_lifecycle_adapter.go b/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_lifecycle_adapter.go new file mode 100644 index 0000000000..29af8bf245 --- /dev/null +++ b/apis/project.cattle.io/v3/zz_generated_namespace_compose_config_lifecycle_adapter.go @@ -0,0 +1,51 @@ +package v3 + +import ( + "github.com/rancher/norman/lifecycle" + "k8s.io/apimachinery/pkg/runtime" +) + +type NamespaceComposeConfigLifecycle interface { + Create(obj *NamespaceComposeConfig) (*NamespaceComposeConfig, error) + Remove(obj *NamespaceComposeConfig) (*NamespaceComposeConfig, error) + Updated(obj *NamespaceComposeConfig) (*NamespaceComposeConfig, error) +} + +type namespaceComposeConfigLifecycleAdapter struct { + lifecycle NamespaceComposeConfigLifecycle +} + +func (w *namespaceComposeConfigLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Create(obj.(*NamespaceComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *namespaceComposeConfigLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Remove(obj.(*NamespaceComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func (w *namespaceComposeConfigLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { + o, err := w.lifecycle.Updated(obj.(*NamespaceComposeConfig)) + if o == nil { + return nil, err + } + return o, err +} + +func NewNamespaceComposeConfigLifecycleAdapter(name string, clusterScoped bool, client NamespaceComposeConfigInterface, l NamespaceComposeConfigLifecycle) NamespaceComposeConfigHandlerFunc { + adapter := &namespaceComposeConfigLifecycleAdapter{lifecycle: l} + syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) + return func(key string, obj *NamespaceComposeConfig) error { + if obj == nil { + return syncFn(key, nil) + } + return syncFn(key, obj) + } +} diff --git a/apis/project.cattle.io/v3/zz_generated_scheme.go b/apis/project.cattle.io/v3/zz_generated_scheme.go index 5e7e137579..cb1f7342ac 100644 --- a/apis/project.cattle.io/v3/zz_generated_scheme.go +++ b/apis/project.cattle.io/v3/zz_generated_scheme.go @@ -57,6 +57,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { &WorkloadList{}, &App{}, &AppList{}, + &NamespaceComposeConfig{}, + &NamespaceComposeConfigList{}, ) return nil } diff --git a/client/management/v3/zz_generated_client.go b/client/management/v3/zz_generated_client.go index db9d4da403..581eaaeff8 100644 --- a/client/management/v3/zz_generated_client.go +++ b/client/management/v3/zz_generated_client.go @@ -46,6 +46,8 @@ type Client struct { PipelineExecution PipelineExecutionOperations PipelineExecutionLog PipelineExecutionLogOperations SourceCodeRepository SourceCodeRepositoryOperations + GlobalComposeConfig GlobalComposeConfigOperations + ClusterComposeConfig ClusterComposeConfigOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -97,6 +99,8 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.PipelineExecution = newPipelineExecutionClient(client) client.PipelineExecutionLog = newPipelineExecutionLogClient(client) client.SourceCodeRepository = newSourceCodeRepositoryClient(client) + client.GlobalComposeConfig = newGlobalComposeConfigClient(client) + client.ClusterComposeConfig = newClusterComposeConfigClient(client) return client, nil } diff --git a/client/management/v3/zz_generated_cluster_compose_config.go b/client/management/v3/zz_generated_cluster_compose_config.go new file mode 100644 index 0000000000..d054da2242 --- /dev/null +++ b/client/management/v3/zz_generated_cluster_compose_config.go @@ -0,0 +1,105 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + ClusterComposeConfigType = "clusterComposeConfig" + ClusterComposeConfigFieldAnnotations = "annotations" + ClusterComposeConfigFieldClusterId = "clusterId" + ClusterComposeConfigFieldCreated = "created" + ClusterComposeConfigFieldCreatorID = "creatorId" + ClusterComposeConfigFieldLabels = "labels" + ClusterComposeConfigFieldName = "name" + ClusterComposeConfigFieldNamespaceId = "namespaceId" + ClusterComposeConfigFieldOwnerReferences = "ownerReferences" + ClusterComposeConfigFieldRancherCompose = "rancherCompose" + ClusterComposeConfigFieldRemoved = "removed" + ClusterComposeConfigFieldState = "state" + ClusterComposeConfigFieldStatus = "status" + ClusterComposeConfigFieldTransitioning = "transitioning" + ClusterComposeConfigFieldTransitioningMessage = "transitioningMessage" + ClusterComposeConfigFieldUuid = "uuid" +) + +type ClusterComposeConfig struct { + types.Resource + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,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"` + 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"` + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status *ComposeStatus `json:"status,omitempty" yaml:"status,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} +type ClusterComposeConfigCollection struct { + types.Collection + Data []ClusterComposeConfig `json:"data,omitempty"` + client *ClusterComposeConfigClient +} + +type ClusterComposeConfigClient struct { + apiClient *Client +} + +type ClusterComposeConfigOperations interface { + List(opts *types.ListOpts) (*ClusterComposeConfigCollection, error) + Create(opts *ClusterComposeConfig) (*ClusterComposeConfig, error) + Update(existing *ClusterComposeConfig, updates interface{}) (*ClusterComposeConfig, error) + ByID(id string) (*ClusterComposeConfig, error) + Delete(container *ClusterComposeConfig) error +} + +func newClusterComposeConfigClient(apiClient *Client) *ClusterComposeConfigClient { + return &ClusterComposeConfigClient{ + apiClient: apiClient, + } +} + +func (c *ClusterComposeConfigClient) Create(container *ClusterComposeConfig) (*ClusterComposeConfig, error) { + resp := &ClusterComposeConfig{} + err := c.apiClient.Ops.DoCreate(ClusterComposeConfigType, container, resp) + return resp, err +} + +func (c *ClusterComposeConfigClient) Update(existing *ClusterComposeConfig, updates interface{}) (*ClusterComposeConfig, error) { + resp := &ClusterComposeConfig{} + err := c.apiClient.Ops.DoUpdate(ClusterComposeConfigType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *ClusterComposeConfigClient) List(opts *types.ListOpts) (*ClusterComposeConfigCollection, error) { + resp := &ClusterComposeConfigCollection{} + err := c.apiClient.Ops.DoList(ClusterComposeConfigType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *ClusterComposeConfigCollection) Next() (*ClusterComposeConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &ClusterComposeConfigCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *ClusterComposeConfigClient) ByID(id string) (*ClusterComposeConfig, error) { + resp := &ClusterComposeConfig{} + err := c.apiClient.Ops.DoByID(ClusterComposeConfigType, id, resp) + return resp, err +} + +func (c *ClusterComposeConfigClient) Delete(container *ClusterComposeConfig) error { + return c.apiClient.Ops.DoResourceDelete(ClusterComposeConfigType, &container.Resource) +} diff --git a/client/management/v3/zz_generated_cluster_compose_spec.go b/client/management/v3/zz_generated_cluster_compose_spec.go new file mode 100644 index 0000000000..935889a26b --- /dev/null +++ b/client/management/v3/zz_generated_cluster_compose_spec.go @@ -0,0 +1,12 @@ +package client + +const ( + ClusterComposeSpecType = "clusterComposeSpec" + ClusterComposeSpecFieldClusterId = "clusterId" + ClusterComposeSpecFieldRancherCompose = "rancherCompose" +) + +type ClusterComposeSpec struct { + ClusterId string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` +} diff --git a/client/management/v3/zz_generated_compose_condition.go b/client/management/v3/zz_generated_compose_condition.go new file mode 100644 index 0000000000..e2b5a1ec4c --- /dev/null +++ b/client/management/v3/zz_generated_compose_condition.go @@ -0,0 +1,20 @@ +package client + +const ( + ComposeConditionType = "composeCondition" + ComposeConditionFieldLastTransitionTime = "lastTransitionTime" + ComposeConditionFieldLastUpdateTime = "lastUpdateTime" + ComposeConditionFieldMessage = "message" + ComposeConditionFieldReason = "reason" + ComposeConditionFieldStatus = "status" + ComposeConditionFieldType = "type" +) + +type ComposeCondition struct { + LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` + LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` + Message string `json:"message,omitempty" yaml:"message,omitempty"` + Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` + Status string `json:"status,omitempty" yaml:"status,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} diff --git a/client/management/v3/zz_generated_compose_spec.go b/client/management/v3/zz_generated_compose_spec.go new file mode 100644 index 0000000000..6477b002ba --- /dev/null +++ b/client/management/v3/zz_generated_compose_spec.go @@ -0,0 +1,10 @@ +package client + +const ( + ComposeSpecType = "composeSpec" + ComposeSpecFieldRancherCompose = "rancherCompose" +) + +type ComposeSpec struct { + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` +} diff --git a/client/management/v3/zz_generated_compose_status.go b/client/management/v3/zz_generated_compose_status.go new file mode 100644 index 0000000000..53138f03d1 --- /dev/null +++ b/client/management/v3/zz_generated_compose_status.go @@ -0,0 +1,10 @@ +package client + +const ( + ComposeStatusType = "composeStatus" + ComposeStatusFieldConditions = "conditions" +) + +type ComposeStatus struct { + Conditions []ComposeCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` +} diff --git a/client/management/v3/zz_generated_global_compose_config.go b/client/management/v3/zz_generated_global_compose_config.go new file mode 100644 index 0000000000..6fbc69effc --- /dev/null +++ b/client/management/v3/zz_generated_global_compose_config.go @@ -0,0 +1,101 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + GlobalComposeConfigType = "globalComposeConfig" + GlobalComposeConfigFieldAnnotations = "annotations" + GlobalComposeConfigFieldCreated = "created" + GlobalComposeConfigFieldCreatorID = "creatorId" + GlobalComposeConfigFieldLabels = "labels" + GlobalComposeConfigFieldName = "name" + GlobalComposeConfigFieldOwnerReferences = "ownerReferences" + GlobalComposeConfigFieldRancherCompose = "rancherCompose" + GlobalComposeConfigFieldRemoved = "removed" + GlobalComposeConfigFieldState = "state" + GlobalComposeConfigFieldStatus = "status" + GlobalComposeConfigFieldTransitioning = "transitioning" + GlobalComposeConfigFieldTransitioningMessage = "transitioningMessage" + GlobalComposeConfigFieldUuid = "uuid" +) + +type GlobalComposeConfig 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"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status *ComposeStatus `json:"status,omitempty" yaml:"status,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} +type GlobalComposeConfigCollection struct { + types.Collection + Data []GlobalComposeConfig `json:"data,omitempty"` + client *GlobalComposeConfigClient +} + +type GlobalComposeConfigClient struct { + apiClient *Client +} + +type GlobalComposeConfigOperations interface { + List(opts *types.ListOpts) (*GlobalComposeConfigCollection, error) + Create(opts *GlobalComposeConfig) (*GlobalComposeConfig, error) + Update(existing *GlobalComposeConfig, updates interface{}) (*GlobalComposeConfig, error) + ByID(id string) (*GlobalComposeConfig, error) + Delete(container *GlobalComposeConfig) error +} + +func newGlobalComposeConfigClient(apiClient *Client) *GlobalComposeConfigClient { + return &GlobalComposeConfigClient{ + apiClient: apiClient, + } +} + +func (c *GlobalComposeConfigClient) Create(container *GlobalComposeConfig) (*GlobalComposeConfig, error) { + resp := &GlobalComposeConfig{} + err := c.apiClient.Ops.DoCreate(GlobalComposeConfigType, container, resp) + return resp, err +} + +func (c *GlobalComposeConfigClient) Update(existing *GlobalComposeConfig, updates interface{}) (*GlobalComposeConfig, error) { + resp := &GlobalComposeConfig{} + err := c.apiClient.Ops.DoUpdate(GlobalComposeConfigType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *GlobalComposeConfigClient) List(opts *types.ListOpts) (*GlobalComposeConfigCollection, error) { + resp := &GlobalComposeConfigCollection{} + err := c.apiClient.Ops.DoList(GlobalComposeConfigType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *GlobalComposeConfigCollection) Next() (*GlobalComposeConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &GlobalComposeConfigCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *GlobalComposeConfigClient) ByID(id string) (*GlobalComposeConfig, error) { + resp := &GlobalComposeConfig{} + err := c.apiClient.Ops.DoByID(GlobalComposeConfigType, id, resp) + return resp, err +} + +func (c *GlobalComposeConfigClient) Delete(container *GlobalComposeConfig) error { + return c.apiClient.Ops.DoResourceDelete(GlobalComposeConfigType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_client.go b/client/project/v3/zz_generated_client.go index 244f3f0cd2..cbe29cc06f 100644 --- a/client/project/v3/zz_generated_client.go +++ b/client/project/v3/zz_generated_client.go @@ -34,6 +34,7 @@ type Client struct { Workload WorkloadOperations App AppOperations ConfigMap ConfigMapOperations + NamespaceComposeConfig NamespaceComposeConfigOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -73,6 +74,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.Workload = newWorkloadClient(client) client.App = newAppClient(client) client.ConfigMap = newConfigMapClient(client) + client.NamespaceComposeConfig = newNamespaceComposeConfigClient(client) return client, nil } diff --git a/client/project/v3/zz_generated_compose_condition.go b/client/project/v3/zz_generated_compose_condition.go new file mode 100644 index 0000000000..e2b5a1ec4c --- /dev/null +++ b/client/project/v3/zz_generated_compose_condition.go @@ -0,0 +1,20 @@ +package client + +const ( + ComposeConditionType = "composeCondition" + ComposeConditionFieldLastTransitionTime = "lastTransitionTime" + ComposeConditionFieldLastUpdateTime = "lastUpdateTime" + ComposeConditionFieldMessage = "message" + ComposeConditionFieldReason = "reason" + ComposeConditionFieldStatus = "status" + ComposeConditionFieldType = "type" +) + +type ComposeCondition struct { + LastTransitionTime string `json:"lastTransitionTime,omitempty" yaml:"lastTransitionTime,omitempty"` + LastUpdateTime string `json:"lastUpdateTime,omitempty" yaml:"lastUpdateTime,omitempty"` + Message string `json:"message,omitempty" yaml:"message,omitempty"` + Reason string `json:"reason,omitempty" yaml:"reason,omitempty"` + Status string `json:"status,omitempty" yaml:"status,omitempty"` + Type string `json:"type,omitempty" yaml:"type,omitempty"` +} diff --git a/client/project/v3/zz_generated_compose_status.go b/client/project/v3/zz_generated_compose_status.go new file mode 100644 index 0000000000..53138f03d1 --- /dev/null +++ b/client/project/v3/zz_generated_compose_status.go @@ -0,0 +1,10 @@ +package client + +const ( + ComposeStatusType = "composeStatus" + ComposeStatusFieldConditions = "conditions" +) + +type ComposeStatus struct { + Conditions []ComposeCondition `json:"conditions,omitempty" yaml:"conditions,omitempty"` +} diff --git a/client/project/v3/zz_generated_namespace_compose_config.go b/client/project/v3/zz_generated_namespace_compose_config.go new file mode 100644 index 0000000000..86b694a1d8 --- /dev/null +++ b/client/project/v3/zz_generated_namespace_compose_config.go @@ -0,0 +1,107 @@ +package client + +import ( + "github.com/rancher/norman/types" +) + +const ( + NamespaceComposeConfigType = "namespaceComposeConfig" + NamespaceComposeConfigFieldAnnotations = "annotations" + NamespaceComposeConfigFieldCreated = "created" + NamespaceComposeConfigFieldCreatorID = "creatorId" + NamespaceComposeConfigFieldInstallNamespace = "installNamespace" + NamespaceComposeConfigFieldLabels = "labels" + NamespaceComposeConfigFieldName = "name" + NamespaceComposeConfigFieldNamespaceId = "namespaceId" + NamespaceComposeConfigFieldOwnerReferences = "ownerReferences" + NamespaceComposeConfigFieldProjectId = "projectId" + NamespaceComposeConfigFieldRancherCompose = "rancherCompose" + NamespaceComposeConfigFieldRemoved = "removed" + NamespaceComposeConfigFieldState = "state" + NamespaceComposeConfigFieldStatus = "status" + NamespaceComposeConfigFieldTransitioning = "transitioning" + NamespaceComposeConfigFieldTransitioningMessage = "transitioningMessage" + NamespaceComposeConfigFieldUuid = "uuid" +) + +type NamespaceComposeConfig 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"` + InstallNamespace string `json:"installNamespace,omitempty" yaml:"installNamespace,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"` + ProjectId string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + State string `json:"state,omitempty" yaml:"state,omitempty"` + Status *ComposeStatus `json:"status,omitempty" yaml:"status,omitempty"` + Transitioning string `json:"transitioning,omitempty" yaml:"transitioning,omitempty"` + TransitioningMessage string `json:"transitioningMessage,omitempty" yaml:"transitioningMessage,omitempty"` + Uuid string `json:"uuid,omitempty" yaml:"uuid,omitempty"` +} +type NamespaceComposeConfigCollection struct { + types.Collection + Data []NamespaceComposeConfig `json:"data,omitempty"` + client *NamespaceComposeConfigClient +} + +type NamespaceComposeConfigClient struct { + apiClient *Client +} + +type NamespaceComposeConfigOperations interface { + List(opts *types.ListOpts) (*NamespaceComposeConfigCollection, error) + Create(opts *NamespaceComposeConfig) (*NamespaceComposeConfig, error) + Update(existing *NamespaceComposeConfig, updates interface{}) (*NamespaceComposeConfig, error) + ByID(id string) (*NamespaceComposeConfig, error) + Delete(container *NamespaceComposeConfig) error +} + +func newNamespaceComposeConfigClient(apiClient *Client) *NamespaceComposeConfigClient { + return &NamespaceComposeConfigClient{ + apiClient: apiClient, + } +} + +func (c *NamespaceComposeConfigClient) Create(container *NamespaceComposeConfig) (*NamespaceComposeConfig, error) { + resp := &NamespaceComposeConfig{} + err := c.apiClient.Ops.DoCreate(NamespaceComposeConfigType, container, resp) + return resp, err +} + +func (c *NamespaceComposeConfigClient) Update(existing *NamespaceComposeConfig, updates interface{}) (*NamespaceComposeConfig, error) { + resp := &NamespaceComposeConfig{} + err := c.apiClient.Ops.DoUpdate(NamespaceComposeConfigType, &existing.Resource, updates, resp) + return resp, err +} + +func (c *NamespaceComposeConfigClient) List(opts *types.ListOpts) (*NamespaceComposeConfigCollection, error) { + resp := &NamespaceComposeConfigCollection{} + err := c.apiClient.Ops.DoList(NamespaceComposeConfigType, opts, resp) + resp.client = c + return resp, err +} + +func (cc *NamespaceComposeConfigCollection) Next() (*NamespaceComposeConfigCollection, error) { + if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { + resp := &NamespaceComposeConfigCollection{} + err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) + resp.client = cc.client + return resp, err + } + return nil, nil +} + +func (c *NamespaceComposeConfigClient) ByID(id string) (*NamespaceComposeConfig, error) { + resp := &NamespaceComposeConfig{} + err := c.apiClient.Ops.DoByID(NamespaceComposeConfigType, id, resp) + return resp, err +} + +func (c *NamespaceComposeConfigClient) Delete(container *NamespaceComposeConfig) error { + return c.apiClient.Ops.DoResourceDelete(NamespaceComposeConfigType, &container.Resource) +} diff --git a/client/project/v3/zz_generated_namespace_compose_spec.go b/client/project/v3/zz_generated_namespace_compose_spec.go new file mode 100644 index 0000000000..aa7e2dccb0 --- /dev/null +++ b/client/project/v3/zz_generated_namespace_compose_spec.go @@ -0,0 +1,14 @@ +package client + +const ( + NamespaceComposeSpecType = "namespaceComposeSpec" + NamespaceComposeSpecFieldInstallNamespace = "installNamespace" + NamespaceComposeSpecFieldProjectId = "projectId" + NamespaceComposeSpecFieldRancherCompose = "rancherCompose" +) + +type NamespaceComposeSpec struct { + InstallNamespace string `json:"installNamespace,omitempty" yaml:"installNamespace,omitempty"` + ProjectId string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + RancherCompose string `json:"rancherCompose,omitempty" yaml:"rancherCompose,omitempty"` +} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go new file mode 100644 index 0000000000..5039c90d12 --- /dev/null +++ b/compose/zz_generated_compose.go @@ -0,0 +1,86 @@ +package compose + +import ( + clusterClient "github.com/rancher/types/client/cluster/v3" + managementClient "github.com/rancher/types/client/management/v3" + projectClient "github.com/rancher/types/client/project/v3" +) + +type Config struct { + Version string `yaml:"version,omitempty"` + + // Management Client + NodePools map[string]managementClient.NodePool `json:"nodePools,omitempty" yaml:"nodePools,omitempty"` + Nodes map[string]managementClient.Node `json:"nodes,omitempty" yaml:"nodes,omitempty"` + NodeDrivers map[string]managementClient.NodeDriver `json:"nodeDrivers,omitempty" yaml:"nodeDrivers,omitempty"` + NodeTemplates map[string]managementClient.NodeTemplate `json:"nodeTemplates,omitempty" yaml:"nodeTemplates,omitempty"` + Projects map[string]managementClient.Project `json:"projects,omitempty" yaml:"projects,omitempty"` + GlobalRoles map[string]managementClient.GlobalRole `json:"globalRoles,omitempty" yaml:"globalRoles,omitempty"` + GlobalRoleBindings map[string]managementClient.GlobalRoleBinding `json:"globalRoleBindings,omitempty" yaml:"globalRoleBindings,omitempty"` + RoleTemplates map[string]managementClient.RoleTemplate `json:"roleTemplates,omitempty" yaml:"roleTemplates,omitempty"` + PodSecurityPolicyTemplates map[string]managementClient.PodSecurityPolicyTemplate `json:"podSecurityPolicyTemplates,omitempty" yaml:"podSecurityPolicyTemplates,omitempty"` + ClusterRoleTemplateBindings map[string]managementClient.ClusterRoleTemplateBinding `json:"clusterRoleTemplateBindings,omitempty" yaml:"clusterRoleTemplateBindings,omitempty"` + ProjectRoleTemplateBindings map[string]managementClient.ProjectRoleTemplateBinding `json:"projectRoleTemplateBindings,omitempty" yaml:"projectRoleTemplateBindings,omitempty"` + Clusters map[string]managementClient.Cluster `json:"clusters,omitempty" yaml:"clusters,omitempty"` + ClusterEvents map[string]managementClient.ClusterEvent `json:"clusterEvents,omitempty" yaml:"clusterEvents,omitempty"` + ClusterRegistrationTokens map[string]managementClient.ClusterRegistrationToken `json:"clusterRegistrationTokens,omitempty" yaml:"clusterRegistrationTokens,omitempty"` + Catalogs map[string]managementClient.Catalog `json:"catalogs,omitempty" yaml:"catalogs,omitempty"` + Templates map[string]managementClient.Template `json:"templates,omitempty" yaml:"templates,omitempty"` + TemplateVersions map[string]managementClient.TemplateVersion `json:"templateVersions,omitempty" yaml:"templateVersions,omitempty"` + Groups map[string]managementClient.Group `json:"groups,omitempty" yaml:"groups,omitempty"` + GroupMembers map[string]managementClient.GroupMember `json:"groupMembers,omitempty" yaml:"groupMembers,omitempty"` + Users map[string]managementClient.User `json:"users,omitempty" yaml:"users,omitempty"` + Tokens map[string]managementClient.Token `json:"tokens,omitempty" yaml:"tokens,omitempty"` + DynamicSchemas map[string]managementClient.DynamicSchema `json:"dynamicSchemas,omitempty" yaml:"dynamicSchemas,omitempty"` + Preferences map[string]managementClient.Preference `json:"preferences,omitempty" yaml:"preferences,omitempty"` + ClusterLoggings map[string]managementClient.ClusterLogging `json:"clusterLoggings,omitempty" yaml:"clusterLoggings,omitempty"` + ProjectLoggings map[string]managementClient.ProjectLogging `json:"projectLoggings,omitempty" yaml:"projectLoggings,omitempty"` + ListenConfigs map[string]managementClient.ListenConfig `json:"listenConfigs,omitempty" yaml:"listenConfigs,omitempty"` + Settings map[string]managementClient.Setting `json:"settings,omitempty" yaml:"settings,omitempty"` + Notifiers map[string]managementClient.Notifier `json:"notifiers,omitempty" yaml:"notifiers,omitempty"` + ClusterAlerts map[string]managementClient.ClusterAlert `json:"clusterAlerts,omitempty" yaml:"clusterAlerts,omitempty"` + ProjectAlerts map[string]managementClient.ProjectAlert `json:"projectAlerts,omitempty" yaml:"projectAlerts,omitempty"` + ClusterPipelines map[string]managementClient.ClusterPipeline `json:"clusterPipelines,omitempty" yaml:"clusterPipelines,omitempty"` + SourceCodeCredentials map[string]managementClient.SourceCodeCredential `json:"sourceCodeCredentials,omitempty" yaml:"sourceCodeCredentials,omitempty"` + Pipelines map[string]managementClient.Pipeline `json:"pipelines,omitempty" yaml:"pipelines,omitempty"` + PipelineExecutions map[string]managementClient.PipelineExecution `json:"pipelineExecutions,omitempty" yaml:"pipelineExecutions,omitempty"` + PipelineExecutionLogs map[string]managementClient.PipelineExecutionLog `json:"pipelineExecutionLogs,omitempty" yaml:"pipelineExecutionLogs,omitempty"` + SourceCodeRepositorys map[string]managementClient.SourceCodeRepository `json:"sourceCodeRepositories,omitempty" yaml:"sourceCodeRepositories,omitempty"` + GlobalComposeConfigs map[string]managementClient.GlobalComposeConfig `json:"globalComposeConfigs,omitempty" yaml:"globalComposeConfigs,omitempty"` + ClusterComposeConfigs map[string]managementClient.ClusterComposeConfig `json:"clusterComposeConfigs,omitempty" yaml:"clusterComposeConfigs,omitempty"` + + // Cluster Client + Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"` + PersistentVolumes map[string]clusterClient.PersistentVolume `json:"persistentVolumes,omitempty" yaml:"persistentVolumes,omitempty"` + StorageClasss map[string]clusterClient.StorageClass `json:"storageClasses,omitempty" yaml:"storageClasses,omitempty"` + + // Project Client + PersistentVolumeClaims map[string]projectClient.PersistentVolumeClaim `json:"persistentVolumeClaims,omitempty" yaml:"persistentVolumeClaims,omitempty"` + Ingresss map[string]projectClient.Ingress `json:"ingresses,omitempty" yaml:"ingresses,omitempty"` + Secrets map[string]projectClient.Secret `json:"secrets,omitempty" yaml:"secrets,omitempty"` + ServiceAccountTokens map[string]projectClient.ServiceAccountToken `json:"serviceAccountTokens,omitempty" yaml:"serviceAccountTokens,omitempty"` + DockerCredentials map[string]projectClient.DockerCredential `json:"dockerCredentials,omitempty" yaml:"dockerCredentials,omitempty"` + Certificates map[string]projectClient.Certificate `json:"certificates,omitempty" yaml:"certificates,omitempty"` + BasicAuths map[string]projectClient.BasicAuth `json:"basicAuths,omitempty" yaml:"basicAuths,omitempty"` + SSHAuths map[string]projectClient.SSHAuth `json:"sshAuths,omitempty" yaml:"sshAuths,omitempty"` + NamespacedSecrets map[string]projectClient.NamespacedSecret `json:"namespacedSecrets,omitempty" yaml:"namespacedSecrets,omitempty"` + NamespacedServiceAccountTokens map[string]projectClient.NamespacedServiceAccountToken `json:"namespacedServiceAccountTokens,omitempty" yaml:"namespacedServiceAccountTokens,omitempty"` + NamespacedDockerCredentials map[string]projectClient.NamespacedDockerCredential `json:"namespacedDockerCredentials,omitempty" yaml:"namespacedDockerCredentials,omitempty"` + NamespacedCertificates map[string]projectClient.NamespacedCertificate `json:"namespacedCertificates,omitempty" yaml:"namespacedCertificates,omitempty"` + NamespacedBasicAuths map[string]projectClient.NamespacedBasicAuth `json:"namespacedBasicAuths,omitempty" yaml:"namespacedBasicAuths,omitempty"` + NamespacedSSHAuths map[string]projectClient.NamespacedSSHAuth `json:"namespacedSshAuths,omitempty" yaml:"namespacedSshAuths,omitempty"` + Services map[string]projectClient.Service `json:"services,omitempty" yaml:"services,omitempty"` + DNSRecords map[string]projectClient.DNSRecord `json:"dnsRecords,omitempty" yaml:"dnsRecords,omitempty"` + Pods map[string]projectClient.Pod `json:"pods,omitempty" yaml:"pods,omitempty"` + Deployments map[string]projectClient.Deployment `json:"deployments,omitempty" yaml:"deployments,omitempty"` + ReplicationControllers map[string]projectClient.ReplicationController `json:"replicationControllers,omitempty" yaml:"replicationControllers,omitempty"` + ReplicaSets map[string]projectClient.ReplicaSet `json:"replicaSets,omitempty" yaml:"replicaSets,omitempty"` + StatefulSets map[string]projectClient.StatefulSet `json:"statefulSets,omitempty" yaml:"statefulSets,omitempty"` + DaemonSets map[string]projectClient.DaemonSet `json:"daemonSets,omitempty" yaml:"daemonSets,omitempty"` + Jobs map[string]projectClient.Job `json:"jobs,omitempty" yaml:"jobs,omitempty"` + CronJobs map[string]projectClient.CronJob `json:"cronJobs,omitempty" yaml:"cronJobs,omitempty"` + Workloads map[string]projectClient.Workload `json:"workloads,omitempty" yaml:"workloads,omitempty"` + Apps map[string]projectClient.App `json:"apps,omitempty" yaml:"apps,omitempty"` + ConfigMaps map[string]projectClient.ConfigMap `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` + NamespaceComposeConfigs map[string]projectClient.NamespaceComposeConfig `json:"namespaceComposeConfigs,omitempty" yaml:"namespaceComposeConfigs,omitempty"` +}