Skip to content

fix: ensure image references contain the full image and not just the image tag#1896

Merged
flin-8 merged 4 commits into
mainfrom
scme/fix/tag-friendly-name-bug
Apr 22, 2026
Merged

fix: ensure image references contain the full image and not just the image tag#1896
flin-8 merged 4 commits into
mainfrom
scme/fix/tag-friendly-name-bug

Conversation

@scme0
Copy link
Copy Markdown
Collaborator

@scme0 scme0 commented Apr 20, 2026

⚠️ Does this change require a corresponding Server Change?
⚠️ If so - please add a "Requires Server Change" label to this PR!

I was adding tests for HelmValuesImageReplaceStepVariables class in this pr: #1894 and I think I found a bug. I've extracted the tests and the fix for the bug into this PR for separate review.

The test failure looks like:

Expected result.UpdatedImageReferences[0] to be the same string, but they differ at index 0:
   ↓ (actual)
  "1.27.1"
  "nginx:1.27.1"
   ↑ (expected).

These tests fail before fix is applied:
Screenshot 2026-04-20 at 13 15 49

Copy link
Copy Markdown
Contributor

@rain-on rain-on left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really should use types but this looks good

if (valueToUpdate == newImageTag.ContainerReference.Tag)
{
alreadyUpToDate.Add(newImageTag.ContainerReference.Tag);
alreadyUpToDate.Add(newImageTag.ContainerReference.FriendlyName());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if the imagesToUpdate and alreadyUpToDate should be lists of ContainerImageReference rather than string lists - that way we'd have better type protections.

Otherwise, the fix looks good.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then are you thinking ImageReplacementResult will reference ContainerImageReference instead of strings @rain-on ?

That can be done in a separate PR

@flin-8 flin-8 merged commit 1a2175b into main Apr 22, 2026
33 checks passed
@flin-8 flin-8 deleted the scme/fix/tag-friendly-name-bug branch April 22, 2026 03:10
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.

3 participants