mirror of
https://github.com/rancher/norman.git
synced 2025-08-31 14:51:57 +00:00
Remove PutClusterScoped from controllers
This commit is contained in:
@@ -177,7 +177,6 @@ func (c *{{.schema.ID}}Controller) AddFeatureHandler(ctx context.Context, enable
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *{{.schema.ID}}Controller) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler {{.schema.CodeName}}HandlerFunc) {
|
func (c *{{.schema.ID}}Controller) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler {{.schema.CodeName}}HandlerFunc) {
|
||||||
resource.PutClusterScoped({{.schema.CodeName}}GroupVersionResource)
|
|
||||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return handler(key, nil)
|
return handler(key, nil)
|
||||||
@@ -190,7 +189,6 @@ func (c *{{.schema.ID}}Controller) AddClusterScopedHandler(ctx context.Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *{{.schema.ID}}Controller) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler {{.schema.CodeName}}HandlerFunc) {
|
func (c *{{.schema.ID}}Controller) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler {{.schema.CodeName}}HandlerFunc) {
|
||||||
resource.PutClusterScoped({{.schema.CodeName}}GroupVersionResource)
|
|
||||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||||
if !enabled() {
|
if !enabled() {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
Reference in New Issue
Block a user