Skip to content

feat(chainguard): support cgr.dev via CHAINGUARD_IDENTITY_ID and CHAINGUARD_TOKEN - #288

Merged
isometry merged 1 commit into
mainfrom
feat/chainguard-registry
Nov 9, 2026
Merged

isometry merged 1 commit into
mainfrom
feat/chainguard-registry

Conversation

@isometry

@isometry isometry commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add special support for Chainguard's cgr.dev registry, alongside GHCR and AWS ECR.
  • When no DOCKER_<host>_USR/PSW variables match, CHAINGUARD_IDENTITY_ID is used as the username and CHAINGUARD_TOKEN as the password. Both must be set; otherwise empty credentials are returned.
  • Hostname checks for ghcr.io and cgr.dev use plain string equality rather than regexp (ECR keeps its regexp for the account/region captures).

Testing

  • go test ./...
  • New TestEnvGet case for cgr.dev and TestEnvGetChainguardPartial for the one-variable-only cases.
  • Manual: echo cgr.dev | CHAINGUARD_IDENTITY_ID=id CHAINGUARD_TOKEN=tok ./docker-credential-env get returns the expected username and secret.

…NGUARD_TOKEN

When no DOCKER_<host>_USR/PSW variables match, fall back to CHAINGUARD_IDENTITY_ID (username) and CHAINGUARD_TOKEN (password) for cgr.dev. Both must be set.

Hostname checks for ghcr.io and cgr.dev now use string equality instead of regexp.
@isometry
isometry merged commit 86ef22b into main Nov 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant