Skip to content

Commit

Permalink
Convert owner name to lowercase when building container image referen…
Browse files Browse the repository at this point in the history
…ce (#1617)

Container registries don't handle uppercases for the owner (or namespace).

We need to do some parsing to allow for these. Else, repositories
in my personall account (JAORMX) won't work.
  • Loading branch information
JAORMX authored Nov 10, 2023
1 parent 8de2135 commit 58ae022
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func artifactImageRef(registry, owner, artifactName, versionName string) string
if registry == "" {
registry = REGISTRY
}

// NOTE(jaosorior): The owner can't be upper-cased.
owner = strings.ToLower(owner)

return fmt.Sprintf("%s/%s/%s@%s", registry, owner, artifactName, versionName)
}

Expand All @@ -87,7 +91,8 @@ func GetArtifactSignatureAndWorkflowInfo(
signatureVerification, githubWorkflow, validateErr := ValidateSignature(ctx,
cli.GetToken(), ownerLogin, imageRef)
if validateErr != nil {
err = ErrSigValidation
err = fmt.Errorf("%w: errorvalidating image-ref %s: %s", ErrSigValidation,
imageRef, validateErr.Error())
return
}

Expand Down

0 comments on commit 58ae022

Please sign in to comment.