Repository navigation
fix: keep the repository path when an image digest replaces the tag - #7069
Open
ItsDeadlyProgrammer wants to merge 1 commit into
Open
ItsDeadlyProgrammer wants to merge 1 commit into
ItsDeadlyProgrammer wants to merge 1 commit into
Conversation
ReplaceImageTagWithDigest cut the image at its first colon, so a registry with a port lost its repository path: registry.local:5000/team/app:v1 became registry.local@sha256:.... Look for the tag or digest only in the last path segment. Signed-off-by: ItsDeadlyProgrammer <hvsr29march2004@gmail.com>
ItsDeadlyProgrammer
requested review from
prakarsh-dt and
vivek-devtron
as code owners
October 23, 2026 13:28
|
Bito Review Skipped - Source Branch Not Found |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
When an image digest policy applies to a pre/post-CD stage,
ReplaceImageTagWithDigestbuilt the image reference withstrings.Split(image, ":")[0]. A registry host with a port made that cut the reference at the port colon, soregistry.local:5000/team/app:v1becameregistry.local@sha256:...and the repository path was lost.The function now looks for the tag or the digest only in the last path segment of the image. The new
TestReplaceImageTagWithDigestcovers a tag, a repository path, a registry, a registry with a port (with and without a tag), and an image that already carries a digest. The four registry-with-port cases fail on the old code and pass now.Fixes #7068
How Has This Been Tested?
go test ./pkg/deployment/trigger/devtronApps/ -run TestReplaceImageTagWithDigestChecklist:
Does this PR introduce a user-facing change?