From a87f77d4f010ee3fb2ca4b30111b7d70596c2eb2 Mon Sep 17 00:00:00 2001 From: russellcain Date: Mon, 16 Sep 2024 11:52:58 -0500 Subject: [PATCH] 3026: lint fixes Signed-off-by: russellcain --- cmd/cdi-importer/importer.go | 4 ++-- pkg/importer/s3-datasource.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/cdi-importer/importer.go b/cmd/cdi-importer/importer.go index 1d54bbfc4d..9cc5f7a1d4 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) - service_account, _ := util.ParseEnvVar(common.ImporterServiceAccountName, false) + serviceAccount, _ := util.ParseEnvVar(common.ImporterServiceAccountName, false) 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 service_account != "" { + if serviceAccount != "" { // 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/importer/s3-datasource.go b/pkg/importer/s3-datasource.go index 8ab3ad1338..236d1fdc91 100644 --- a/pkg/importer/s3-datasource.go +++ b/pkg/importer/s3-datasource.go @@ -194,7 +194,7 @@ func getS3Client(endpoint string, accessKey string, secKey string, certDir strin if err != nil { return nil, errors.Wrap(err, "Error creating http client for s3") } - var creds *credentials.Credentials = nil + var creds *credentials.Credentials if accessKey != emptyAccessKey && secKey != emptySecretKey { creds = credentials.NewStaticCredentials(accessKey, secKey, "") }