mirror of
https://github.com/rancher/types.git
synced 2025-09-01 05:09:10 +00:00
Update vendor
This commit is contained in:
committed by
Craig Jellick
parent
b4a31197d6
commit
b61d0733a3
2
vendor/github.com/rancher/norman/generator/controller_template.go
generated
vendored
2
vendor/github.com/rancher/norman/generator/controller_template.go
generated
vendored
@@ -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
|
||||
|
4
vendor/github.com/rancher/norman/generator/lifecycle_template.go
generated
vendored
4
vendor/github.com/rancher/norman/generator/lifecycle_template.go
generated
vendored
@@ -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) {
|
||||
|
Reference in New Issue
Block a user