func GetPodSpecV1(obj runtime.Object) (*corev1.PodSpec, *field.Path, error) {
	switch r := obj.(type) {

	case *corev1.Pod:
		return &r.Spec, field.NewPath("spec"), nil

	case *corev1.PodTemplate:
		return &r.Template.Spec, field.NewPath("template", "spec"), nil

	case *corev1.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
		}

	case *extensionsv1beta1.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil

	case *extensionsv1beta1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil

	case *extensionsv1beta1.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil

	case *batchv1.Job:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil

	case *batchv2alpha1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.Spec, field.NewPath("spec", "jobTemplate", "spec", "template", "spec"), nil
	case *batchv1beta1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.Spec, field.NewPath("spec", "jobTemplate", "spec", "template", "spec"), nil

	case *batchv2alpha1.JobTemplate:
		return &r.Template.Spec.Template.Spec, field.NewPath("template", "spec", "template", "spec"), nil
	case *batchv1beta1.JobTemplate:
		return &r.Template.Spec.Template.Spec, field.NewPath("template", "spec", "template", "spec"), nil

	case *kappsv1.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta1.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	}
	return nil, nil, errNoPodSpec
}
// GetPodSpecV1 returns a mutable pod spec out of the provided object, including a field path
// to the field in the object, or an error if the object does not contain a pod spec.
// This only returns pod specs for v1 compatible objects.
GetPodSpecV1 returns a mutable pod spec out of the provided object, including a field path
to the field in the object, or an error if the object does not contain a pod spec.
This only returns pod specs for v1 compatible objects.
// GetPodSpecV1 returns a mutable pod spec out of the provided object including a field path // to the field in the object or an error if the object does not contain a pod spec . // This only returns pod specs for v1 compatible objects .
func GetPodSpecV1(obj runtime.Object) (*corev1.PodSpec, *field.Path, error) {
	switch r := obj.(type) {
	case *corev1.Pod:
		return &r.Spec, field.NewPath("spec"), nil
	case *corev1.PodTemplate:
		return &r.Template.Spec, field.NewPath("template", "spec"), nil
	case *corev1.ReplicationController:
		if r.Spec.Template != nil {
			return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
		}
	case *extensionsv1beta1.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.DaemonSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *extensionsv1beta1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta1.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.Deployment:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *extensionsv1beta1.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.ReplicaSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *batchv1.Job:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *batchv2alpha1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.Spec, field.NewPath("spec", "jobTemplate", "spec", "template", "spec"), nil
	case *batchv1beta1.CronJob:
		return &r.Spec.JobTemplate.Spec.Template.Spec, field.NewPath("spec", "jobTemplate", "spec", "template", "spec"), nil
	case *batchv2alpha1.JobTemplate:
		return &r.Template.Spec.Template.Spec, field.NewPath("template", "spec", "template", "spec"), nil
	case *batchv1beta1.JobTemplate:
		return &r.Template.Spec.Template.Spec, field.NewPath("template", "spec", "template", "spec"), nil
	case *kappsv1.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta1.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	case *kappsv1beta2.StatefulSet:
		return &r.Spec.Template.Spec, field.NewPath("spec", "template", "spec"), nil
	}
	return nil, nil, errNoPodSpec
}
func GetPodSpecV1 ( obj runtime . Object ) ( * corev1 . PodSpec , * field . Path , error ) { switch r := obj . ( type ) { case * corev1 . Pod : return & r . Spec , field . NewPath ( " " ) , nil case * corev1 . PodTemplate : return & r . Template . Spec , field . NewPath ( " " , " " ) , nil case * corev1 . ReplicationController : if r . Spec . Template != nil { return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil } case * extensionsv1beta1 . DaemonSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1 . DaemonSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta2 . DaemonSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * extensionsv1beta1 . Deployment : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1 . Deployment : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta1 . Deployment : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta2 . Deployment : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * extensionsv1beta1 . ReplicaSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1 . ReplicaSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta2 . ReplicaSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * batchv1 . Job : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * batchv2alpha1 . CronJob : return & r . Spec . JobTemplate . Spec . Template . Spec , field . NewPath ( " " , " " , " " , " " , " " ) , nil case * batchv1beta1 . CronJob : return & r . Spec . JobTemplate . Spec . Template . Spec , field . NewPath ( " " , " " , " " , " " , " " ) , nil case * batchv2alpha1 . JobTemplate : return & r . Template . Spec . Template . Spec , field . NewPath ( " " , " " , " " , " " ) , nil case * batchv1beta1 . JobTemplate : return & r . Template . Spec . Template . Spec , field . NewPath ( " " , " " , " " , " " ) , nil case * kappsv1 . StatefulSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta1 . StatefulSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil case * kappsv1beta2 . StatefulSet : return & r . Spec . Template . Spec , field . NewPath ( " " , " " , " " ) , nil } return nil , nil , errNoPodSpec }
GetPodSpecV1 returns a mutable pod spec out of the provided object, including a field path
to the field in the object, or an error if the object does not contain a pod spec.
GetPodSpecV1 returns a mutable pod spec out of the provided object including a field path to the field in the object or an error if the object does not contain a pod spec .