mirror of
https://github.com/rancher/norman.git
synced 2025-08-30 13:28:48 +00:00
Remove PutClusterScoped from controllers
This commit is contained in:
parent
88a4fa4f24
commit
1fff189de5
@ -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) {
|
||||
resource.PutClusterScoped({{.schema.CodeName}}GroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == 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) {
|
||||
resource.PutClusterScoped({{.schema.CodeName}}GroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if !enabled() {
|
||||
return nil, nil
|
||||
|
Loading…
Reference in New Issue
Block a user