mirror of
https://github.com/rancher/types.git
synced 2025-04-27 18:25:05 +00:00
Generated changes
This commit is contained in:
parent
6ec1e0a018
commit
374bbecefe
@ -269,6 +269,39 @@ func (in *ReplicationControllerList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceQuotaList) DeepCopyInto(out *ResourceQuotaList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]core_v1.ResourceQuota, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceQuotaList.
|
||||
func (in *ResourceQuotaList) DeepCopy() *ResourceQuotaList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceQuotaList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ResourceQuotaList) 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 *SecretList) DeepCopyInto(out *SecretList) {
|
||||
*out = *in
|
||||
|
@ -26,6 +26,7 @@ type Interface interface {
|
||||
ConfigMapsGetter
|
||||
ServiceAccountsGetter
|
||||
ReplicationControllersGetter
|
||||
ResourceQuotasGetter
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@ -44,6 +45,7 @@ type Client struct {
|
||||
configMapControllers map[string]ConfigMapController
|
||||
serviceAccountControllers map[string]ServiceAccountController
|
||||
replicationControllerControllers map[string]ReplicationControllerController
|
||||
resourceQuotaControllers map[string]ResourceQuotaController
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
@ -71,6 +73,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
configMapControllers: map[string]ConfigMapController{},
|
||||
serviceAccountControllers: map[string]ServiceAccountController{},
|
||||
replicationControllerControllers: map[string]ReplicationControllerController{},
|
||||
resourceQuotaControllers: map[string]ResourceQuotaController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -228,3 +231,16 @@ func (c *Client) ReplicationControllers(namespace string) ReplicationControllerI
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type ResourceQuotasGetter interface {
|
||||
ResourceQuotas(namespace string) ResourceQuotaInterface
|
||||
}
|
||||
|
||||
func (c *Client) ResourceQuotas(namespace string) ResourceQuotaInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ResourceQuotaResource, ResourceQuotaGroupVersionKind, resourceQuotaFactory{})
|
||||
return &resourceQuotaClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
253
apis/core/v1/zz_generated_resource_quota_controller.go
Normal file
253
apis/core/v1/zz_generated_resource_quota_controller.go
Normal file
@ -0,0 +1,253 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/rancher/norman/controller"
|
||||
"github.com/rancher/norman/objectclient"
|
||||
"k8s.io/api/core/v1"
|
||||
"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 (
|
||||
ResourceQuotaGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "ResourceQuota",
|
||||
}
|
||||
ResourceQuotaResource = metav1.APIResource{
|
||||
Name: "resourcequotas",
|
||||
SingularName: "resourcequota",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: ResourceQuotaGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
type ResourceQuotaList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []v1.ResourceQuota
|
||||
}
|
||||
|
||||
type ResourceQuotaHandlerFunc func(key string, obj *v1.ResourceQuota) error
|
||||
|
||||
type ResourceQuotaLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*v1.ResourceQuota, err error)
|
||||
Get(namespace, name string) (*v1.ResourceQuota, error)
|
||||
}
|
||||
|
||||
type ResourceQuotaController interface {
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() ResourceQuotaLister
|
||||
AddHandler(name string, handler ResourceQuotaHandlerFunc)
|
||||
AddClusterScopedHandler(name, clusterName string, handler ResourceQuotaHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type ResourceQuotaInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*v1.ResourceQuota) (*v1.ResourceQuota, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.ResourceQuota, error)
|
||||
Get(name string, opts metav1.GetOptions) (*v1.ResourceQuota, error)
|
||||
Update(*v1.ResourceQuota) (*v1.ResourceQuota, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*ResourceQuotaList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() ResourceQuotaController
|
||||
AddHandler(name string, sync ResourceQuotaHandlerFunc)
|
||||
AddLifecycle(name string, lifecycle ResourceQuotaLifecycle)
|
||||
AddClusterScopedHandler(name, clusterName string, sync ResourceQuotaHandlerFunc)
|
||||
AddClusterScopedLifecycle(name, clusterName string, lifecycle ResourceQuotaLifecycle)
|
||||
}
|
||||
|
||||
type resourceQuotaLister struct {
|
||||
controller *resourceQuotaController
|
||||
}
|
||||
|
||||
func (l *resourceQuotaLister) List(namespace string, selector labels.Selector) (ret []*v1.ResourceQuota, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*v1.ResourceQuota))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *resourceQuotaLister) Get(namespace, name string) (*v1.ResourceQuota, 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: ResourceQuotaGroupVersionKind.Group,
|
||||
Resource: "resourceQuota",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*v1.ResourceQuota), nil
|
||||
}
|
||||
|
||||
type resourceQuotaController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *resourceQuotaController) Lister() ResourceQuotaLister {
|
||||
return &resourceQuotaLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *resourceQuotaController) AddHandler(name string, handler ResourceQuotaHandlerFunc) {
|
||||
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.(*v1.ResourceQuota))
|
||||
})
|
||||
}
|
||||
|
||||
func (c *resourceQuotaController) AddClusterScopedHandler(name, cluster string, handler ResourceQuotaHandlerFunc) {
|
||||
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.(*v1.ResourceQuota))
|
||||
})
|
||||
}
|
||||
|
||||
type resourceQuotaFactory struct {
|
||||
}
|
||||
|
||||
func (c resourceQuotaFactory) Object() runtime.Object {
|
||||
return &v1.ResourceQuota{}
|
||||
}
|
||||
|
||||
func (c resourceQuotaFactory) List() runtime.Object {
|
||||
return &ResourceQuotaList{}
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Controller() ResourceQuotaController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.resourceQuotaControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(ResourceQuotaGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &resourceQuotaController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.resourceQuotaControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type resourceQuotaClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller ResourceQuotaController
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Create(o *v1.ResourceQuota) (*v1.ResourceQuota, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*v1.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Get(name string, opts metav1.GetOptions) (*v1.ResourceQuota, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*v1.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.ResourceQuota, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*v1.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Update(o *v1.ResourceQuota) (*v1.ResourceQuota, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*v1.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) List(opts metav1.ListOptions) (*ResourceQuotaList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*ResourceQuotaList), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *resourceQuotaClient) Patch(o *v1.ResourceQuota, data []byte, subresources ...string) (*v1.ResourceQuota, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, data, subresources...)
|
||||
return obj.(*v1.ResourceQuota), err
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) AddHandler(name string, sync ResourceQuotaHandlerFunc) {
|
||||
s.Controller().AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) AddLifecycle(name string, lifecycle ResourceQuotaLifecycle) {
|
||||
sync := NewResourceQuotaLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.AddHandler(name, sync)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) AddClusterScopedHandler(name, clusterName string, sync ResourceQuotaHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *resourceQuotaClient) AddClusterScopedLifecycle(name, clusterName string, lifecycle ResourceQuotaLifecycle) {
|
||||
sync := NewResourceQuotaLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.AddClusterScopedHandler(name, clusterName, sync)
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type ResourceQuotaLifecycle interface {
|
||||
Create(obj *v1.ResourceQuota) (*v1.ResourceQuota, error)
|
||||
Remove(obj *v1.ResourceQuota) (*v1.ResourceQuota, error)
|
||||
Updated(obj *v1.ResourceQuota) (*v1.ResourceQuota, error)
|
||||
}
|
||||
|
||||
type resourceQuotaLifecycleAdapter struct {
|
||||
lifecycle ResourceQuotaLifecycle
|
||||
}
|
||||
|
||||
func (w *resourceQuotaLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*v1.ResourceQuota))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *resourceQuotaLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*v1.ResourceQuota))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *resourceQuotaLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*v1.ResourceQuota))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewResourceQuotaLifecycleAdapter(name string, clusterScoped bool, client ResourceQuotaInterface, l ResourceQuotaLifecycle) ResourceQuotaHandlerFunc {
|
||||
adapter := &resourceQuotaLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1.ResourceQuota) error {
|
||||
if obj == nil {
|
||||
return syncFn(key, nil)
|
||||
}
|
||||
return syncFn(key, obj)
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&ConfigMapList{},
|
||||
&ServiceAccountList{},
|
||||
&ReplicationControllerList{},
|
||||
&ResourceQuotaList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
@ -4624,7 +4624,7 @@ func (in *Project) DeepCopyInto(out *Project) {
|
||||
out.Namespaced = in.Namespaced
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
in.Spec.DeepCopyInto(&out.Spec)
|
||||
in.Status.DeepCopyInto(&out.Status)
|
||||
return
|
||||
}
|
||||
@ -4996,6 +4996,40 @@ 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
|
||||
out.Limit = in.Limit
|
||||
out.UsedLimit = in.UsedLimit
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProjectResourceQuota.
|
||||
func (in *ProjectResourceQuota) DeepCopy() *ProjectResourceQuota {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ProjectResourceQuota)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectRoleTemplateBinding) DeepCopyInto(out *ProjectRoleTemplateBinding) {
|
||||
*out = *in
|
||||
@ -5059,6 +5093,15 @@ func (in *ProjectRoleTemplateBindingList) DeepCopyObject() runtime.Object {
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProjectSpec) DeepCopyInto(out *ProjectSpec) {
|
||||
*out = *in
|
||||
if in.ResourceQuota != nil {
|
||||
in, out := &in.ResourceQuota, &out.ResourceQuota
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ProjectResourceQuota)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -5367,6 +5410,67 @@ func (in *RepoPerm) DeepCopy() *RepoPerm {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ResourceQuotaTemplate) DeepCopyInto(out *ResourceQuotaTemplate) {
|
||||
*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 {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ResourceQuotaTemplate)
|
||||
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
|
||||
|
@ -59,6 +59,7 @@ type Interface interface {
|
||||
PipelineExecutionLogsGetter
|
||||
SourceCodeRepositoriesGetter
|
||||
ComposeConfigsGetter
|
||||
ResourceQuotaTemplatesGetter
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@ -110,6 +111,7 @@ type Client struct {
|
||||
pipelineExecutionLogControllers map[string]PipelineExecutionLogController
|
||||
sourceCodeRepositoryControllers map[string]SourceCodeRepositoryController
|
||||
composeConfigControllers map[string]ComposeConfigController
|
||||
resourceQuotaTemplateControllers map[string]ResourceQuotaTemplateController
|
||||
}
|
||||
|
||||
func NewForConfig(config rest.Config) (Interface, error) {
|
||||
@ -170,6 +172,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
pipelineExecutionLogControllers: map[string]PipelineExecutionLogController{},
|
||||
sourceCodeRepositoryControllers: map[string]SourceCodeRepositoryController{},
|
||||
composeConfigControllers: map[string]ComposeConfigController{},
|
||||
resourceQuotaTemplateControllers: map[string]ResourceQuotaTemplateController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -756,3 +759,16 @@ 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,
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,252 @@
|
||||
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)
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
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)
|
||||
}
|
||||
}
|
@ -120,6 +120,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&SourceCodeRepositoryList{},
|
||||
&ComposeConfig{},
|
||||
&ComposeConfigList{},
|
||||
&ResourceQuotaTemplate{},
|
||||
&ResourceQuotaTemplateList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
@ -5,37 +5,41 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
NamespaceType = "namespace"
|
||||
NamespaceFieldAnnotations = "annotations"
|
||||
NamespaceFieldCreated = "created"
|
||||
NamespaceFieldCreatorID = "creatorId"
|
||||
NamespaceFieldDescription = "description"
|
||||
NamespaceFieldLabels = "labels"
|
||||
NamespaceFieldName = "name"
|
||||
NamespaceFieldOwnerReferences = "ownerReferences"
|
||||
NamespaceFieldProjectID = "projectId"
|
||||
NamespaceFieldRemoved = "removed"
|
||||
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"
|
||||
NamespaceFieldResourceQuotaAppliedTemplateID = "resourceQuotaAppliedTemplateId"
|
||||
NamespaceFieldResourceQuotaTemplateID = "resourceQuotaTemplateId"
|
||||
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"`
|
||||
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"`
|
||||
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"`
|
||||
}
|
||||
type NamespaceCollection struct {
|
||||
types.Collection
|
||||
|
@ -50,6 +50,7 @@ type Client struct {
|
||||
PipelineExecutionLog PipelineExecutionLogOperations
|
||||
SourceCodeRepository SourceCodeRepositoryOperations
|
||||
ComposeConfig ComposeConfigOperations
|
||||
ResourceQuotaTemplate ResourceQuotaTemplateOperations
|
||||
}
|
||||
|
||||
func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
@ -105,6 +106,7 @@ func NewClient(opts *clientbase.ClientOpts) (*Client, error) {
|
||||
client.PipelineExecutionLog = newPipelineExecutionLogClient(client)
|
||||
client.SourceCodeRepository = newSourceCodeRepositoryClient(client)
|
||||
client.ComposeConfig = newComposeConfigClient(client)
|
||||
client.ResourceQuotaTemplate = newResourceQuotaTemplateClient(client)
|
||||
|
||||
return client, nil
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ const (
|
||||
ProjectFieldOwnerReferences = "ownerReferences"
|
||||
ProjectFieldPodSecurityPolicyTemplateName = "podSecurityPolicyTemplateId"
|
||||
ProjectFieldRemoved = "removed"
|
||||
ProjectFieldResourceQuota = "resourceQuota"
|
||||
ProjectFieldState = "state"
|
||||
ProjectFieldTransitioning = "transitioning"
|
||||
ProjectFieldTransitioningMessage = "transitioningMessage"
|
||||
@ -26,22 +27,23 @@ 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"`
|
||||
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"`
|
||||
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 {
|
||||
types.Collection
|
||||
|
34
client/management/v3/zz_generated_project_resource_limit.go
Normal file
34
client/management/v3/zz_generated_project_resource_limit.go
Normal file
@ -0,0 +1,34 @@
|
||||
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"
|
||||
)
|
||||
|
||||
type ProjectResourceLimit 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"`
|
||||
}
|
12
client/management/v3/zz_generated_project_resource_quota.go
Normal file
12
client/management/v3/zz_generated_project_resource_quota.go
Normal file
@ -0,0 +1,12 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ProjectResourceQuotaType = "projectResourceQuota"
|
||||
ProjectResourceQuotaFieldLimit = "limit"
|
||||
ProjectResourceQuotaFieldUsedLimit = "usedLimit"
|
||||
)
|
||||
|
||||
type ProjectResourceQuota struct {
|
||||
Limit *ProjectResourceLimit `json:"limit,omitempty" yaml:"limit,omitempty"`
|
||||
UsedLimit *ProjectResourceLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"`
|
||||
}
|
@ -1,14 +1,16 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ProjectSpecType = "projectSpec"
|
||||
ProjectSpecFieldClusterId = "clusterId"
|
||||
ProjectSpecFieldDescription = "description"
|
||||
ProjectSpecFieldDisplayName = "displayName"
|
||||
ProjectSpecType = "projectSpec"
|
||||
ProjectSpecFieldClusterId = "clusterId"
|
||||
ProjectSpecFieldDescription = "description"
|
||||
ProjectSpecFieldDisplayName = "displayName"
|
||||
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"`
|
||||
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"`
|
||||
}
|
||||
|
103
client/management/v3/zz_generated_resource_quota_template.go
Normal file
103
client/management/v3/zz_generated_resource_quota_template.go
Normal file
@ -0,0 +1,103 @@
|
||||
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"
|
||||
ResourceQuotaTemplateFieldUsedLimit = "usedLimit"
|
||||
ResourceQuotaTemplateFieldUuid = "uuid"
|
||||
)
|
||||
|
||||
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"`
|
||||
UsedLimit *ProjectResourceLimit `json:"usedLimit,omitempty" yaml:"usedLimit,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty" yaml:"uuid,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)
|
||||
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) 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)
|
||||
}
|
@ -49,6 +49,7 @@ type Config struct {
|
||||
PipelineExecutionLogs map[string]managementClient.PipelineExecutionLog `json:"pipelineExecutionLogs,omitempty" yaml:"pipelineExecutionLogs,omitempty"`
|
||||
SourceCodeRepositorys map[string]managementClient.SourceCodeRepository `json:"sourceCodeRepositories,omitempty" yaml:"sourceCodeRepositories,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"`
|
||||
|
Loading…
Reference in New Issue
Block a user