Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Makefile, push: Prevent overwriting existing version tags (#445)
The IMAGE_GIT_TAG is generated using `git describe` to create a virtual tag for the image, and used in order to tag every push to the repository for later use. However, when an actual git tag exists (e.g., v0.45.0), git describe returns that tag. This behavior makes it possible to accidentally overwrite push an existing version tag in the registry. Flow Leading to the Issue: 1. A new kmp release is created, pushing a new tag (e.g., v0.45.0). 2. A stable branch is created from that commit, pushing a new stable branch tag (e.g., release-0.45_latest). 2.1 . During this push, IMAGE_GIT_TAG resolves to this Git tag (e.g., v0.45.0) due to git describe. 2.2 Makefile attempts to push the image with this tag (e.g., v0.45.0) to the registry, overwriting the original tag sha256 digest. To address this, introducing a check to ensure such tags are not overwritten when pushed to remote repositories, preserving the integrity of published versions. In case of local repositories the push to IMAGE_GIT_TAG is removed entirely. Signed-off-by: Ram Lavi <ralavi@redhat.com>
- Loading branch information