Skip to content

Commit

Permalink
update s3ChainAuth flag name to be less verbose
Browse files Browse the repository at this point in the history
Signed-off-by: russellcain <[email protected]>
  • Loading branch information
russellcain committed Nov 6, 2024
1 parent 69501ee commit 0f92ea5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cmd/cdi-importer/importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
58 changes: 29 additions & 29 deletions pkg/controller/import-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0f92ea5

Please sign in to comment.