1
0
mirror of https://github.com/rancher/types.git synced 2025-09-01 21:32:10 +00:00

Updated generated code

This commit is contained in:
Darren Shepherd
2017-12-05 09:32:54 -07:00
parent 5579f880d0
commit 00384d0e99
282 changed files with 1674 additions and 1280 deletions

View File

@@ -0,0 +1,40 @@
package v1beta2
import (
"github.com/rancher/norman/lifecycle"
"k8s.io/api/apps/v1beta2"
"k8s.io/apimachinery/pkg/runtime"
)
type DeploymentLifecycle interface {
Initialize(obj *v1beta2.Deployment) error
Remove(obj *v1beta2.Deployment) error
Updated(obj *v1beta2.Deployment) error
}
type deploymentLifecycleAdapter struct {
lifecycle DeploymentLifecycle
}
func (w *deploymentLifecycleAdapter) Initialize(obj runtime.Object) error {
return w.lifecycle.Initialize(obj.(*v1beta2.Deployment))
}
func (w *deploymentLifecycleAdapter) Finalize(obj runtime.Object) error {
return w.lifecycle.Remove(obj.(*v1beta2.Deployment))
}
func (w *deploymentLifecycleAdapter) Updated(obj runtime.Object) error {
return w.lifecycle.Updated(obj.(*v1beta2.Deployment))
}
func NewDeploymentLifecycleAdapter(name string, client DeploymentInterface, l DeploymentLifecycle) DeploymentHandlerFunc {
adapter := &deploymentLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, adapter, client.ObjectClient())
return func(key string, obj *v1beta2.Deployment) error {
if obj == nil {
return syncFn(key, nil)
}
return syncFn(key, obj)
}
}