diff --git a/cmd/cdi-importer/importer.go b/cmd/cdi-importer/importer.go index 892c73daa9..731b954a2d 100644 --- a/cmd/cdi-importer/importer.go +++ b/cmd/cdi-importer/importer.go @@ -255,7 +255,7 @@ func newDataSource(source string, contentType string, volumeMode v1.PersistentVo ep, _ := util.ParseEnvVar(common.ImporterEndpoint, false) acc, _ := util.ParseEnvVar(common.ImporterAccessKeyID, false) sec, _ := util.ParseEnvVar(common.ImporterSecretKey, false) - use_s3_credential_chain_auth, _ := strconv.ParseBool(os.Getenv(common.UseS3CredentialsChainAuth)) + s3ChainAuth, _ := strconv.ParseBool(os.Getenv(common.UseS3CredentialsChainAuth)) keyf, _ := util.ParseEnvVar(common.ImporterGoogleCredentialFileVar, false) diskID, _ := util.ParseEnvVar(common.ImporterDiskID, false) uuid, _ := util.ParseEnvVar(common.ImporterUUID, false) @@ -289,7 +289,7 @@ func newDataSource(source string, contentType string, volumeMode v1.PersistentVo ds *importer.S3DataSource err error ) - if use_s3_credential_chain_auth { + if s3ChainAuth { // use this as a flag to say the user has a SAN set up with creds that IRSA will read klog.Infof("Attempting to create your S3 Data Source with cloud provider creds.\n") ds, err = importer.NewChainCredentialsS3DataSource(ep, certDir) diff --git a/pkg/controller/import-controller.go b/pkg/controller/import-controller.go index 4d4ba21353..d0bbd703ee 100644 --- a/pkg/controller/import-controller.go +++ b/pkg/controller/import-controller.go @@ -76,33 +76,33 @@ type ImportReconciler struct { } type importPodEnvVar struct { - ep string - secretName string - source string - contentType string - imageSize string - certConfigMap string - diskID string - uuid string - pullMethod string - readyFile string - doneFile string - backingFile string - thumbprint string - filesystemOverhead string - insecureTLS bool - currentCheckpoint string - previousCheckpoint string - finalCheckpoint string - preallocation bool - httpProxy string - httpsProxy string - noProxy string - certConfigMapProxy string - extraHeaders []string - secretExtraHeaders []string - cacheMode string - use_s3_credential_chain_auth bool + ep string + secretName string + source string + contentType string + imageSize string + certConfigMap string + diskID string + uuid string + pullMethod string + readyFile string + doneFile string + backingFile string + thumbprint string + filesystemOverhead string + insecureTLS bool + currentCheckpoint string + previousCheckpoint string + finalCheckpoint string + preallocation bool + httpProxy string + httpsProxy string + noProxy string + certConfigMapProxy string + extraHeaders []string + secretExtraHeaders []string + cacheMode string + s3ChainAuth bool } type importerPodArgs struct { @@ -951,7 +951,7 @@ func makeImporterPodSpec(args *importerPodArgs) *corev1.Pod { } func makeImporterContainerSpec(args *importerPodArgs) []corev1.Container { - args.podEnvVar.use_s3_credential_chain_auth = args.serviceAccountName != "" // prep podEnvVar for Import method below + args.podEnvVar.s3ChainAuth = args.serviceAccountName != "" // prep podEnvVar for Import method below containers := []corev1.Container{ { Name: common.ImporterPodName, @@ -1269,7 +1269,7 @@ func makeImportEnv(podEnvVar *importPodEnvVar, uid types.UID) []corev1.EnvVar { }, { Name: common.UseS3CredentialsChainAuth, - Value: strconv.FormatBool(podEnvVar.use_s3_credential_chain_auth), + Value: strconv.FormatBool(podEnvVar.s3ChainAuth), }, } if podEnvVar.secretName != "" && podEnvVar.source != cc.SourceGCS {