apple / apple/container

[Bug]: `image push` can push a different image tag than `latest`.

Open
#2,098 0 comments 0 reactions 1 assignee Claimed by @JaewonHur View on GitHub
Dominant language
Swift
Stars
49.9k
Forks
1.8k
Avg merge
1d 20h
Merged PRs (30d)
22

Description

### I have done the following

- [x] I have searched the existing issues
- [x] If possible, I've reproduced the issue using the 'main' branch of this project

### Steps to reproduce

```console
container build -t :latest .
container tag :latest :123456
container image rm :latest

container image push :latest
```

### Problem description

Last image push command should throw not found error, but it pushes :123456 instead.
The built image has an annotation of :latest, so it's filtered in localImageMatches there, and the guard branch returns localImageMatches.first.

However, :latest tag is already deleted, and it should actually return nil.

### Environment

```markdown
- OS: 26
- Xcode: 26
- Container: main
```

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.