-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Question] Setting 'suspend' parameter in Argo Cron workflow based on overlay #3449
Comments
We have some quote issues in 3.9.x version #3412. Can you try 3.8.x version and see if the issue still happens? |
Thanks for your quick response! I actually tried it with two different versions:
Same result in both versions. |
Still open. See test in #3472 for a possible workaround (source the var from something other than a configmap, as that can only hold strings). A code fix could be, when doing a var replacement, see if the origin was a configmap, and if so, be skeptical of the string type. If the target of the replacement is not a string type, then attempt to parse the replacement value as that type (e.g. if the target field has a bool tag, then try to parse the incoming string ( The trouble is that the target field is probably tagged as a string, even if it should be a boolean, because it holds, temporarily, a string with a dollar variable. In the case of the test in #3472, the field is
This has the tag Vars (dollar variables) have always been a problem-causing hack in kustomize and they need to be deprecated (#2052). We need a ReplacementTransformer (started here) that replaces a bool for a bool, an int for an int, etc., not needing these string targets sprinkled in the yaml. |
Thank you for the explanation! Yeah, I agree, just guessing the type of the value isn't ideal either and will likely cause other issues. I'm not very familiar with kustomize but my naive solution would have been making types explicit in the configmap, something like this:
No idea if this causes other issues or if this is a major change in how ConfigMaps work. But your suggestion of a ReplacementTransformer looks interesting too, I will have a look into it! I also haven't had time to try your suggested workaround but I will report back as soon as I get to it. Thank you again for your help here! |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Rotten issues close after 30d of inactivity. Send feedback to sig-contributor-experience at kubernetes/community. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hey guys,
We're using Argo Cron Workflows for our daily load pipeline into our data warehouse. We have several environments which are configured via overlays and we have environments like prod, dev, uat, etc.
Argo Cron Workflows have a field called suspend, which determines if a workflow should be started based on provided cron schedule. I would like to suspend the cron workflow based on the environemnt (only have it execute in prod). Currently, we just disabled the deployment but I think the suspend paramter is a better solution.
What I was thinking is to overwrite the suspend (true / false) parameter in the overlay like this:
Argo Cron Workflow
My kustomization file looks like this:
kustomization-config.yaml looks like this
in overlays/dev/vars.env I have:
However, when I execute
kustomize build overlays/dev
(output below), theTrue
parameter is wrapped in quotes, which breaks parsing of the workflow definition in argo:When I then try to use kubectl to apply the kustomized template, argo shows the following error:
Without the suspend parameter, it works fine.
I'd appreciate any ideas how I could solve this. I could probably just overwrite the cron schedule to something that will never execute but I feel like this is a very hacky solution.
Thanks!
The text was updated successfully, but these errors were encountered: