From 8daa5dae5d2a453bce651fc1353e67e534f5439c Mon Sep 17 00:00:00 2001 From: Dax McDonald Date: Fri, 16 Aug 2019 16:39:40 -0700 Subject: [PATCH] Update vendor for norman changes --- vendor.conf | 2 +- .../rancher/norman/generator/controller_template.go | 1 - .../github.com/rancher/norman/generator/lifecycle_template.go | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/vendor.conf b/vendor.conf index da670f7c..83118304 100644 --- a/vendor.conf +++ b/vendor.conf @@ -2,5 +2,5 @@ github.com/rancher/types github.com/pkg/errors v0.8.0 -github.com/rancher/norman c96ac0ef2eee72c159e014750436343afc4e0bbd transitive=true +github.com/rancher/norman 659cceabaf2ace35ea6f6721f4993d1d04f0bd80 transitive=true github.com/coreos/prometheus-operator v0.25.0 diff --git a/vendor/github.com/rancher/norman/generator/controller_template.go b/vendor/github.com/rancher/norman/generator/controller_template.go index 6bdc8a97..db33d34e 100644 --- a/vendor/github.com/rancher/norman/generator/controller_template.go +++ b/vendor/github.com/rancher/norman/generator/controller_template.go @@ -157,7 +157,6 @@ func (c *{{.schema.ID}}Controller) AddHandler(ctx context.Context, name string, } 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) diff --git a/vendor/github.com/rancher/norman/generator/lifecycle_template.go b/vendor/github.com/rancher/norman/generator/lifecycle_template.go index d0a6cf54..9820d1c2 100644 --- a/vendor/github.com/rancher/norman/generator/lifecycle_template.go +++ b/vendor/github.com/rancher/norman/generator/lifecycle_template.go @@ -7,6 +7,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "github.com/rancher/norman/controller" "github.com/rancher/norman/lifecycle" + "github.com/rancher/norman/resource" ) type {{.schema.CodeName}}Lifecycle interface { @@ -54,6 +55,9 @@ func (w *{{.schema.ID}}LifecycleAdapter) Updated(obj runtime.Object) (runtime.Ob } func New{{.schema.CodeName}}LifecycleAdapter(name string, clusterScoped bool, client {{.schema.CodeName}}Interface, l {{.schema.CodeName}}Lifecycle) {{.schema.CodeName}}HandlerFunc { + if clusterScoped { + resource.PutClusterScoped({{.schema.CodeName}}GroupVersionResource) + } adapter := &{{.schema.ID}}LifecycleAdapter{lifecycle: l} syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient()) return func(key string, obj *{{.prefix}}{{.schema.CodeName}}) (runtime.Object, error) {