func NewEtcdInitContainer(e *v1alpha1.EtcdCluster) corev1.Container {
	initEnv := []corev1.EnvVar{
		{
			Name: "POD_NAME",
			ValueFrom: &corev1.EnvVarSource{
				FieldRef: &corev1.ObjectFieldSelector{
					FieldPath: "metadata.name",
				},
			},
		},
		{
			Name:  "POD_DNS_NAME",
			Value: fmt.Sprintf("$(POD_NAME).%s.%s.svc.%s", helpers.NameForHeadlessService(e), e.Namespace, helpers.ClusterDomain(e)),
		},
	}
	return corev1.Container{
		Image:   getInitImage(e),
		Name:    "check-dns",
		Command: []string{"/bin/sh", "-ec", checkDNSScriptTemplate},
		Env:     initEnv,
	}
}
// NewEtcdInitContainer returns the init container used to start etcd node
NewEtcdInitContainer returns the init container used to start etcd node
// NewEtcdInitContainer returns the init container used to start etcd node
func NewEtcdInitContainer(e *v1alpha1.EtcdCluster) corev1.Container {
	initEnv := []corev1.EnvVar{
		{
			Name: "POD_NAME",
			ValueFrom: &corev1.EnvVarSource{
				FieldRef: &corev1.ObjectFieldSelector{
					FieldPath: "metadata.name",
				},
			},
		},
		{
			Name:  "POD_DNS_NAME",
			Value: fmt.Sprintf("$(POD_NAME).%s.%s.svc.%s", helpers.NameForHeadlessService(e), e.Namespace, helpers.ClusterDomain(e)),
		},
	}
	return corev1.Container{
		Image:   getInitImage(e),
		Name:    "check-dns",
		Command: []string{"/bin/sh", "-ec", checkDNSScriptTemplate},
		Env:     initEnv,
	}
}
func NewEtcdInitContainer ( e * v1alpha1 . EtcdCluster ) corev1 . Container { initEnv := [ ] corev1 . EnvVar { { Name : " " , ValueFrom : & corev1 . EnvVarSource { FieldRef : & corev1 . ObjectFieldSelector { FieldPath : " " , } , } , } , { Name : " " , Value : fmt . Sprintf ( " " , helpers . NameForHeadlessService ( e ) , e . Namespace , helpers . ClusterDomain ( e ) ) , } , } return corev1 . Container { Image : getInitImage ( e ) , Name : " " , Command : [ ] string { " " , " " , checkDNSScriptTemplate } , Env : initEnv , } }
NewEtcdInitContainer returns the init container used to start etcd node
NewEtcdInitContainer returns the init container used to start etcd node