-
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
How to add additional images and helm deployments with override via patch? #2741
Comments
hey @quick-question. this behavior should be supported in skaffold - can you try doing |
That does not seem to work either. I am getting this error: I'll also mention that this is occurring on v0.35.0 |
@nkubala Could you provide an example of how someone might have two profiles that add their artifacts and releases via override by patch? I haven't been able to find a good example in the docs. |
ah, ok nevermind my JSON patch knowledge was a little off, I realize that the trailing are you depending on the ordering of your build/deploy artifacts? if not you should just be able to remove that hyphen and get the same results. |
Hmm according to http://jsonpatch.com/ that should be a valid:
Is that not supported in this case? |
Great, I'll give that a try tomorrow and see if that works! |
Sorry for the delay. I will be trying this out later today. |
Well sorry again for the delay! @nkubala Unfortunatley, removing the hyphens did not work. |
I suppose I have an issue very close to this one. Consider the following apiVersion: skaffold/v1beta15
kind: Config
build:
tagPolicy: {}
profiles:
- name: preview
patches:
- op: replace
path: /build/tagPolicy
value:
gitCommit: {}
When I run: > skaffold -v debug build --profile=preview The output is the following:
As a result I simply cannot make Skaffold profiles work. What I am trying to achieve is to have different tagging strategies in different profiles. |
Can we at least get an example of how to use multiple profiles in the documentation? |
Any updates on this? |
I am having the same issue. This seems to be a bug. The syntax works if the array is not empty though. |
ok, I think I puzzled this one out. the short answer is that there's an issue in the yamlpatch library we're using, but if you care about an explanation and then possible workarounds, read on... we use the yamltag @prokher was close in his example of trying to specify a dummy value for the what you actually want is build:
tagPolicy:
dateTime: {} and then your example will work. apiVersion: skaffold/v1beta15
kind: Config
build:
tagPolicy:
dateTime: {}
profiles:
- name: preview
patches:
- op: replace
path: /build/tagPolicy
value:
gitCommit: {} alternatively, you can use the apiVersion: skaffold/v1beta15
kind: Config
build:
tagPolicy: {}
profiles:
- name: preview
patches:
- op: add
path: /build/tagPolicy
value:
gitCommit: {} @quick-question as for combining artifacts, I was able to get this to work on version 1.1.0 using this yaml: profiles:
- name: tag1
patches:
- op: add
path: /build/artifacts/-
value:
image: gcr.io/nkubala-demo/image1
context: . # this is just to show that it unmarshals correctly
- name: tag2
patches:
- op: add
path: /build/artifacts/-
value:
image: gcr.io/nkubala-demo/image2 applying this to the
so the hyphens do work as expected. but, we still have the issue of things breaking down when an empty value is provided through the original skaffold.yaml. @agarciatome I agree that an empty array should be no exception....but unfortunately it is because of a bug in the yamlpatch library, so this is out of our control. you'll need to provide at least one valid artifact in your top level skaffold.yaml. hopefully this was helpful. |
Thank you @nkubala for a such a great answer! But this answer means, that there is no way to solve it, because there is no corresponding issue in https://github.com/krishicks/yaml-patch repo |
@nkubala Indeed, thank you for your great answer! |
@nkubala thanks a lot for your detailed answer. I'll try to work around my scenario then! |
@kvokka unfortunately that's correct. maybe you can follow up with an issue on that repo? hopefully you all can find ways to work around this in your projects. providing any non-nil values will enable using the |
Another workaround here is to have a profile that adds a default artifacts, and a second that strips it out. Unfortunately this doesn't interact well with |
I'm attempting to use profiles to facilitate building and deploying multiple apps (using helm charts) at the same time. For example,
skaffold run -p app1,app2
but I can't seem to get it to work.The profiles each look like this:
Can anyone tell me what I am doing wrong or provide an example?
The text was updated successfully, but these errors were encountered: