mirror of
https://github.com/rancher/types.git
synced 2025-08-31 04:02:03 +00:00
Generated changes
This commit is contained in:
parent
2b0e3415a4
commit
a3c9a8f461
@ -137,6 +137,39 @@ func (in *EventList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LimitRangeList) DeepCopyInto(out *LimitRangeList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]corev1.LimitRange, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LimitRangeList.
|
||||
func (in *LimitRangeList) DeepCopy() *LimitRangeList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LimitRangeList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *LimitRangeList) 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 *NamespaceList) DeepCopyInto(out *NamespaceList) {
|
||||
*out = *in
|
||||
|
@ -33,6 +33,7 @@ type Interface interface {
|
||||
ServiceAccountsGetter
|
||||
ReplicationControllersGetter
|
||||
ResourceQuotasGetter
|
||||
LimitRangesGetter
|
||||
}
|
||||
|
||||
type Clients struct {
|
||||
@ -51,6 +52,7 @@ type Clients struct {
|
||||
ServiceAccount ServiceAccountClient
|
||||
ReplicationController ReplicationControllerClient
|
||||
ResourceQuota ResourceQuotaClient
|
||||
LimitRange LimitRangeClient
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
@ -71,6 +73,7 @@ type Client struct {
|
||||
serviceAccountControllers map[string]ServiceAccountController
|
||||
replicationControllerControllers map[string]ReplicationControllerController
|
||||
resourceQuotaControllers map[string]ResourceQuotaController
|
||||
limitRangeControllers map[string]LimitRangeController
|
||||
}
|
||||
|
||||
func Factory(ctx context.Context, config rest.Config) (context.Context, controller.Starter, error) {
|
||||
@ -145,6 +148,9 @@ func NewClientsFromInterface(iface Interface) *Clients {
|
||||
ResourceQuota: &resourceQuotaClient2{
|
||||
iface: iface.ResourceQuotas(""),
|
||||
},
|
||||
LimitRange: &limitRangeClient2{
|
||||
iface: iface.LimitRanges(""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,6 +180,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
|
||||
serviceAccountControllers: map[string]ServiceAccountController{},
|
||||
replicationControllerControllers: map[string]ReplicationControllerController{},
|
||||
resourceQuotaControllers: map[string]ResourceQuotaController{},
|
||||
limitRangeControllers: map[string]LimitRangeController{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@ -357,3 +364,16 @@ func (c *Client) ResourceQuotas(namespace string) ResourceQuotaInterface {
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
||||
type LimitRangesGetter interface {
|
||||
LimitRanges(namespace string) LimitRangeInterface
|
||||
}
|
||||
|
||||
func (c *Client) LimitRanges(namespace string) LimitRangeInterface {
|
||||
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &LimitRangeResource, LimitRangeGroupVersionKind, limitRangeFactory{})
|
||||
return &limitRangeClient{
|
||||
ns: namespace,
|
||||
client: c,
|
||||
objectClient: objectClient,
|
||||
}
|
||||
}
|
||||
|
441
apis/core/v1/zz_generated_limit_range_controller.go
Normal file
441
apis/core/v1/zz_generated_limit_range_controller.go
Normal file
@ -0,0 +1,441 @@
|
||||
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/types"
|
||||
"k8s.io/apimachinery/pkg/watch"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
)
|
||||
|
||||
var (
|
||||
LimitRangeGroupVersionKind = schema.GroupVersionKind{
|
||||
Version: Version,
|
||||
Group: GroupName,
|
||||
Kind: "LimitRange",
|
||||
}
|
||||
LimitRangeResource = metav1.APIResource{
|
||||
Name: "limitranges",
|
||||
SingularName: "limitrange",
|
||||
Namespaced: true,
|
||||
|
||||
Kind: LimitRangeGroupVersionKind.Kind,
|
||||
}
|
||||
)
|
||||
|
||||
func NewLimitRange(namespace, name string, obj v1.LimitRange) *v1.LimitRange {
|
||||
obj.APIVersion, obj.Kind = LimitRangeGroupVersionKind.ToAPIVersionAndKind()
|
||||
obj.Name = name
|
||||
obj.Namespace = namespace
|
||||
return &obj
|
||||
}
|
||||
|
||||
type LimitRangeList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
Items []v1.LimitRange
|
||||
}
|
||||
|
||||
type LimitRangeHandlerFunc func(key string, obj *v1.LimitRange) (runtime.Object, error)
|
||||
|
||||
type LimitRangeChangeHandlerFunc func(obj *v1.LimitRange) (runtime.Object, error)
|
||||
|
||||
type LimitRangeLister interface {
|
||||
List(namespace string, selector labels.Selector) (ret []*v1.LimitRange, err error)
|
||||
Get(namespace, name string) (*v1.LimitRange, error)
|
||||
}
|
||||
|
||||
type LimitRangeController interface {
|
||||
Generic() controller.GenericController
|
||||
Informer() cache.SharedIndexInformer
|
||||
Lister() LimitRangeLister
|
||||
AddHandler(ctx context.Context, name string, handler LimitRangeHandlerFunc)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler LimitRangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
Sync(ctx context.Context) error
|
||||
Start(ctx context.Context, threadiness int) error
|
||||
}
|
||||
|
||||
type LimitRangeInterface interface {
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Create(*v1.LimitRange) (*v1.LimitRange, error)
|
||||
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.LimitRange, error)
|
||||
Get(name string, opts metav1.GetOptions) (*v1.LimitRange, error)
|
||||
Update(*v1.LimitRange) (*v1.LimitRange, error)
|
||||
Delete(name string, options *metav1.DeleteOptions) error
|
||||
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(opts metav1.ListOptions) (*LimitRangeList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
|
||||
Controller() LimitRangeController
|
||||
AddHandler(ctx context.Context, name string, sync LimitRangeHandlerFunc)
|
||||
AddLifecycle(ctx context.Context, name string, lifecycle LimitRangeLifecycle)
|
||||
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync LimitRangeHandlerFunc)
|
||||
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle LimitRangeLifecycle)
|
||||
}
|
||||
|
||||
type limitRangeLister struct {
|
||||
controller *limitRangeController
|
||||
}
|
||||
|
||||
func (l *limitRangeLister) List(namespace string, selector labels.Selector) (ret []*v1.LimitRange, err error) {
|
||||
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
|
||||
ret = append(ret, obj.(*v1.LimitRange))
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (l *limitRangeLister) Get(namespace, name string) (*v1.LimitRange, 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: LimitRangeGroupVersionKind.Group,
|
||||
Resource: "limitRange",
|
||||
}, key)
|
||||
}
|
||||
return obj.(*v1.LimitRange), nil
|
||||
}
|
||||
|
||||
type limitRangeController struct {
|
||||
controller.GenericController
|
||||
}
|
||||
|
||||
func (c *limitRangeController) Generic() controller.GenericController {
|
||||
return c.GenericController
|
||||
}
|
||||
|
||||
func (c *limitRangeController) Lister() LimitRangeLister {
|
||||
return &limitRangeLister{
|
||||
controller: c,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *limitRangeController) AddHandler(ctx context.Context, name string, handler LimitRangeHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*v1.LimitRange); ok {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func (c *limitRangeController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler LimitRangeHandlerFunc) {
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
} else if v, ok := obj.(*v1.LimitRange); ok && controller.ObjectInCluster(cluster, obj) {
|
||||
return handler(key, v)
|
||||
} else {
|
||||
return nil, nil
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
type limitRangeFactory struct {
|
||||
}
|
||||
|
||||
func (c limitRangeFactory) Object() runtime.Object {
|
||||
return &v1.LimitRange{}
|
||||
}
|
||||
|
||||
func (c limitRangeFactory) List() runtime.Object {
|
||||
return &LimitRangeList{}
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Controller() LimitRangeController {
|
||||
s.client.Lock()
|
||||
defer s.client.Unlock()
|
||||
|
||||
c, ok := s.client.limitRangeControllers[s.ns]
|
||||
if ok {
|
||||
return c
|
||||
}
|
||||
|
||||
genericController := controller.NewGenericController(LimitRangeGroupVersionKind.Kind+"Controller",
|
||||
s.objectClient)
|
||||
|
||||
c = &limitRangeController{
|
||||
GenericController: genericController,
|
||||
}
|
||||
|
||||
s.client.limitRangeControllers[s.ns] = c
|
||||
s.client.starters = append(s.client.starters, c)
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
type limitRangeClient struct {
|
||||
client *Client
|
||||
ns string
|
||||
objectClient *objectclient.ObjectClient
|
||||
controller LimitRangeController
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) ObjectClient() *objectclient.ObjectClient {
|
||||
return s.objectClient
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Create(o *v1.LimitRange) (*v1.LimitRange, error) {
|
||||
obj, err := s.objectClient.Create(o)
|
||||
return obj.(*v1.LimitRange), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Get(name string, opts metav1.GetOptions) (*v1.LimitRange, error) {
|
||||
obj, err := s.objectClient.Get(name, opts)
|
||||
return obj.(*v1.LimitRange), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*v1.LimitRange, error) {
|
||||
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
|
||||
return obj.(*v1.LimitRange), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Update(o *v1.LimitRange) (*v1.LimitRange, error) {
|
||||
obj, err := s.objectClient.Update(o.Name, o)
|
||||
return obj.(*v1.LimitRange), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Delete(name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.Delete(name, options)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return s.objectClient.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) List(opts metav1.ListOptions) (*LimitRangeList, error) {
|
||||
obj, err := s.objectClient.List(opts)
|
||||
return obj.(*LimitRangeList), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return s.objectClient.Watch(opts)
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (s *limitRangeClient) Patch(o *v1.LimitRange, patchType types.PatchType, data []byte, subresources ...string) (*v1.LimitRange, error) {
|
||||
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
|
||||
return obj.(*v1.LimitRange), err
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
|
||||
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) AddHandler(ctx context.Context, name string, sync LimitRangeHandlerFunc) {
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) AddLifecycle(ctx context.Context, name string, lifecycle LimitRangeLifecycle) {
|
||||
sync := NewLimitRangeLifecycleAdapter(name, false, s, lifecycle)
|
||||
s.Controller().AddHandler(ctx, name, sync)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync LimitRangeHandlerFunc) {
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
func (s *limitRangeClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle LimitRangeLifecycle) {
|
||||
sync := NewLimitRangeLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
|
||||
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
|
||||
}
|
||||
|
||||
type LimitRangeIndexer func(obj *v1.LimitRange) ([]string, error)
|
||||
|
||||
type LimitRangeClientCache interface {
|
||||
Get(namespace, name string) (*v1.LimitRange, error)
|
||||
List(namespace string, selector labels.Selector) ([]*v1.LimitRange, error)
|
||||
|
||||
Index(name string, indexer LimitRangeIndexer)
|
||||
GetIndexed(name, key string) ([]*v1.LimitRange, error)
|
||||
}
|
||||
|
||||
type LimitRangeClient interface {
|
||||
Create(*v1.LimitRange) (*v1.LimitRange, error)
|
||||
Get(namespace, name string, opts metav1.GetOptions) (*v1.LimitRange, error)
|
||||
Update(*v1.LimitRange) (*v1.LimitRange, error)
|
||||
Delete(namespace, name string, options *metav1.DeleteOptions) error
|
||||
List(namespace string, opts metav1.ListOptions) (*LimitRangeList, error)
|
||||
Watch(opts metav1.ListOptions) (watch.Interface, error)
|
||||
|
||||
Cache() LimitRangeClientCache
|
||||
|
||||
OnCreate(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc)
|
||||
OnChange(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc)
|
||||
OnRemove(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc)
|
||||
Enqueue(namespace, name string)
|
||||
|
||||
Generic() controller.GenericController
|
||||
ObjectClient() *objectclient.ObjectClient
|
||||
Interface() LimitRangeInterface
|
||||
}
|
||||
|
||||
type limitRangeClientCache struct {
|
||||
client *limitRangeClient2
|
||||
}
|
||||
|
||||
type limitRangeClient2 struct {
|
||||
iface LimitRangeInterface
|
||||
controller LimitRangeController
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Interface() LimitRangeInterface {
|
||||
return n.iface
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Generic() controller.GenericController {
|
||||
return n.iface.Controller().Generic()
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) ObjectClient() *objectclient.ObjectClient {
|
||||
return n.Interface().ObjectClient()
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Enqueue(namespace, name string) {
|
||||
n.iface.Controller().Enqueue(namespace, name)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Create(obj *v1.LimitRange) (*v1.LimitRange, error) {
|
||||
return n.iface.Create(obj)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Get(namespace, name string, opts metav1.GetOptions) (*v1.LimitRange, error) {
|
||||
return n.iface.GetNamespaced(namespace, name, opts)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Update(obj *v1.LimitRange) (*v1.LimitRange, error) {
|
||||
return n.iface.Update(obj)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
|
||||
return n.iface.DeleteNamespaced(namespace, name, options)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) List(namespace string, opts metav1.ListOptions) (*LimitRangeList, error) {
|
||||
return n.iface.List(opts)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
|
||||
return n.iface.Watch(opts)
|
||||
}
|
||||
|
||||
func (n *limitRangeClientCache) Get(namespace, name string) (*v1.LimitRange, error) {
|
||||
return n.client.controller.Lister().Get(namespace, name)
|
||||
}
|
||||
|
||||
func (n *limitRangeClientCache) List(namespace string, selector labels.Selector) ([]*v1.LimitRange, error) {
|
||||
return n.client.controller.Lister().List(namespace, selector)
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) Cache() LimitRangeClientCache {
|
||||
n.loadController()
|
||||
return &limitRangeClientCache{
|
||||
client: n,
|
||||
}
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) OnCreate(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-create", &limitRangeLifecycleDelegate{create: sync})
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) OnChange(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name+"-change", &limitRangeLifecycleDelegate{update: sync})
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) OnRemove(ctx context.Context, name string, sync LimitRangeChangeHandlerFunc) {
|
||||
n.loadController()
|
||||
n.iface.AddLifecycle(ctx, name, &limitRangeLifecycleDelegate{remove: sync})
|
||||
}
|
||||
|
||||
func (n *limitRangeClientCache) Index(name string, indexer LimitRangeIndexer) {
|
||||
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
|
||||
name: func(obj interface{}) ([]string, error) {
|
||||
if v, ok := obj.(*v1.LimitRange); ok {
|
||||
return indexer(v)
|
||||
}
|
||||
return nil, nil
|
||||
},
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func (n *limitRangeClientCache) GetIndexed(name, key string) ([]*v1.LimitRange, error) {
|
||||
var result []*v1.LimitRange
|
||||
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
for _, obj := range objs {
|
||||
if v, ok := obj.(*v1.LimitRange); ok {
|
||||
result = append(result, v)
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (n *limitRangeClient2) loadController() {
|
||||
if n.controller == nil {
|
||||
n.controller = n.iface.Controller()
|
||||
}
|
||||
}
|
||||
|
||||
type limitRangeLifecycleDelegate struct {
|
||||
create LimitRangeChangeHandlerFunc
|
||||
update LimitRangeChangeHandlerFunc
|
||||
remove LimitRangeChangeHandlerFunc
|
||||
}
|
||||
|
||||
func (n *limitRangeLifecycleDelegate) HasCreate() bool {
|
||||
return n.create != nil
|
||||
}
|
||||
|
||||
func (n *limitRangeLifecycleDelegate) Create(obj *v1.LimitRange) (runtime.Object, error) {
|
||||
if n.create == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.create(obj)
|
||||
}
|
||||
|
||||
func (n *limitRangeLifecycleDelegate) HasFinalize() bool {
|
||||
return n.remove != nil
|
||||
}
|
||||
|
||||
func (n *limitRangeLifecycleDelegate) Remove(obj *v1.LimitRange) (runtime.Object, error) {
|
||||
if n.remove == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.remove(obj)
|
||||
}
|
||||
|
||||
func (n *limitRangeLifecycleDelegate) Updated(obj *v1.LimitRange) (runtime.Object, error) {
|
||||
if n.update == nil {
|
||||
return obj, nil
|
||||
}
|
||||
return n.update(obj)
|
||||
}
|
63
apis/core/v1/zz_generated_limit_range_lifecycle_adapter.go
Normal file
63
apis/core/v1/zz_generated_limit_range_lifecycle_adapter.go
Normal file
@ -0,0 +1,63 @@
|
||||
package v1
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"k8s.io/api/core/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
type LimitRangeLifecycle interface {
|
||||
Create(obj *v1.LimitRange) (runtime.Object, error)
|
||||
Remove(obj *v1.LimitRange) (runtime.Object, error)
|
||||
Updated(obj *v1.LimitRange) (runtime.Object, error)
|
||||
}
|
||||
|
||||
type limitRangeLifecycleAdapter struct {
|
||||
lifecycle LimitRangeLifecycle
|
||||
}
|
||||
|
||||
func (w *limitRangeLifecycleAdapter) HasCreate() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasCreate()
|
||||
}
|
||||
|
||||
func (w *limitRangeLifecycleAdapter) HasFinalize() bool {
|
||||
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
|
||||
return !ok || o.HasFinalize()
|
||||
}
|
||||
|
||||
func (w *limitRangeLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Create(obj.(*v1.LimitRange))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *limitRangeLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Remove(obj.(*v1.LimitRange))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func (w *limitRangeLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
|
||||
o, err := w.lifecycle.Updated(obj.(*v1.LimitRange))
|
||||
if o == nil {
|
||||
return nil, err
|
||||
}
|
||||
return o, err
|
||||
}
|
||||
|
||||
func NewLimitRangeLifecycleAdapter(name string, clusterScoped bool, client LimitRangeInterface, l LimitRangeLifecycle) LimitRangeHandlerFunc {
|
||||
adapter := &limitRangeLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1.LimitRange) (runtime.Object, error) {
|
||||
newObj, err := syncFn(key, obj)
|
||||
if o, ok := newObj.(runtime.Object); ok {
|
||||
return o, err
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
}
|
@ -46,6 +46,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
&ServiceAccountList{},
|
||||
&ReplicationControllerList{},
|
||||
&ResourceQuotaList{},
|
||||
&LimitRangeList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
@ -4419,9 +4419,7 @@ func (in *MultiClusterAppStatus) DeepCopyInto(out *MultiClusterAppStatus) {
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]projectcattleiov3.AppCondition, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
16
client/cluster/v3/zz_generated_container_resource_limit.go
Normal file
16
client/cluster/v3/zz_generated_container_resource_limit.go
Normal file
@ -0,0 +1,16 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ContainerResourceLimitType = "containerResourceLimit"
|
||||
ContainerResourceLimitFieldLimitsCPU = "limitsCpu"
|
||||
ContainerResourceLimitFieldLimitsMemory = "limitsMemory"
|
||||
ContainerResourceLimitFieldRequestsCPU = "requestsCpu"
|
||||
ContainerResourceLimitFieldRequestsMemory = "requestsMemory"
|
||||
)
|
||||
|
||||
type ContainerResourceLimit struct {
|
||||
LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"`
|
||||
LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"`
|
||||
RequestsCPU string `json:"requestsCpu,omitempty" yaml:"requestsCpu,omitempty"`
|
||||
RequestsMemory string `json:"requestsMemory,omitempty" yaml:"requestsMemory,omitempty"`
|
||||
}
|
@ -5,39 +5,41 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
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"
|
||||
NamespaceType = "namespace"
|
||||
NamespaceFieldAnnotations = "annotations"
|
||||
NamespaceFieldContainerDefaultResourceLimit = "containerDefaultResourceLimit"
|
||||
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"`
|
||||
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"`
|
||||
Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
|
||||
ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty" yaml:"containerDefaultResourceLimit,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 {
|
||||
|
@ -0,0 +1,16 @@
|
||||
package client
|
||||
|
||||
const (
|
||||
ContainerResourceLimitType = "containerResourceLimit"
|
||||
ContainerResourceLimitFieldLimitsCPU = "limitsCpu"
|
||||
ContainerResourceLimitFieldLimitsMemory = "limitsMemory"
|
||||
ContainerResourceLimitFieldRequestsCPU = "requestsCpu"
|
||||
ContainerResourceLimitFieldRequestsMemory = "requestsMemory"
|
||||
)
|
||||
|
||||
type ContainerResourceLimit struct {
|
||||
LimitsCPU string `json:"limitsCpu,omitempty" yaml:"limitsCpu,omitempty"`
|
||||
LimitsMemory string `json:"limitsMemory,omitempty" yaml:"limitsMemory,omitempty"`
|
||||
RequestsCPU string `json:"requestsCpu,omitempty" yaml:"requestsCpu,omitempty"`
|
||||
RequestsMemory string `json:"requestsMemory,omitempty" yaml:"requestsMemory,omitempty"`
|
||||
}
|
@ -9,6 +9,7 @@ const (
|
||||
ProjectFieldAnnotations = "annotations"
|
||||
ProjectFieldClusterID = "clusterId"
|
||||
ProjectFieldConditions = "conditions"
|
||||
ProjectFieldContainerDefaultResourceLimit = "containerDefaultResourceLimit"
|
||||
ProjectFieldCreated = "created"
|
||||
ProjectFieldCreatorID = "creatorId"
|
||||
ProjectFieldDescription = "description"
|
||||
@ -33,6 +34,7 @@ type Project struct {
|
||||
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"`
|
||||
ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty" yaml:"containerDefaultResourceLimit,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"`
|
||||
|
@ -3,6 +3,7 @@ package client
|
||||
const (
|
||||
ProjectSpecType = "projectSpec"
|
||||
ProjectSpecFieldClusterID = "clusterId"
|
||||
ProjectSpecFieldContainerDefaultResourceLimit = "containerDefaultResourceLimit"
|
||||
ProjectSpecFieldDescription = "description"
|
||||
ProjectSpecFieldDisplayName = "displayName"
|
||||
ProjectSpecFieldEnableProjectMonitoring = "enableProjectMonitoring"
|
||||
@ -12,6 +13,7 @@ const (
|
||||
|
||||
type ProjectSpec struct {
|
||||
ClusterID string `json:"clusterId,omitempty" yaml:"clusterId,omitempty"`
|
||||
ContainerDefaultResourceLimit *ContainerResourceLimit `json:"containerDefaultResourceLimit,omitempty" yaml:"containerDefaultResourceLimit,omitempty"`
|
||||
Description string `json:"description,omitempty" yaml:"description,omitempty"`
|
||||
DisplayName string `json:"displayName,omitempty" yaml:"displayName,omitempty"`
|
||||
EnableProjectMonitoring bool `json:"enableProjectMonitoring,omitempty" yaml:"enableProjectMonitoring,omitempty"`
|
||||
|
Loading…
Reference in New Issue
Block a user