mirror of
https://github.com/rancher/types.git
synced 2025-09-27 05:03:01 +00:00
Generate types
This commit is contained in:
committed by
Craig Jellick
parent
8daa5dae5d
commit
cf412afc1a
@@ -151,7 +151,6 @@ func (c *ingressController) AddHandler(ctx context.Context, name string, handler
|
||||
}
|
||||
|
||||
func (c *ingressController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler IngressHandlerFunc) {
|
||||
resource.PutClusterScoped(IngressGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
|
@@ -2,6 +2,7 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@@ -51,6 +52,9 @@ func (w *ingressLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, e
|
||||
}
|
||||
|
||||
func NewIngressLifecycleAdapter(name string, clusterScoped bool, client IngressInterface, l IngressLifecycle) IngressHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(IngressGroupVersionResource)
|
||||
}
|
||||
adapter := &ingressLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1beta1.Ingress) (runtime.Object, error) {
|
||||
|
@@ -150,7 +150,6 @@ func (c *podSecurityPolicyController) AddHandler(ctx context.Context, name strin
|
||||
}
|
||||
|
||||
func (c *podSecurityPolicyController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler PodSecurityPolicyHandlerFunc) {
|
||||
resource.PutClusterScoped(PodSecurityPolicyGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
|
@@ -2,6 +2,7 @@ package v1beta1
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"github.com/rancher/norman/resource"
|
||||
"k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@@ -51,6 +52,9 @@ func (w *podSecurityPolicyLifecycleAdapter) Updated(obj runtime.Object) (runtime
|
||||
}
|
||||
|
||||
func NewPodSecurityPolicyLifecycleAdapter(name string, clusterScoped bool, client PodSecurityPolicyInterface, l PodSecurityPolicyLifecycle) PodSecurityPolicyHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(PodSecurityPolicyGroupVersionResource)
|
||||
}
|
||||
adapter := &podSecurityPolicyLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1beta1.PodSecurityPolicy) (runtime.Object, error) {
|
||||
|
Reference in New Issue
Block a user