-
Notifications
You must be signed in to change notification settings - Fork 3.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
Lifecycle hooks are broken when applying via ConfigMap #11095
Comments
@adrvolan it looks like a merging issue with |
Hi @sarabala1979, thank you for your reply
And after creating it:
The hook node even shows in the UI as |
|
Any hook in workflowDefaults will cause `Error: merging object in json but data type is not struct, instead is: map`. This is down to how StrategicMergePatch handles maps of objects and limitations in merging them (a starting point for understading this is golang/go#33487). Instead, we copy the map of hooks, patch it out of the patch, perform the merge as before and then manually apply it. fixes: argoproj#11095 Signed-off-by: Alan Clucas <[email protected]>
Pre-requisites
:latest
What happened/what you expected to happen?
Hi, I've been trying to add a new lifecycle hook to all my Workflows using ConfigMaps.
To keep it simple, when I try to add a deprecated
onExit
hook, everything works smoothly, but when I try to apply it via the newhooks: {exit:{...}}
all of the Workflows return a status codeError: merging object in json but data type is not struct, instead is: map
You can see the hooks in the manifest, and in the Argo UI, but Tasks return with an
Error
and never go out of thePending
stateI've managed to dig a little bit into the code to find out it is an error in
setExecWorkflow
and its call stack but that's as far as my non existent Go knowledge let me.The above is just an example of two implementations that do the same but one works, the other does not, and I would prefer to stick to the new one, as new hooks with expressions are something that would interest me the most.
I will attach the ConfigMap instead of a Workflow, as you can test it with any simple or default one that the UI proposes. Any other ConfigMap outside of
hooks
inworkflowDefaults
works just fine on my local setup.If there is a workaround to run a separate node 'next to' the main workflow without knowing what's inside of it, I would be more than glad to hear about it.
Version
Tested on 3.4.7 and 3.9.9
Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.
Logs from the workflow controller
Logs from in your workflow's wait container
The text was updated successfully, but these errors were encountered: