1
0
mirror of https://github.com/rancher/types.git synced 2025-09-25 12:21:24 +00:00

Update generated code for PutClusterScoped function

This commit is contained in:
Dax McDonald
2019-08-21 17:11:58 -07:00
committed by Craig Jellick
parent b61d0733a3
commit d8f2cacb8d
244 changed files with 488 additions and 244 deletions

View File

@@ -170,7 +170,6 @@ func (c *apiServiceController) AddFeatureHandler(ctx context.Context, enabled fu
}
func (c *apiServiceController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler APIServiceHandlerFunc) {
resource.PutClusterScoped(APIServiceGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)
@@ -183,7 +182,6 @@ func (c *apiServiceController) AddClusterScopedHandler(ctx context.Context, name
}
func (c *apiServiceController) AddClusterScopedFeatureHandler(ctx context.Context, enabled func() bool, name, cluster string, handler APIServiceHandlerFunc) {
resource.PutClusterScoped(APIServiceGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if !enabled() {
return nil, nil

View File

@@ -2,6 +2,7 @@ package v1
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/apimachinery/pkg/runtime"
v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
)
@@ -51,6 +52,9 @@ func (w *apiServiceLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object
}
func NewAPIServiceLifecycleAdapter(name string, clusterScoped bool, client APIServiceInterface, l APIServiceLifecycle) APIServiceHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(APIServiceGroupVersionResource)
}
adapter := &apiServiceLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1.APIService) (runtime.Object, error) {