func buildEtcdBackupManagerContainer(c *EtcdCluster) *v1.Container {
	command := []string{"/etcd-backup"}
	command = append(command, "--backup-store", c.BackupStore)
	command = append(command, "--cluster-name", c.ClusterName)
	command = append(command, "--data-dir", "/var/etcd/"+c.DataDirName)

	if c.isTLS() {
		command = append(command, "--client-url", "https://127.0.0.1:4001")
		command = append(command, "--client-ca-file", c.TLSCA)
		command = append(command, "--client-cert-file", c.TLSCert)
		command = append(command, "--client-key-file", c.TLSKey)
	}

	container := v1.Container{
		Name:    "etcd-backup",
		Image:   c.BackupImage,
		Command: command,
	}

	// TODO: TLS options
	// TODO: Liveness probe?

	// volume should already have been registered
	container.VolumeMounts = append(container.VolumeMounts, v1.VolumeMount{
		Name:      "varetcdata",
		MountPath: "/var/etcd/" + c.DataDirName,
		ReadOnly:  false,
	})

	if c.isTLS() {
		for _, dirname := range buildCertificateDirectories(c) {
			normalized := strings.Replace(dirname, "/", "", -1)

			// pod volume already registered for etcd container above
			container.VolumeMounts = append(container.VolumeMounts, v1.VolumeMount{
				Name:      normalized,
				MountPath: dirname,
				ReadOnly:  true,
			})
		}
	}

	return &container
}
// buildEtcdBackupManagerContainer builds a container for the standalone etcd backup manager
buildEtcdBackupManagerContainer builds a container for the standalone etcd backup manager
// buildEtcdBackupManagerContainer builds a container for the standalone etcd backup manager
func buildEtcdBackupManagerContainer(c *EtcdCluster) *v1.Container {
	command := []string{"/etcd-backup"}
	command = append(command, "--backup-store", c.BackupStore)
	command = append(command, "--cluster-name", c.ClusterName)
	command = append(command, "--data-dir", "/var/etcd/"+c.DataDirName)
	if c.isTLS() {
		command = append(command, "--client-url", "https://127.0.0.1:4001")
		command = append(command, "--client-ca-file", c.TLSCA)
		command = append(command, "--client-cert-file", c.TLSCert)
		command = append(command, "--client-key-file", c.TLSKey)
	}
	container := v1.Container{
		Name:    "etcd-backup",
		Image:   c.BackupImage,
		Command: command,
	}
	container.VolumeMounts = append(container.VolumeMounts, v1.VolumeMount{
		Name:      "varetcdata",
		MountPath: "/var/etcd/" + c.DataDirName,
		ReadOnly:  false,
	})
	if c.isTLS() {
		for _, dirname := range buildCertificateDirectories(c) {
			normalized := strings.Replace(dirname, "/", "", -1)
			container.VolumeMounts = append(container.VolumeMounts, v1.VolumeMount{
				Name:      normalized,
				MountPath: dirname,
				ReadOnly:  true,
			})
		}
	}
	return &container
}
func buildEtcdBackupManagerContainer ( c * EtcdCluster ) * v1 . Container { command := [ ] string { " " } command = append ( command , " " , c . BackupStore ) command = append ( command , " " , c . ClusterName ) command = append ( command , " " , " " + c . DataDirName ) if c . isTLS ( ) { command = append ( command , " " , " " ) command = append ( command , " " , c . TLSCA ) command = append ( command , " " , c . TLSCert ) command = append ( command , " " , c . TLSKey ) } container := v1 . Container { Name : " " , Image : c . BackupImage , Command : command , } container . VolumeMounts = append ( container . VolumeMounts , v1 . VolumeMount { Name : " " , MountPath : " " + c . DataDirName , ReadOnly : false , } ) if c . isTLS ( ) { for _ , dirname := range buildCertificateDirectories ( c ) { normalized := strings . Replace ( dirname , " " , " " , - 1 ) container . VolumeMounts = append ( container . VolumeMounts , v1 . VolumeMount { Name : normalized , MountPath : dirname , ReadOnly : true , } ) } } return & container }
buildEtcdBackupManagerContainer builds a container for the standalone etcd backup manager
buildEtcdBackupManagerContainer builds a container for the standalone etcd backup manager
// TODO: TLS options // TODO: Liveness probe? // volume should already have been registered // pod volume already registered for etcd container above