Skip to content

Commit 7bf2203

Browse files
committed
Do not require credentials for the OCI client
Signed-off-by: Roman Hros <[email protected]>
1 parent fba490d commit 7bf2203

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

pkg/assetsclient/oci/credentials.go

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,14 @@ func newOCIConfig() (ociConfig, error) {
5555
config.repository = val
5656

5757
val = os.Getenv(envOCIAccessToken)
58-
if val != "" {
59-
base64AccessToken := base64.StdEncoding.EncodeToString([]byte(val))
60-
config.accessToken = base64AccessToken
61-
} else {
62-
val = os.Getenv(envOCIUsername)
63-
if val == "" {
64-
return ociConfig{}, fmt.Errorf("environment variable %s is not set", envOCIUsername)
65-
}
66-
config.username = val
58+
base64AccessToken := base64.StdEncoding.EncodeToString([]byte(val))
59+
config.accessToken = base64AccessToken
6760

68-
val = os.Getenv(envOCIPassword)
69-
if val == "" {
70-
return ociConfig{}, fmt.Errorf("environment variable %s is not set", envOCIPassword)
71-
}
72-
config.password = val
73-
}
61+
val = os.Getenv(envOCIUsername)
62+
config.username = val
63+
64+
val = os.Getenv(envOCIPassword)
65+
config.password = val
7466

7567
return config, nil
7668
}

0 commit comments

Comments
 (0)