diff --git a/apis/management.cattle.io/v3/zz_generated_deepcopy.go b/apis/management.cattle.io/v3/zz_generated_deepcopy.go index fa2cca11..395986f0 100644 --- a/apis/management.cattle.io/v3/zz_generated_deepcopy.go +++ b/apis/management.cattle.io/v3/zz_generated_deepcopy.go @@ -2973,6 +2973,23 @@ func (in *MonitoringConfig) DeepCopy() *MonitoringConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamespaceResourceQuota) DeepCopyInto(out *NamespaceResourceQuota) { + *out = *in + out.Limit = in.Limit + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespaceResourceQuota. +func (in *NamespaceResourceQuota) DeepCopy() *NamespaceResourceQuota { + if in == nil { + return nil + } + out := new(NamespaceResourceQuota) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NetworkConfig) DeepCopyInto(out *NetworkConfig) { *out = *in @@ -4667,22 +4684,6 @@ func (in *ProjectNetworkPolicyStatus) DeepCopy() *ProjectNetworkPolicyStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ProjectResourceLimit) DeepCopyInto(out *ProjectResourceLimit) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectResourceLimit. -func (in *ProjectResourceLimit) DeepCopy() *ProjectResourceLimit { - if in == nil { - return nil - } - out := new(ProjectResourceLimit) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProjectResourceQuota) DeepCopyInto(out *ProjectResourceQuota) { *out = *in @@ -4773,6 +4774,15 @@ func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) { **out = **in } } + if in.NamespaceDefaultResourceQuota != nil { + in, out := &in.NamespaceDefaultResourceQuota, &out.NamespaceDefaultResourceQuota + if *in == nil { + *out = nil + } else { + *out = new(NamespaceResourceQuota) + **out = **in + } + } return } @@ -5051,66 +5061,21 @@ func (in *Recipient) DeepCopy() *Recipient { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceQuotaTemplate) DeepCopyInto(out *ResourceQuotaTemplate) { +func (in *ResourceQuotaLimit) DeepCopyInto(out *ResourceQuotaLimit) { *out = *in - out.Namespaced = in.Namespaced - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.ProjectResourceQuota = in.ProjectResourceQuota return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaTemplate. -func (in *ResourceQuotaTemplate) DeepCopy() *ResourceQuotaTemplate { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaLimit. +func (in *ResourceQuotaLimit) DeepCopy() *ResourceQuotaLimit { if in == nil { return nil } - out := new(ResourceQuotaTemplate) + out := new(ResourceQuotaLimit) in.DeepCopyInto(out) return out } -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceQuotaTemplate) 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 *ResourceQuotaTemplateList) DeepCopyInto(out *ResourceQuotaTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ResourceQuotaTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaTemplateList. -func (in *ResourceQuotaTemplateList) DeepCopy() *ResourceQuotaTemplateList { - if in == nil { - return nil - } - out := new(ResourceQuotaTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ResourceQuotaTemplateList) 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 *RoleTemplate) DeepCopyInto(out *RoleTemplate) { *out = *in 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 d63e631d..cd70c62f 100644 --- a/apis/management.cattle.io/v3/zz_generated_k8s_client.go +++ b/apis/management.cattle.io/v3/zz_generated_k8s_client.go @@ -53,7 +53,6 @@ type Interface interface { ClusterAlertsGetter ProjectAlertsGetter ComposeConfigsGetter - ResourceQuotaTemplatesGetter } type Client struct { @@ -99,7 +98,6 @@ type Client struct { clusterAlertControllers map[string]ClusterAlertController projectAlertControllers map[string]ProjectAlertController composeConfigControllers map[string]ComposeConfigController - resourceQuotaTemplateControllers map[string]ResourceQuotaTemplateController } func NewForConfig(config rest.Config) (Interface, error) { @@ -154,7 +152,6 @@ func NewForConfig(config rest.Config) (Interface, error) { clusterAlertControllers: map[string]ClusterAlertController{}, projectAlertControllers: map[string]ProjectAlertController{}, composeConfigControllers: map[string]ComposeConfigController{}, - resourceQuotaTemplateControllers: map[string]ResourceQuotaTemplateController{}, }, nil } @@ -663,16 +660,3 @@ func (c *Client) ComposeConfigs(namespace string) ComposeConfigInterface { objectClient: objectClient, } } - -type ResourceQuotaTemplatesGetter interface { - ResourceQuotaTemplates(namespace string) ResourceQuotaTemplateInterface -} - -func (c *Client) ResourceQuotaTemplates(namespace string) ResourceQuotaTemplateInterface { - objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ResourceQuotaTemplateResource, ResourceQuotaTemplateGroupVersionKind, resourceQuotaTemplateFactory{}) - return &resourceQuotaTemplateClient{ - ns: namespace, - client: c, - objectClient: objectClient, - } -} diff --git a/apis/management.cattle.io/v3/zz_generated_resource_quota_template_controller.go b/apis/management.cattle.io/v3/zz_generated_resource_quota_template_controller.go deleted file mode 100644 index ada29981..00000000 --- a/apis/management.cattle.io/v3/zz_generated_resource_quota_template_controller.go +++ /dev/null @@ -1,252 +0,0 @@ -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/watch" - "k8s.io/client-go/tools/cache" -) - -var ( - ResourceQuotaTemplateGroupVersionKind = schema.GroupVersionKind{ - Version: Version, - Group: GroupName, - Kind: "ResourceQuotaTemplate", - } - ResourceQuotaTemplateResource = metav1.APIResource{ - Name: "resourcequotatemplates", - SingularName: "resourcequotatemplate", - Namespaced: true, - - Kind: ResourceQuotaTemplateGroupVersionKind.Kind, - } -) - -type ResourceQuotaTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ResourceQuotaTemplate -} - -type ResourceQuotaTemplateHandlerFunc func(key string, obj *ResourceQuotaTemplate) error - -type ResourceQuotaTemplateLister interface { - List(namespace string, selector labels.Selector) (ret []*ResourceQuotaTemplate, err error) - Get(namespace, name string) (*ResourceQuotaTemplate, error) -} - -type ResourceQuotaTemplateController interface { - Informer() cache.SharedIndexInformer - Lister() ResourceQuotaTemplateLister - AddHandler(name string, handler ResourceQuotaTemplateHandlerFunc) - AddClusterScopedHandler(name, clusterName string, handler ResourceQuotaTemplateHandlerFunc) - Enqueue(namespace, name string) - Sync(ctx context.Context) error - Start(ctx context.Context, threadiness int) error -} - -type ResourceQuotaTemplateInterface interface { - ObjectClient() *objectclient.ObjectClient - Create(*ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ResourceQuotaTemplate, error) - Get(name string, opts metav1.GetOptions) (*ResourceQuotaTemplate, error) - Update(*ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error - List(opts metav1.ListOptions) (*ResourceQuotaTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error - Controller() ResourceQuotaTemplateController - AddHandler(name string, sync ResourceQuotaTemplateHandlerFunc) - AddLifecycle(name string, lifecycle ResourceQuotaTemplateLifecycle) - AddClusterScopedHandler(name, clusterName string, sync ResourceQuotaTemplateHandlerFunc) - AddClusterScopedLifecycle(name, clusterName string, lifecycle ResourceQuotaTemplateLifecycle) -} - -type resourceQuotaTemplateLister struct { - controller *resourceQuotaTemplateController -} - -func (l *resourceQuotaTemplateLister) List(namespace string, selector labels.Selector) (ret []*ResourceQuotaTemplate, err error) { - err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) { - ret = append(ret, obj.(*ResourceQuotaTemplate)) - }) - return -} - -func (l *resourceQuotaTemplateLister) Get(namespace, name string) (*ResourceQuotaTemplate, 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: ResourceQuotaTemplateGroupVersionKind.Group, - Resource: "resourceQuotaTemplate", - }, key) - } - return obj.(*ResourceQuotaTemplate), nil -} - -type resourceQuotaTemplateController struct { - controller.GenericController -} - -func (c *resourceQuotaTemplateController) Lister() ResourceQuotaTemplateLister { - return &resourceQuotaTemplateLister{ - controller: c, - } -} - -func (c *resourceQuotaTemplateController) AddHandler(name string, handler ResourceQuotaTemplateHandlerFunc) { - 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.(*ResourceQuotaTemplate)) - }) -} - -func (c *resourceQuotaTemplateController) AddClusterScopedHandler(name, cluster string, handler ResourceQuotaTemplateHandlerFunc) { - 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.(*ResourceQuotaTemplate)) - }) -} - -type resourceQuotaTemplateFactory struct { -} - -func (c resourceQuotaTemplateFactory) Object() runtime.Object { - return &ResourceQuotaTemplate{} -} - -func (c resourceQuotaTemplateFactory) List() runtime.Object { - return &ResourceQuotaTemplateList{} -} - -func (s *resourceQuotaTemplateClient) Controller() ResourceQuotaTemplateController { - s.client.Lock() - defer s.client.Unlock() - - c, ok := s.client.resourceQuotaTemplateControllers[s.ns] - if ok { - return c - } - - genericController := controller.NewGenericController(ResourceQuotaTemplateGroupVersionKind.Kind+"Controller", - s.objectClient) - - c = &resourceQuotaTemplateController{ - GenericController: genericController, - } - - s.client.resourceQuotaTemplateControllers[s.ns] = c - s.client.starters = append(s.client.starters, c) - - return c -} - -type resourceQuotaTemplateClient struct { - client *Client - ns string - objectClient *objectclient.ObjectClient - controller ResourceQuotaTemplateController -} - -func (s *resourceQuotaTemplateClient) ObjectClient() *objectclient.ObjectClient { - return s.objectClient -} - -func (s *resourceQuotaTemplateClient) Create(o *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) { - obj, err := s.objectClient.Create(o) - return obj.(*ResourceQuotaTemplate), err -} - -func (s *resourceQuotaTemplateClient) Get(name string, opts metav1.GetOptions) (*ResourceQuotaTemplate, error) { - obj, err := s.objectClient.Get(name, opts) - return obj.(*ResourceQuotaTemplate), err -} - -func (s *resourceQuotaTemplateClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ResourceQuotaTemplate, error) { - obj, err := s.objectClient.GetNamespaced(namespace, name, opts) - return obj.(*ResourceQuotaTemplate), err -} - -func (s *resourceQuotaTemplateClient) Update(o *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) { - obj, err := s.objectClient.Update(o.Name, o) - return obj.(*ResourceQuotaTemplate), err -} - -func (s *resourceQuotaTemplateClient) Delete(name string, options *metav1.DeleteOptions) error { - return s.objectClient.Delete(name, options) -} - -func (s *resourceQuotaTemplateClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error { - return s.objectClient.DeleteNamespaced(namespace, name, options) -} - -func (s *resourceQuotaTemplateClient) List(opts metav1.ListOptions) (*ResourceQuotaTemplateList, error) { - obj, err := s.objectClient.List(opts) - return obj.(*ResourceQuotaTemplateList), err -} - -func (s *resourceQuotaTemplateClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { - return s.objectClient.Watch(opts) -} - -// Patch applies the patch and returns the patched deployment. -func (s *resourceQuotaTemplateClient) Patch(o *ResourceQuotaTemplate, data []byte, subresources ...string) (*ResourceQuotaTemplate, error) { - obj, err := s.objectClient.Patch(o.Name, o, data, subresources...) - return obj.(*ResourceQuotaTemplate), err -} - -func (s *resourceQuotaTemplateClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error { - return s.objectClient.DeleteCollection(deleteOpts, listOpts) -} - -func (s *resourceQuotaTemplateClient) AddHandler(name string, sync ResourceQuotaTemplateHandlerFunc) { - s.Controller().AddHandler(name, sync) -} - -func (s *resourceQuotaTemplateClient) AddLifecycle(name string, lifecycle ResourceQuotaTemplateLifecycle) { - sync := NewResourceQuotaTemplateLifecycleAdapter(name, false, s, lifecycle) - s.AddHandler(name, sync) -} - -func (s *resourceQuotaTemplateClient) AddClusterScopedHandler(name, clusterName string, sync ResourceQuotaTemplateHandlerFunc) { - s.Controller().AddClusterScopedHandler(name, clusterName, sync) -} - -func (s *resourceQuotaTemplateClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ResourceQuotaTemplateLifecycle) { - sync := NewResourceQuotaTemplateLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle) - s.AddClusterScopedHandler(name, clusterName, sync) -} diff --git a/apis/management.cattle.io/v3/zz_generated_resource_quota_template_lifecycle_adapter.go b/apis/management.cattle.io/v3/zz_generated_resource_quota_template_lifecycle_adapter.go deleted file mode 100644 index bbca481c..00000000 --- a/apis/management.cattle.io/v3/zz_generated_resource_quota_template_lifecycle_adapter.go +++ /dev/null @@ -1,51 +0,0 @@ -package v3 - -import ( - "github.com/rancher/norman/lifecycle" - "k8s.io/apimachinery/pkg/runtime" -) - -type ResourceQuotaTemplateLifecycle interface { - Create(obj *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - Remove(obj *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - Updated(obj *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) -} - -type resourceQuotaTemplateLifecycleAdapter struct { - lifecycle ResourceQuotaTemplateLifecycle -} - -func (w *resourceQuotaTemplateLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Create(obj.(*ResourceQuotaTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *resourceQuotaTemplateLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Remove(obj.(*ResourceQuotaTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func (w *resourceQuotaTemplateLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) { - o, err := w.lifecycle.Updated(obj.(*ResourceQuotaTemplate)) - if o == nil { - return nil, err - } - return o, err -} - -func NewResourceQuotaTemplateLifecycleAdapter(name string, clusterScoped bool, client ResourceQuotaTemplateInterface, l ResourceQuotaTemplateLifecycle) ResourceQuotaTemplateHandlerFunc { - adapter := &resourceQuotaTemplateLifecycleAdapter{lifecycle: l} - syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) - return func(key string, obj *ResourceQuotaTemplate) error { - if obj == nil { - return syncFn(key, nil) - } - return syncFn(key, obj) - } -} diff --git a/apis/management.cattle.io/v3/zz_generated_scheme.go b/apis/management.cattle.io/v3/zz_generated_scheme.go index 195d0a78..6f49fd61 100644 --- a/apis/management.cattle.io/v3/zz_generated_scheme.go +++ b/apis/management.cattle.io/v3/zz_generated_scheme.go @@ -108,8 +108,6 @@ func addKnownTypes(scheme *runtime.Scheme) error { &ProjectAlertList{}, &ComposeConfig{}, &ComposeConfigList{}, - &ResourceQuotaTemplate{}, - &ResourceQuotaTemplateList{}, ) return nil } diff --git a/client/cluster/v3/zz_generated_namespace.go b/client/cluster/v3/zz_generated_namespace.go index c309f0eb..0bd9a3ec 100644 --- a/client/cluster/v3/zz_generated_namespace.go +++ b/client/cluster/v3/zz_generated_namespace.go @@ -5,41 +5,39 @@ import ( ) const ( - NamespaceType = "namespace" - NamespaceFieldAnnotations = "annotations" - NamespaceFieldCreated = "created" - NamespaceFieldCreatorID = "creatorId" - NamespaceFieldDescription = "description" - NamespaceFieldLabels = "labels" - NamespaceFieldName = "name" - NamespaceFieldOwnerReferences = "ownerReferences" - NamespaceFieldProjectID = "projectId" - NamespaceFieldRemoved = "removed" - NamespaceFieldResourceQuotaAppliedTemplateID = "resourceQuotaAppliedTemplateId" - NamespaceFieldResourceQuotaTemplateID = "resourceQuotaTemplateId" - NamespaceFieldState = "state" - NamespaceFieldTransitioning = "transitioning" - NamespaceFieldTransitioningMessage = "transitioningMessage" - NamespaceFieldUUID = "uuid" + NamespaceType = "namespace" + NamespaceFieldAnnotations = "annotations" + NamespaceFieldCreated = "created" + NamespaceFieldCreatorID = "creatorId" + NamespaceFieldDescription = "description" + NamespaceFieldLabels = "labels" + NamespaceFieldName = "name" + NamespaceFieldOwnerReferences = "ownerReferences" + NamespaceFieldProjectID = "projectId" + NamespaceFieldRemoved = "removed" + NamespaceFieldResourceQuota = "resourceQuota" + NamespaceFieldState = "state" + NamespaceFieldTransitioning = "transitioning" + NamespaceFieldTransitioningMessage = "transitioningMessage" + NamespaceFieldUUID = "uuid" ) type Namespace 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"` - Description string `json:"description,omitempty" yaml:"description,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"` - ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceQuotaAppliedTemplateID string `json:"resourceQuotaAppliedTemplateId,omitempty" yaml:"resourceQuotaAppliedTemplateId,omitempty"` - ResourceQuotaTemplateID string `json:"resourceQuotaTemplateId,omitempty" yaml:"resourceQuotaTemplateId,omitempty"` - State string `json:"state,omitempty" yaml:"state,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"` + 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"` + Description string `json:"description,omitempty" yaml:"description,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"` + ProjectID string `json:"projectId,omitempty" yaml:"projectId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ResourceQuota *NamespaceResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` + State string `json:"state,omitempty" yaml:"state,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 NamespaceCollection struct { diff --git a/client/cluster/v3/zz_generated_namespace_resource_quota.go b/client/cluster/v3/zz_generated_namespace_resource_quota.go new file mode 100644 index 00000000..b170bf5d --- /dev/null +++ b/client/cluster/v3/zz_generated_namespace_resource_quota.go @@ -0,0 +1,10 @@ +package client + +const ( + NamespaceResourceQuotaType = "namespaceResourceQuota" + NamespaceResourceQuotaFieldLimit = "limit" +) + +type NamespaceResourceQuota struct { + Limit *ResourceQuotaLimit `json:"limit,omitempty" yaml:"limit,omitempty"` +} diff --git a/client/management/v3/zz_generated_project_resource_limit.go b/client/cluster/v3/zz_generated_resource_quota_limit.go similarity index 56% rename from client/management/v3/zz_generated_project_resource_limit.go rename to client/cluster/v3/zz_generated_resource_quota_limit.go index 7aa49fbe..4bc04abf 100644 --- a/client/management/v3/zz_generated_project_resource_limit.go +++ b/client/cluster/v3/zz_generated_resource_quota_limit.go @@ -1,23 +1,23 @@ package client const ( - ProjectResourceLimitType = "projectResourceLimit" - ProjectResourceLimitFieldConfigMaps = "configMaps" - ProjectResourceLimitFieldLimitsCPU = "limitsCpu" - ProjectResourceLimitFieldLimitsMemory = "limitsMemory" - ProjectResourceLimitFieldPersistentVolumeClaims = "persistentVolumeClaims" - ProjectResourceLimitFieldPods = "pods" - ProjectResourceLimitFieldReplicationControllers = "replicationControllers" - ProjectResourceLimitFieldRequestsCPU = "requestsCpu" - ProjectResourceLimitFieldRequestsMemory = "requestsMemory" - ProjectResourceLimitFieldRequestsStorage = "requestsStorage" - ProjectResourceLimitFieldSecrets = "secrets" - ProjectResourceLimitFieldServices = "services" - ProjectResourceLimitFieldServicesLoadBalancers = "servicesLoadBalancers" - ProjectResourceLimitFieldServicesNodePorts = "servicesNodePorts" + ResourceQuotaLimitType = "resourceQuotaLimit" + ResourceQuotaLimitFieldConfigMaps = "configMaps" + ResourceQuotaLimitFieldLimitsCPU = "limitsCpu" + ResourceQuotaLimitFieldLimitsMemory = "limitsMemory" + ResourceQuotaLimitFieldPersistentVolumeClaims = "persistentVolumeClaims" + ResourceQuotaLimitFieldPods = "pods" + ResourceQuotaLimitFieldReplicationControllers = "replicationControllers" + ResourceQuotaLimitFieldRequestsCPU = "requestsCpu" + ResourceQuotaLimitFieldRequestsMemory = "requestsMemory" + ResourceQuotaLimitFieldRequestsStorage = "requestsStorage" + ResourceQuotaLimitFieldSecrets = "secrets" + ResourceQuotaLimitFieldServices = "services" + ResourceQuotaLimitFieldServicesLoadBalancers = "servicesLoadBalancers" + ResourceQuotaLimitFieldServicesNodePorts = "servicesNodePorts" ) -type ProjectResourceLimit struct { +type ResourceQuotaLimit struct { ConfigMaps string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"` LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"` diff --git a/client/management/v3/zz_generated_client.go b/client/management/v3/zz_generated_client.go index f7062b49..4aaed51c 100644 --- a/client/management/v3/zz_generated_client.go +++ b/client/management/v3/zz_generated_client.go @@ -44,7 +44,6 @@ type Client struct { ClusterAlert ClusterAlertOperations ProjectAlert ProjectAlertOperations ComposeConfig ComposeConfigOperations - ResourceQuotaTemplate ResourceQuotaTemplateOperations } func NewClient(opts *clientbase.ClientOpts) (*Client, error) { @@ -94,7 +93,6 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) { client.ClusterAlert = newClusterAlertClient(client) client.ProjectAlert = newProjectAlertClient(client) client.ComposeConfig = newComposeConfigClient(client) - client.ResourceQuotaTemplate = newResourceQuotaTemplateClient(client) return client, nil } diff --git a/client/management/v3/zz_generated_namespace_resource_quota.go b/client/management/v3/zz_generated_namespace_resource_quota.go new file mode 100644 index 00000000..b170bf5d --- /dev/null +++ b/client/management/v3/zz_generated_namespace_resource_quota.go @@ -0,0 +1,10 @@ +package client + +const ( + NamespaceResourceQuotaType = "namespaceResourceQuota" + NamespaceResourceQuotaFieldLimit = "limit" +) + +type NamespaceResourceQuota struct { + Limit *ResourceQuotaLimit `json:"limit,omitempty" yaml:"limit,omitempty"` +} diff --git a/client/management/v3/zz_generated_project.go b/client/management/v3/zz_generated_project.go index bc90af59..53d1f9b1 100644 --- a/client/management/v3/zz_generated_project.go +++ b/client/management/v3/zz_generated_project.go @@ -14,6 +14,7 @@ const ( ProjectFieldDescription = "description" ProjectFieldLabels = "labels" ProjectFieldName = "name" + ProjectFieldNamespaceDefaultResourceQuota = "namespaceDefaultResourceQuota" ProjectFieldNamespaceId = "namespaceId" ProjectFieldOwnerReferences = "ownerReferences" ProjectFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId" @@ -27,23 +28,24 @@ const ( type Project struct { types.Resource - Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Conditions []ProjectCondition `json:"conditions,omitempty" yaml:"conditions,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"` - 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"` - PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` - State string `json:"state,omitempty" yaml:"state,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"` + Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"` + ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` + Conditions []ProjectCondition `json:"conditions,omitempty" yaml:"conditions,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"` + Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` + Name string `json:"name,omitempty" yaml:"name,omitempty"` + NamespaceDefaultResourceQuota *NamespaceResourceQuota `json:"namespaceDefaultResourceQuota,omitempty" yaml:"namespaceDefaultResourceQuota,omitempty"` + NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` + OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` + PodSecurityPolicyTemplateName string `json:"podSecurityPolicyTemplateId,omitempty" yaml:"podSecurityPolicyTemplateId,omitempty"` + Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` + ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` + State string `json:"state,omitempty" yaml:"state,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 ProjectCollection struct { diff --git a/client/management/v3/zz_generated_project_resource_quota.go b/client/management/v3/zz_generated_project_resource_quota.go index 308878a5..05f73660 100644 --- a/client/management/v3/zz_generated_project_resource_quota.go +++ b/client/management/v3/zz_generated_project_resource_quota.go @@ -7,6 +7,6 @@ const ( ) type ProjectResourceQuota struct { - Limit *ProjectResourceLimit `json:"limit,omitempty" yaml:"limit,omitempty"` - UsedLimit *ProjectResourceLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"` + Limit *ResourceQuotaLimit `json:"limit,omitempty" yaml:"limit,omitempty"` + UsedLimit *ResourceQuotaLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"` } diff --git a/client/management/v3/zz_generated_project_spec.go b/client/management/v3/zz_generated_project_spec.go index 47787636..09c08548 100644 --- a/client/management/v3/zz_generated_project_spec.go +++ b/client/management/v3/zz_generated_project_spec.go @@ -1,16 +1,18 @@ package client const ( - ProjectSpecType = "projectSpec" - ProjectSpecFieldClusterID = "clusterId" - ProjectSpecFieldDescription = "description" - ProjectSpecFieldDisplayName = "displayName" - ProjectSpecFieldResourceQuota = "resourceQuota" + ProjectSpecType = "projectSpec" + ProjectSpecFieldClusterID = "clusterId" + ProjectSpecFieldDescription = "description" + ProjectSpecFieldDisplayName = "displayName" + ProjectSpecFieldNamespaceDefaultResourceQuota = "namespaceDefaultResourceQuota" + ProjectSpecFieldResourceQuota = "resourceQuota" ) type ProjectSpec struct { - ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` - ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` + ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"` + Description string `json:"description,omitempty" yaml:"description,omitempty"` + DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"` + NamespaceDefaultResourceQuota *NamespaceResourceQuota `json:"namespaceDefaultResourceQuota,omitempty" yaml:"namespaceDefaultResourceQuota,omitempty"` + ResourceQuota *ProjectResourceQuota `json:"resourceQuota,omitempty" yaml:"resourceQuota,omitempty"` } diff --git a/client/management/v3/zz_generated_resource_quota_limit.go b/client/management/v3/zz_generated_resource_quota_limit.go new file mode 100644 index 00000000..4bc04abf --- /dev/null +++ b/client/management/v3/zz_generated_resource_quota_limit.go @@ -0,0 +1,34 @@ +package client + +const ( + ResourceQuotaLimitType = "resourceQuotaLimit" + ResourceQuotaLimitFieldConfigMaps = "configMaps" + ResourceQuotaLimitFieldLimitsCPU = "limitsCpu" + ResourceQuotaLimitFieldLimitsMemory = "limitsMemory" + ResourceQuotaLimitFieldPersistentVolumeClaims = "persistentVolumeClaims" + ResourceQuotaLimitFieldPods = "pods" + ResourceQuotaLimitFieldReplicationControllers = "replicationControllers" + ResourceQuotaLimitFieldRequestsCPU = "requestsCpu" + ResourceQuotaLimitFieldRequestsMemory = "requestsMemory" + ResourceQuotaLimitFieldRequestsStorage = "requestsStorage" + ResourceQuotaLimitFieldSecrets = "secrets" + ResourceQuotaLimitFieldServices = "services" + ResourceQuotaLimitFieldServicesLoadBalancers = "servicesLoadBalancers" + ResourceQuotaLimitFieldServicesNodePorts = "servicesNodePorts" +) + +type ResourceQuotaLimit struct { + ConfigMaps string `json:"configMaps,omitempty" yaml:"configMaps,omitempty"` + LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"` + LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"` + PersistentVolumeClaims string `json:"persistentVolumeClaims,omitempty" yaml:"persistentVolumeClaims,omitempty"` + Pods string `json:"pods,omitempty" yaml:"pods,omitempty"` + ReplicationControllers string `json:"replicationControllers,omitempty" yaml:"replicationControllers,omitempty"` + RequestsCPU string `json:"requestsCpu,omitempty" yaml:"requestsCpu,omitempty"` + RequestsMemory string `json:"requestsMemory,omitempty" yaml:"requestsMemory,omitempty"` + RequestsStorage string `json:"requestsStorage,omitempty" yaml:"requestsStorage,omitempty"` + Secrets string `json:"secrets,omitempty" yaml:"secrets,omitempty"` + Services string `json:"services,omitempty" yaml:"services,omitempty"` + ServicesLoadBalancers string `json:"servicesLoadBalancers,omitempty" yaml:"servicesLoadBalancers,omitempty"` + ServicesNodePorts string `json:"servicesNodePorts,omitempty" yaml:"servicesNodePorts,omitempty"` +} diff --git a/client/management/v3/zz_generated_resource_quota_template.go b/client/management/v3/zz_generated_resource_quota_template.go deleted file mode 100644 index ff55970e..00000000 --- a/client/management/v3/zz_generated_resource_quota_template.go +++ /dev/null @@ -1,111 +0,0 @@ -package client - -import ( - "github.com/rancher/norman/types" -) - -const ( - ResourceQuotaTemplateType = "resourceQuotaTemplate" - ResourceQuotaTemplateFieldAnnotations = "annotations" - ResourceQuotaTemplateFieldClusterID = "clusterId" - ResourceQuotaTemplateFieldCreated = "created" - ResourceQuotaTemplateFieldCreatorID = "creatorId" - ResourceQuotaTemplateFieldDescription = "description" - ResourceQuotaTemplateFieldIsDefault = "isDefault" - ResourceQuotaTemplateFieldLabels = "labels" - ResourceQuotaTemplateFieldLimit = "limit" - ResourceQuotaTemplateFieldName = "name" - ResourceQuotaTemplateFieldNamespaceId = "namespaceId" - ResourceQuotaTemplateFieldOwnerReferences = "ownerReferences" - ResourceQuotaTemplateFieldRemoved = "removed" - ResourceQuotaTemplateFieldUUID = "uuid" - ResourceQuotaTemplateFieldUsedLimit = "usedLimit" -) - -type ResourceQuotaTemplate 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"` - Description string `json:"description,omitempty" yaml:"description,omitempty"` - IsDefault bool `json:"isDefault,omitempty" yaml:"isDefault,omitempty"` - Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"` - Limit *ProjectResourceLimit `json:"limit,omitempty" yaml:"limit,omitempty"` - Name string `json:"name,omitempty" yaml:"name,omitempty"` - NamespaceId string `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"` - OwnerReferences []OwnerReference `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"` - Removed string `json:"removed,omitempty" yaml:"removed,omitempty"` - UUID string `json:"uuid,omitempty" yaml:"uuid,omitempty"` - UsedLimit *ProjectResourceLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"` -} - -type ResourceQuotaTemplateCollection struct { - types.Collection - Data []ResourceQuotaTemplate `json:"data,omitempty"` - client *ResourceQuotaTemplateClient -} - -type ResourceQuotaTemplateClient struct { - apiClient *Client -} - -type ResourceQuotaTemplateOperations interface { - List(opts *types.ListOpts) (*ResourceQuotaTemplateCollection, error) - Create(opts *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - Update(existing *ResourceQuotaTemplate, updates interface{}) (*ResourceQuotaTemplate, error) - Replace(existing *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) - ByID(id string) (*ResourceQuotaTemplate, error) - Delete(container *ResourceQuotaTemplate) error -} - -func newResourceQuotaTemplateClient(apiClient *Client) *ResourceQuotaTemplateClient { - return &ResourceQuotaTemplateClient{ - apiClient: apiClient, - } -} - -func (c *ResourceQuotaTemplateClient) Create(container *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) { - resp := &ResourceQuotaTemplate{} - err := c.apiClient.Ops.DoCreate(ResourceQuotaTemplateType, container, resp) - return resp, err -} - -func (c *ResourceQuotaTemplateClient) Update(existing *ResourceQuotaTemplate, updates interface{}) (*ResourceQuotaTemplate, error) { - resp := &ResourceQuotaTemplate{} - err := c.apiClient.Ops.DoUpdate(ResourceQuotaTemplateType, &existing.Resource, updates, resp) - return resp, err -} - -func (c *ResourceQuotaTemplateClient) Replace(obj *ResourceQuotaTemplate) (*ResourceQuotaTemplate, error) { - resp := &ResourceQuotaTemplate{} - err := c.apiClient.Ops.DoReplace(ResourceQuotaTemplateType, &obj.Resource, obj, resp) - return resp, err -} - -func (c *ResourceQuotaTemplateClient) List(opts *types.ListOpts) (*ResourceQuotaTemplateCollection, error) { - resp := &ResourceQuotaTemplateCollection{} - err := c.apiClient.Ops.DoList(ResourceQuotaTemplateType, opts, resp) - resp.client = c - return resp, err -} - -func (cc *ResourceQuotaTemplateCollection) Next() (*ResourceQuotaTemplateCollection, error) { - if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" { - resp := &ResourceQuotaTemplateCollection{} - err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp) - resp.client = cc.client - return resp, err - } - return nil, nil -} - -func (c *ResourceQuotaTemplateClient) ByID(id string) (*ResourceQuotaTemplate, error) { - resp := &ResourceQuotaTemplate{} - err := c.apiClient.Ops.DoByID(ResourceQuotaTemplateType, id, resp) - return resp, err -} - -func (c *ResourceQuotaTemplateClient) Delete(container *ResourceQuotaTemplate) error { - return c.apiClient.Ops.DoResourceDelete(ResourceQuotaTemplateType, &container.Resource) -} diff --git a/compose/zz_generated_compose.go b/compose/zz_generated_compose.go index 91b70bc3..483595af 100644 --- a/compose/zz_generated_compose.go +++ b/compose/zz_generated_compose.go @@ -43,7 +43,6 @@ type Config struct { ClusterAlerts map[string]managementClient.ClusterAlert `json:"clusterAlerts,omitempty" yaml:"clusterAlerts,omitempty"` ProjectAlerts map[string]managementClient.ProjectAlert `json:"projectAlerts,omitempty" yaml:"projectAlerts,omitempty"` ComposeConfigs map[string]managementClient.ComposeConfig `json:"composeConfigs,omitempty" yaml:"composeConfigs,omitempty"` - ResourceQuotaTemplates map[string]managementClient.ResourceQuotaTemplate `json:"resourceQuotaTemplates,omitempty" yaml:"resourceQuotaTemplates,omitempty"` // Cluster Client Namespaces map[string]clusterClient.Namespace `json:"namespaces,omitempty" yaml:"namespaces,omitempty"`