1
0
mirror of https://github.com/rancher/types.git synced 2025-09-27 21:15:04 +00:00

Generate types

This commit is contained in:
Dax McDonald
2019-08-16 16:46:31 -07:00
committed by Craig Jellick
parent 8daa5dae5d
commit cf412afc1a
218 changed files with 436 additions and 109 deletions

View File

@@ -151,7 +151,6 @@ func (c *daemonSetController) AddHandler(ctx context.Context, name string, handl
}
func (c *daemonSetController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler DaemonSetHandlerFunc) {
resource.PutClusterScoped(DaemonSetGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)

View File

@@ -2,6 +2,7 @@ package v1beta2
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/api/apps/v1beta2"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -51,6 +52,9 @@ func (w *daemonSetLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object,
}
func NewDaemonSetLifecycleAdapter(name string, clusterScoped bool, client DaemonSetInterface, l DaemonSetLifecycle) DaemonSetHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(DaemonSetGroupVersionResource)
}
adapter := &daemonSetLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1beta2.DaemonSet) (runtime.Object, error) {

View File

@@ -151,7 +151,6 @@ func (c *deploymentController) AddHandler(ctx context.Context, name string, hand
}
func (c *deploymentController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler DeploymentHandlerFunc) {
resource.PutClusterScoped(DeploymentGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)

View File

@@ -2,6 +2,7 @@ package v1beta2
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/api/apps/v1beta2"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -51,6 +52,9 @@ func (w *deploymentLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object
}
func NewDeploymentLifecycleAdapter(name string, clusterScoped bool, client DeploymentInterface, l DeploymentLifecycle) DeploymentHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(DeploymentGroupVersionResource)
}
adapter := &deploymentLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1beta2.Deployment) (runtime.Object, error) {

View File

@@ -151,7 +151,6 @@ func (c *replicaSetController) AddHandler(ctx context.Context, name string, hand
}
func (c *replicaSetController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ReplicaSetHandlerFunc) {
resource.PutClusterScoped(ReplicaSetGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)

View File

@@ -2,6 +2,7 @@ package v1beta2
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/api/apps/v1beta2"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -51,6 +52,9 @@ func (w *replicaSetLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object
}
func NewReplicaSetLifecycleAdapter(name string, clusterScoped bool, client ReplicaSetInterface, l ReplicaSetLifecycle) ReplicaSetHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(ReplicaSetGroupVersionResource)
}
adapter := &replicaSetLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1beta2.ReplicaSet) (runtime.Object, error) {

View File

@@ -151,7 +151,6 @@ func (c *statefulSetController) AddHandler(ctx context.Context, name string, han
}
func (c *statefulSetController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler StatefulSetHandlerFunc) {
resource.PutClusterScoped(StatefulSetGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)

View File

@@ -2,6 +2,7 @@ package v1beta2
import (
"github.com/rancher/norman/lifecycle"
"github.com/rancher/norman/resource"
"k8s.io/api/apps/v1beta2"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -51,6 +52,9 @@ func (w *statefulSetLifecycleAdapter) Updated(obj runtime.Object) (runtime.Objec
}
func NewStatefulSetLifecycleAdapter(name string, clusterScoped bool, client StatefulSetInterface, l StatefulSetLifecycle) StatefulSetHandlerFunc {
if clusterScoped {
resource.PutClusterScoped(StatefulSetGroupVersionResource)
}
adapter := &statefulSetLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *v1beta2.StatefulSet) (runtime.Object, error) {