mirror of
https://github.com/rancher/types.git
synced 2025-09-26 20:52:57 +00:00
Generate types
This commit is contained in:
committed by
Craig Jellick
parent
8daa5dae5d
commit
cf412afc1a
@@ -151,7 +151,6 @@ func (c *jobController) AddHandler(ctx context.Context, name string, handler Job
|
||||
}
|
||||
|
||||
func (c *jobController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler JobHandlerFunc) {
|
||||
resource.PutClusterScoped(JobGroupVersionResource)
|
||||
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
|
||||
if obj == nil {
|
||||
return handler(key, nil)
|
||||
|
@@ -2,6 +2,7 @@ package v1
|
||||
|
||||
import (
|
||||
"github.com/rancher/norman/lifecycle"
|
||||
"github.com/rancher/norman/resource"
|
||||
v1 "k8s.io/api/batch/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@@ -51,6 +52,9 @@ func (w *jobLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error
|
||||
}
|
||||
|
||||
func NewJobLifecycleAdapter(name string, clusterScoped bool, client JobInterface, l JobLifecycle) JobHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(JobGroupVersionResource)
|
||||
}
|
||||
adapter := &jobLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1.Job) (runtime.Object, error) {
|
||||
|
@@ -151,7 +151,6 @@ func (c *cronJobController) AddHandler(ctx context.Context, name string, handler
|
||||
}
|
||||
|
||||
func (c *cronJobController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler CronJobHandlerFunc) {
|
||||
resource.PutClusterScoped(CronJobGroupVersionResource)
|
||||
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/batch/v1beta1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
@@ -51,6 +52,9 @@ func (w *cronJobLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, e
|
||||
}
|
||||
|
||||
func NewCronJobLifecycleAdapter(name string, clusterScoped bool, client CronJobInterface, l CronJobLifecycle) CronJobHandlerFunc {
|
||||
if clusterScoped {
|
||||
resource.PutClusterScoped(CronJobGroupVersionResource)
|
||||
}
|
||||
adapter := &cronJobLifecycleAdapter{lifecycle: l}
|
||||
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
|
||||
return func(key string, obj *v1beta1.CronJob) (runtime.Object, error) {
|
||||
|
Reference in New Issue
Block a user