-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(controller): when updating a values.yaml, make sure image tags that look like a number are still treated as strings #1315
Conversation
Signed-off-by: Maksim Stankevic <maksim.stankevic1@gmail.com>
❌ Deploy Preview for docs-kargo-akuity-io failed.
|
@@ -125,7 +125,7 @@ func buildValuesFilesChanges( | |||
tagsByImage := map[string]string{} | |||
digestsByImage := make(map[string]string, len(images)) | |||
for _, image := range images { | |||
tagsByImage[image.RepoURL] = image.Tag | |||
tagsByImage[image.RepoURL] = "'" + image.Tag + "'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break things farther down on lines 155 to 161.
Just change line 160.
@@ -321,8 +321,8 @@ func TestBuildValuesFilesChanges(t *testing.T) { | |||
t, | |||
map[string]map[string]string{ | |||
"fake-values.yaml": { | |||
"fake-key": "fake-url:fake-tag", | |||
"second-fake-key": "second-fake-tag", | |||
"fake-key": "fake-url:'fake-tag'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case demonstrates the problem I mentioned here.
fake-url:'fake-tag'
isn't a valid image identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Maksim Stankevic <maksim.stankevic1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @maksimstankevic!
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1315 +/- ##
==========================================
- Coverage 48.87% 45.82% -3.05%
==========================================
Files 127 135 +8
Lines 9763 11556 +1793
==========================================
+ Hits 4772 5296 +524
- Misses 4831 6069 +1238
- Partials 160 191 +31 ☔ View full report in Codecov by Sentry. |
Fixes #876