func generateCommand(cr *v1alpha1.RethinkDBCluster, peers []string) []string {
	// Add default args for all cases first
	cmd := []string{
		RethinkDBExePath,
		"--bind", "all",
		"--cluster-tls-ca", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBCAKey),
		"--cluster-tls-cert", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBClusterKey),
		"--cluster-tls-key", fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBClusterKey),
		"--directory", RethinkDBDataPath,
		"--driver-tls-cert", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBDriverKey),
		"--driver-tls-key", fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBDriverKey),
		"--no-update-check",
	}

	// Enable the http web-admin console if requested
	if cr.Spec.WebAdminEnabled {
		cmd = append(cmd, "--http-tls-cert")
		cmd = append(cmd, fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBHttpKey))

		cmd = append(cmd, "--http-tls-key")
		cmd = append(cmd, fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBHttpKey))
	} else {
		cmd = append(cmd, "--no-http-admin")
	}

	// Handle initial password
	cmd = append(cmd, "--initial-password")
	if len(peers) <= 0 {
		cmd = append(cmd, fmt.Sprintf("$(%s)", RethinkDBPasswordEnv))
	} else {
		cmd = append(cmd, "auto")

		// Join peers
		for _, peer := range peers {
			cmd = append(cmd, "--join")
			cmd = append(cmd, fmt.Sprintf("%s:%d", peer, RethinkDBClusterPort))
		}
	}

	return cmd
}
// generateCommand will generate the command for the container in a server Pod for the RethinkDBCluster.
generateCommand will generate the command for the container in a server Pod for the RethinkDBCluster.
// generateCommand will generate the command for the container in a server Pod for the RethinkDBCluster .
func generateCommand(cr *v1alpha1.RethinkDBCluster, peers []string) []string {
	cmd := []string{
		RethinkDBExePath,
		"--bind", "all",
		"--cluster-tls-ca", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBCAKey),
		"--cluster-tls-cert", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBClusterKey),
		"--cluster-tls-key", fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBClusterKey),
		"--directory", RethinkDBDataPath,
		"--driver-tls-cert", fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBDriverKey),
		"--driver-tls-key", fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBDriverKey),
		"--no-update-check",
	}
	if cr.Spec.WebAdminEnabled {
		cmd = append(cmd, "--http-tls-cert")
		cmd = append(cmd, fmt.Sprintf("%s/%s.crt", RethinkDBTLSPath, RethinkDBHttpKey))
		cmd = append(cmd, "--http-tls-key")
		cmd = append(cmd, fmt.Sprintf("%s/%s.key", RethinkDBTLSPath, RethinkDBHttpKey))
	} else {
		cmd = append(cmd, "--no-http-admin")
	}
	cmd = append(cmd, "--initial-password")
	if len(peers) <= 0 {
		cmd = append(cmd, fmt.Sprintf("$(%s)", RethinkDBPasswordEnv))
	} else {
		cmd = append(cmd, "auto")
		for _, peer := range peers {
			cmd = append(cmd, "--join")
			cmd = append(cmd, fmt.Sprintf("%s:%d", peer, RethinkDBClusterPort))
		}
	}
	return cmd
}
func generateCommand ( cr * v1alpha1 . RethinkDBCluster , peers [ ] string ) [ ] string { cmd := [ ] string { RethinkDBExePath , " " , " " , " " , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBCAKey ) , " " , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBClusterKey ) , " " , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBClusterKey ) , " " , RethinkDBDataPath , " " , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBDriverKey ) , " " , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBDriverKey ) , " " , } if cr . Spec . WebAdminEnabled { cmd = append ( cmd , " " ) cmd = append ( cmd , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBHttpKey ) ) cmd = append ( cmd , " " ) cmd = append ( cmd , fmt . Sprintf ( " " , RethinkDBTLSPath , RethinkDBHttpKey ) ) } else { cmd = append ( cmd , " " ) } cmd = append ( cmd , " " ) if len ( peers ) <= 0 { cmd = append ( cmd , fmt . Sprintf ( " " , RethinkDBPasswordEnv ) ) } else { cmd = append ( cmd , " " ) for _ , peer := range peers { cmd = append ( cmd , " " ) cmd = append ( cmd , fmt . Sprintf ( " " , peer , RethinkDBClusterPort ) ) } } return cmd }
generateCommand will generate the command for the container in a server Pod for the RethinkDBCluster.
generateCommand will generate the command for the container in a server Pod for the RethinkDBCluster .
// Add default args for all cases first // Enable the http web-admin console if requested // Handle initial password // Join peers