func (usc *UnsealConfig) ToArgs(vault *Vault) []string {
	args := []string{}
	if usc.Kubernetes != nil {

		secretNamespace := vault.Namespace
		if usc.Kubernetes.SecretNamespace != "" {
			secretNamespace = usc.Kubernetes.SecretNamespace
		}
		secretName := vault.Name + "-unseal-keys"
		if usc.Kubernetes.SecretName != "" {
			secretName = usc.Kubernetes.SecretName
		}
		args = append(args,
			"--mode",
			"k8s",
			"--k8s-secret-namespace",
			secretNamespace,
			"--k8s-secret-name",
			secretName,
		)

	} else if usc.Google != nil {

		args = append(args,
			"--mode",
			"google-cloud-kms-gcs",
			"--google-cloud-kms-key-ring",
			usc.Google.KMSKeyRing,
			"--google-cloud-kms-crypto-key",
			usc.Google.KMSCryptoKey,
			"--google-cloud-kms-location",
			usc.Google.KMSLocation,
			"--google-cloud-kms-project",
			usc.Google.KMSProject,
			"--google-cloud-storage-bucket",
			usc.Google.StorageBucket,
		)

	} else if usc.Azure != nil {

		args = append(args,
			"--mode",
			"azure-key-vault",
			"--azure-key-vault-name",
			usc.Azure.KeyVaultName,
		)

	} else if usc.AWS != nil {

		args = append(args,
			"--mode",
			"aws-kms-s3",
			"--aws-kms-key-id",
			usc.AWS.KMSKeyID,
			"--aws-kms-region",
			usc.AWS.KMSRegion,
			"--aws-s3-bucket",
			usc.AWS.S3Bucket,
			"--aws-s3-prefix",
			usc.AWS.S3Prefix,
			"--aws-s3-region",
			usc.AWS.S3Region,
		)

	} else if usc.Alibaba != nil {

		args = append(args,
			"--mode",
			"alibaba-kms-oss",
			"--alibaba-kms-region",
			usc.Alibaba.KMSRegion,
			"--alibaba-kms-key-id",
			usc.Alibaba.KMSKeyID,
			"--alibaba-oss-endpoint",
			usc.Alibaba.OSSEndpoint,
			"--alibaba-oss-bucket",
			usc.Alibaba.OSSBucket,
			"--alibaba-oss-prefix",
			usc.Alibaba.OSSPrefix,
		)

	}
	return args
}
// ToArgs returns the UnsealConfig as and argument array for bank-vaults
ToArgs returns the UnsealConfig as and argument array for bank-vaults
// ToArgs returns the UnsealConfig as and argument array for bank - vaults
func (usc *UnsealConfig) ToArgs(vault *Vault) []string {
	args := []string{}
	if usc.Kubernetes != nil {
		secretNamespace := vault.Namespace
		if usc.Kubernetes.SecretNamespace != "" {
			secretNamespace = usc.Kubernetes.SecretNamespace
		}
		secretName := vault.Name + "-unseal-keys"
		if usc.Kubernetes.SecretName != "" {
			secretName = usc.Kubernetes.SecretName
		}
		args = append(args,
			"--mode",
			"k8s",
			"--k8s-secret-namespace",
			secretNamespace,
			"--k8s-secret-name",
			secretName,
		)
	} else if usc.Google != nil {
		args = append(args,
			"--mode",
			"google-cloud-kms-gcs",
			"--google-cloud-kms-key-ring",
			usc.Google.KMSKeyRing,
			"--google-cloud-kms-crypto-key",
			usc.Google.KMSCryptoKey,
			"--google-cloud-kms-location",
			usc.Google.KMSLocation,
			"--google-cloud-kms-project",
			usc.Google.KMSProject,
			"--google-cloud-storage-bucket",
			usc.Google.StorageBucket,
		)
	} else if usc.Azure != nil {
		args = append(args,
			"--mode",
			"azure-key-vault",
			"--azure-key-vault-name",
			usc.Azure.KeyVaultName,
		)
	} else if usc.AWS != nil {
		args = append(args,
			"--mode",
			"aws-kms-s3",
			"--aws-kms-key-id",
			usc.AWS.KMSKeyID,
			"--aws-kms-region",
			usc.AWS.KMSRegion,
			"--aws-s3-bucket",
			usc.AWS.S3Bucket,
			"--aws-s3-prefix",
			usc.AWS.S3Prefix,
			"--aws-s3-region",
			usc.AWS.S3Region,
		)
	} else if usc.Alibaba != nil {
		args = append(args,
			"--mode",
			"alibaba-kms-oss",
			"--alibaba-kms-region",
			usc.Alibaba.KMSRegion,
			"--alibaba-kms-key-id",
			usc.Alibaba.KMSKeyID,
			"--alibaba-oss-endpoint",
			usc.Alibaba.OSSEndpoint,
			"--alibaba-oss-bucket",
			usc.Alibaba.OSSBucket,
			"--alibaba-oss-prefix",
			usc.Alibaba.OSSPrefix,
		)
	}
	return args
}
func ( usc * UnsealConfig ) ToArgs ( vault * Vault ) [ ] string { args := [ ] string { } if usc . Kubernetes != nil { secretNamespace := vault . Namespace if usc . Kubernetes . SecretNamespace != " " { secretNamespace = usc . Kubernetes . SecretNamespace } secretName := vault . Name + " " if usc . Kubernetes . SecretName != " " { secretName = usc . Kubernetes . SecretName } args = append ( args , " " , " " , " " , secretNamespace , " " , secretName , ) } else if usc . Google != nil { args = append ( args , " " , " " , " " , usc . Google . KMSKeyRing , " " , usc . Google . KMSCryptoKey , " " , usc . Google . KMSLocation , " " , usc . Google . KMSProject , " " , usc . Google . StorageBucket , ) } else if usc . Azure != nil { args = append ( args , " " , " " , " " , usc . Azure . KeyVaultName , ) } else if usc . AWS != nil { args = append ( args , " " , " " , " " , usc . AWS . KMSKeyID , " " , usc . AWS . KMSRegion , " " , usc . AWS . S3Bucket , " " , usc . AWS . S3Prefix , " " , usc . AWS . S3Region , ) } else if usc . Alibaba != nil { args = append ( args , " " , " " , " " , usc . Alibaba . KMSRegion , " " , usc . Alibaba . KMSKeyID , " " , usc . Alibaba . OSSEndpoint , " " , usc . Alibaba . OSSBucket , " " , usc . Alibaba . OSSPrefix , ) } return args }
ToArgs returns the UnsealConfig as and argument array for bank-vaults
ToArgs returns the UnsealConfig as and argument array for bank - vaults