Skip to content
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

helm render not working properly when used with a profile + patch profiles (specifically patch on setValues) #8100

Open
aaron-prindle opened this issue Nov 15, 2022 · 3 comments
Labels
area/profiles area/render deploy/helm kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@aaron-prindle
Copy link
Contributor

For context see:
#8002 (comment)

#8002 (comment)

@aaron-prindle
Copy link
Contributor Author

aaron-prindle commented Nov 16, 2022

@alewis001 I have have not pinpointed why but in my testing it seems that in Skaffold v1 empty fields/replacements were marked empty in the rendered yaml but in Skaffold v2 they are marked null. This at least explains why null is shown in the Skaffold v2 render outputs:
image

I believe these are identical in practice though in respects to yamls schema

@aaron-prindle aaron-prindle changed the title helm render not working properly when used with a profile + patch profiles helm render not working properly when used with a profile + patch profiles (specifically path on setValues, perhaps issue is broader) Nov 16, 2022
@aaron-prindle aaron-prindle changed the title helm render not working properly when used with a profile + patch profiles (specifically path on setValues, perhaps issue is broader) helm render not working properly when used with a profile + patch profiles (specifically patch on setValues, perhaps issue is broader) Nov 16, 2022
@aaron-prindle aaron-prindle changed the title helm render not working properly when used with a profile + patch profiles (specifically patch on setValues, perhaps issue is broader) helm render not working properly when used with a profile + patch profiles (specifically patch on setValues) Nov 16, 2022
@aaron-prindle
Copy link
Contributor Author

aaron-prindle commented Nov 16, 2022

@alewis001 to clarify, does this work in Skaffold v1? Currently I believe this is likely related to an issue where setValues is likely nil (vs list of length 0) so when the patch profile attempts to modify it, it is not able to properly add this first entry. I'm a bit confused though if this is working-as-intended given patch profiles or a regression (sorry if you have already state this prior, I was a bit confused about what was related to StatefulSet usage and what was related to profile usage)

@alewis001
Copy link
Contributor

@aaron-prindle No problem. The Deployment vs StatefulSet issue meant that the image value was populated but, it didn't have the repo name and image digest. With your changes on main, that issue is fixed.

This secondary (and appears to be unrelated to the one above) issue is that if you specify a Skaffold profile, and that profile has a setValues section, the value for the image attribute is whatever the Helm template command populates rather than what Skaffold normally adjusts as the post-renderer.

The skaffold.v2beta16.yaml file I attached in this comment to #8002 works fine with Skaffold v1 (E.g. skaffold render -p minikube --default-repo <repo>. When that same file and command is run with Skaffold v2, the image value is populated with just the Helm generated value rather than the Skaffold adjusted value.

In my case, because of following the Skaffold v1 docs (and at least my understanding of those docs at the time), I don't have an image value in my Helm chart's values files as it's Skaffold that populates it when processing the templates. I.e. My template has image: {{ .Values.image }} but I don't have image: <something> in the values file(s).

With Skaffold v1, this works. With Skaffold v2, when a profile (and the setValues section in the profile) is specified, the rendered manifests have null for the image because I don't have an image value in values files.

Maybe to avoid the confusion around the null image value.... If in values.yaml I had image: alex, when I run skaffold render -p minikube --default-repo <repo> using Skaffold v2, the rendered output will have image: alex rather than what Skaffold would normally set which is image: <repo>/alex:<tag>@sha256:<hash>.

Hopefully that helps clarify things but please let me know if not 😄

@tejal29 tejal29 added the priority/p1 High impact feature/bug. label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/profiles area/render deploy/helm kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
Development

No branches or pull requests

3 participants