Skip to content

Commit

Permalink
Do not require credentials for the OCI client
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Hros <roman.hros@dnation.cloud>
  • Loading branch information
chess-knight committed Sep 3, 2024
1 parent fba490d commit 7bf2203
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions pkg/assetsclient/oci/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,14 @@ func newOCIConfig() (ociConfig, error) {
config.repository = val

val = os.Getenv(envOCIAccessToken)
if val != "" {
base64AccessToken := base64.StdEncoding.EncodeToString([]byte(val))
config.accessToken = base64AccessToken
} else {
val = os.Getenv(envOCIUsername)
if val == "" {
return ociConfig{}, fmt.Errorf("environment variable %s is not set", envOCIUsername)
}
config.username = val
base64AccessToken := base64.StdEncoding.EncodeToString([]byte(val))
config.accessToken = base64AccessToken

val = os.Getenv(envOCIPassword)
if val == "" {
return ociConfig{}, fmt.Errorf("environment variable %s is not set", envOCIPassword)
}
config.password = val
}
val = os.Getenv(envOCIUsername)
config.username = val

val = os.Getenv(envOCIPassword)
config.password = val

return config, nil
}

0 comments on commit 7bf2203

Please sign in to comment.