fix: correct issues with current upgrade logic for artifactOverrides with helm imageStrategy#8066
Conversation
Codecov Report
@@ Coverage Diff @@
## main #8066 +/- ##
==========================================
- Coverage 70.48% 66.50% -3.99%
==========================================
Files 515 597 +82
Lines 23150 29171 +6021
==========================================
+ Hits 16317 19399 +3082
- Misses 5776 8332 +2556
- Partials 1057 1440 +383
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
21b2de5 to
de108bd
Compare
ddfab49 to
ab17181
Compare
3e91bec to
dcd7e19
Compare
162e11f to
be474c9
Compare
| log.Entry(context.TODO()).Debugf("Couldn't parse image [%s]: %s", image, err.Error()) | ||
| return false | ||
| } | ||
| // this is a hack to properly support `imageStrategy=helm+explicitRegistry` from Skaffold v1.X.X |
There was a problem hiding this comment.
can you add a bit more detail about this hack? Like with an example of image value, and why we're setting BaseName to Repo.
There was a problem hiding this comment.
is it possible that any other regular scenario will conflict with this conditional?
There was a problem hiding this comment.
I don't believe there is realistically any regular scenario where this will conflict. I have tried with both artifact/artifactOverrides names of the format:
artifacts:
- image: gcr.io/aprindle-test-cluster/skaffold-helm
artifacts:
- image: skaffold-helm
and this works for both cases
There was a problem hiding this comment.
Updated the comment to have more explanation:
// this is a hack to properly support `imageStrategy=helm+explicitRegistry` from Skaffold v1.X.X which has the form:
// image: "{{.Values.image.registry}}/{{.Values.image.repository}}:{{.Values.image.tag}}"
// works by looking for intermediate helm replacement of the form image: <artifactName>/<artifactName>:<artifactName>
// and treating that as just <artifact> by modifying the parsed representation.
gsquared94
left a comment
There was a problem hiding this comment.
lgtm, but please add some more text about the hack logic.
c100fec to
00074ec
Compare
a1cf201 to
c211ee7
Compare
…with helm imageStrategy + multiple-images
c211ee7 to
cbf2e74
Compare
Initially artifactsOverrides and imageStrategy were removed in skaffold v2 as we now use skaffold as a helm --post-renderer. In our upgrade.go for v2beta29 we had some logic added that would migrate people that used those fields to setValues and setValueTemplates. The upgrade.go logic here though did not work properly for multi-config projects as setValueTemplates has unfriendly behaviour when used with multi-config images as noted in #5317. As such this new PR changes upgrade.go to use all setValueTemplates replacements and adds a helm multi-config example as an integration test. This docs PR below might help to explain this a bit as well:
#8093