func GetTemplateMetaObject(obj runtime.Object) (metav1.Object, bool) {
	switch r := obj.(type) {

	case *corev1.PodTemplate:
		return &r.Template.ObjectMeta, true

	case *corev1.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.ObjectMeta, true
		}

	case *extensionsv1beta1.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true

	case *extensionsv1beta1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.Deployment:
		return &r.Spec.Template.ObjectMeta, true

	case *extensionsv1beta1.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true

	case *batchv1.Job:
		return &r.Spec.Template.ObjectMeta, true

	case *batchv2alpha1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true
	case *batchv1beta1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true

	case *batchv2alpha1.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true
	case *batchv1beta1.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true

	case *kappsv1.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta1.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true

	case *core.PodTemplate:
		return &r.Template.ObjectMeta, true
	case *core.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.ObjectMeta, true
		}
	case *apps.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *apps.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *apps.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *batch.Job:
		return &r.Spec.Template.ObjectMeta, true
	case *batch.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true
	case *batch.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true
	case *apps.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	}
	return nil, false
}
// GetTemplateMetaObject returns a mutable metav1.Object interface for the template
// the object contains, or false if no such object is available.
GetTemplateMetaObject returns a mutable metav1.Object interface for the template
the object contains, or false if no such object is available.
// GetTemplateMetaObject returns a mutable metav1 . Object interface for the template // the object contains or false if no such object is available .
func GetTemplateMetaObject(obj runtime.Object) (metav1.Object, bool) {
	switch r := obj.(type) {
	case *corev1.PodTemplate:
		return &r.Template.ObjectMeta, true
	case *corev1.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.ObjectMeta, true
		}
	case *extensionsv1beta1.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *extensionsv1beta1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta1.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *extensionsv1beta1.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *batchv1.Job:
		return &r.Spec.Template.ObjectMeta, true
	case *batchv2alpha1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true
	case *batchv1beta1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true
	case *batchv2alpha1.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true
	case *batchv1beta1.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true
	case *kappsv1.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta1.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	case *kappsv1beta2.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	case *core.PodTemplate:
		return &r.Template.ObjectMeta, true
	case *core.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.ObjectMeta, true
		}
	case *apps.DaemonSet:
		return &r.Spec.Template.ObjectMeta, true
	case *apps.Deployment:
		return &r.Spec.Template.ObjectMeta, true
	case *apps.ReplicaSet:
		return &r.Spec.Template.ObjectMeta, true
	case *batch.Job:
		return &r.Spec.Template.ObjectMeta, true
	case *batch.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.ObjectMeta, true
	case *batch.JobTemplate:
		return &r.Template.Spec.Template.ObjectMeta, true
	case *apps.StatefulSet:
		return &r.Spec.Template.ObjectMeta, true
	}
	return nil, false
}
func GetTemplateMetaObject ( obj runtime . Object ) ( metav1 . Object , bool ) { switch r := obj . ( type ) { case * corev1 . PodTemplate : return & r . Template . ObjectMeta , true case * corev1 . ReplicationController : if r . Spec . Template != nil { return & r . Spec . Template . ObjectMeta , true } case * extensionsv1beta1 . DaemonSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1 . DaemonSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta2 . DaemonSet : return & r . Spec . Template . ObjectMeta , true case * extensionsv1beta1 . Deployment : return & r . Spec . Template . ObjectMeta , true case * kappsv1 . Deployment : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta1 . Deployment : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta2 . Deployment : return & r . Spec . Template . ObjectMeta , true case * extensionsv1beta1 . ReplicaSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1 . ReplicaSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta2 . ReplicaSet : return & r . Spec . Template . ObjectMeta , true case * batchv1 . Job : return & r . Spec . Template . ObjectMeta , true case * batchv2alpha1 . CronJob : return & r . Spec . JobTemplate . Spec . Template . ObjectMeta , true case * batchv1beta1 . CronJob : return & r . Spec . JobTemplate . Spec . Template . ObjectMeta , true case * batchv2alpha1 . JobTemplate : return & r . Template . Spec . Template . ObjectMeta , true case * batchv1beta1 . JobTemplate : return & r . Template . Spec . Template . ObjectMeta , true case * kappsv1 . StatefulSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta1 . StatefulSet : return & r . Spec . Template . ObjectMeta , true case * kappsv1beta2 . StatefulSet : return & r . Spec . Template . ObjectMeta , true case * core . PodTemplate : return & r . Template . ObjectMeta , true case * core . ReplicationController : if r . Spec . Template != nil { return & r . Spec . Template . ObjectMeta , true } case * apps . DaemonSet : return & r . Spec . Template . ObjectMeta , true case * apps . Deployment : return & r . Spec . Template . ObjectMeta , true case * apps . ReplicaSet : return & r . Spec . Template . ObjectMeta , true case * batch . Job : return & r . Spec . Template . ObjectMeta , true case * batch . CronJob : return & r . Spec . JobTemplate . Spec . Template . ObjectMeta , true case * batch . JobTemplate : return & r . Template . Spec . Template . ObjectMeta , true case * apps . StatefulSet : return & r . Spec . Template . ObjectMeta , true } return nil , false }
GetTemplateMetaObject returns a mutable metav1.Object interface for the template
the object contains, or false if no such object is available.
GetTemplateMetaObject returns a mutable metav1 . Object interface for the template the object contains or false if no such object is available .