mirror of
https://github.com/rancher/types.git
synced 2025-09-17 07:19:17 +00:00
Update generated code for PutClusterScoped function
This commit is contained in:
committed by
Craig Jellick
parent
b61d0733a3
commit
d8f2cacb8d
@@ -170,7 +170,6 @@ func (c *clusterAuthTokenController) AddFeatureHandler(ctx context.Context, enab
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterAuthTokenHandlerFunc) {
|
||||
resource.PutClusterScoped(ClusterAuthTokenGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
@@ -183,7 +182,6 @@ func (c *clusterAuthTokenController) AddClusterScopedHandler(ctx context.Context
|
||||
}
|
||||
|
||||
func (c *clusterAuthTokenController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterAuthTokenHandlerFunc) {
|
||||
resource.PutClusterScoped(ClusterAuthTokenGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
|
@@ -2,6 +2,7 @@ package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -50,6 +51,9 @@ func (w *clusterAuthTokenLifecycleAdapter) Updated(obj runtime.Object) (runtime.
|
||||
}
|
||||
|
||||
func NewClusterAuthTokenLifecycleAdapter(name string, clusterScoped bool, client ClusterAuthTokenInterface, l ClusterAuthTokenLifecycle) ClusterAuthTokenHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(ClusterAuthTokenGroupVersionResource)
|
||||
}
|
||||
adapter := &clusterAuthTokenLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterAuthToken) (runtime.Object, error) {
|
||||
|
@@ -170,7 +170,6 @@ func (c *clusterUserAttributeController) AddFeatureHandler(ctx context.Context,
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterUserAttributeHandlerFunc) {
|
||||
resource.PutClusterScoped(ClusterUserAttributeGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
@@ -183,7 +182,6 @@ func (c *clusterUserAttributeController) AddClusterScopedHandler(ctx context.Con
|
||||
}
|
||||
|
||||
func (c *clusterUserAttributeController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler ClusterUserAttributeHandlerFunc) {
|
||||
resource.PutClusterScoped(ClusterUserAttributeGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
|
@@ -2,6 +2,7 @@ package v3
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -50,6 +51,9 @@ func (w *clusterUserAttributeLifecycleAdapter) Updated(obj runtime.Object) (runt
|
||||
}
|
||||
|
||||
func NewClusterUserAttributeLifecycleAdapter(name string, clusterScoped bool, client ClusterUserAttributeInterface, l ClusterUserAttributeLifecycle) ClusterUserAttributeHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(ClusterUserAttributeGroupVersionResource)
|
||||
}
|
||||
adapter := &clusterUserAttributeLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *ClusterUserAttribute) (runtime.Object, error) {
|
||||
|
Reference in New Issue
Block a user