-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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: correct issues with current upgrade logic for artifactOverrides with helm imageStrategy #8066
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
@@ -200,6 +200,12 @@ func (r *imageReplacer) Visit(gk apimachinery.GroupKind, navpath string, o map[s | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible that any other regular scenario will conflict with this conditional?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
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