diff --git a/pkg/assetsclient/oci/credentials.go b/pkg/assetsclient/oci/credentials.go index 74edecd95..9c7d84e8a 100644 --- a/pkg/assetsclient/oci/credentials.go +++ b/pkg/assetsclient/oci/credentials.go @@ -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 }