1
0
mirror of https://github.com/rancher/norman.git synced 2025-08-30 04:35:00 +00:00

Remove PutClusterScoped from controllers

This commit is contained in:
Dax McDonald 2019-08-16 12:11:24 -07:00
parent 88a4fa4f24
commit 1fff189de5

View File

@ -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