Skip to content

Detect version mismatch in embedded image tags#19

Merged
ChrisJBurns merged 1 commit intomainfrom
fix/detect-version-mismatch
Jan 29, 2026
Merged

Detect version mismatch in embedded image tags#19
ChrisJBurns merged 1 commit intomainfrom
fix/detect-version-mismatch

Conversation

@ChrisJBurns
Copy link
Collaborator

Summary

  • Adds detection for version mismatches when updating YAML files with embedded versions (e.g., image tags)
  • Returns a clear error message when the expected version isn't found, instead of silently corrupting the value
  • Prevents broken image references like image: v1.0.1 (instead of image: ghcr.io/repo:v1.0.1)

Background

This fixes the issue seen in stacklok/toolhive#3515 where image URLs were being stripped and replaced with just the version tag because the VERSION file didn't match the embedded versions in values.yaml.

Example Error Message

version mismatch in deploy/charts/operator/values.yaml at path operator.image:
expected to find "v0.8.2" but found "v0.8.1" in value "ghcr.io/stacklok/toolhive/operator:v0.8.1".
This usually means the file was not updated in a previous release.
Please manually update the version in this file to "v0.8.2" before running releaseo

Test plan

  • Added unit tests for findEmbeddedVersion() function
  • Added unit tests for version mismatch detection in UpdateYAMLFile()
  • All existing tests pass

🤖 Generated with Claude Code

Previously, when updating YAML files with embedded versions (e.g., image
tags like `ghcr.io/repo:v1.0.0`), if the expected version wasn't found,
releaseo would silently replace the entire value with just the version
string, resulting in broken image references like `image: v1.0.1`.

This change detects when a value contains an embedded version that
doesn't match the expected current version and returns a clear error
message explaining the mismatch and how to fix it.

Example error:
  version mismatch in values.yaml at path operator.image:
  expected to find "v0.8.2" but found "v0.8.1" in value
  "ghcr.io/stacklok/toolhive/operator:v0.8.1".
  This usually means the file was not updated in a previous release.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChrisJBurns ChrisJBurns merged commit add86e3 into main Jan 29, 2026
3 checks passed
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.

1 participant