google / google/go-containerregistry

crane auth login: fail to login to ECR with repository name attached

Open
#2,035 1 comment 0 reactions 0 assignees View on GitHub
bug lifecycle/stale
Dominant language
Go
Stars
4k
Forks
686
Avg merge
2d 12h
Merged PRs (30d)
26

Description

### Describe the bug

When I try to login into ECR using crane with the command `crane auth login --username AWS --password-stdin 123456789.ecr.us-east-1.amazonaws.com/my_repository` I get an error message `Error: registries must be valid RFC 3986 URI authorities: 123456789.ecr.us-east-1.amazonaws.com/my_repository`.

This might be more of a QoL feature than a bug fix :)

### Expected behavior

I expect `crane auth login` to ignore the repository name, similarly to what `docker login` does.

### Additional context

`crane version` -> `0.20.2`
Registry used -> ECR

Contributor guide

Open the contributing guide

Research direction

Start at the crane auth login command and trace how its registry argument is validated when a repository name is attached to an ECR host. Reproduce the command from the issue, then verify that login accepts the repository-qualified input while preserving validation for invalid registry authorities.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go
Domain
authentication, cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.