You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
I have searched existing issues and could not find a match for this bug
When attempting to lint a CronWorkflow definition file, argo lint does not detect keys with incorrect capitalisation. If these are applied using kubectl, then the cron workflow does not work as expected. Using argo cron create works, as this tool appears to correct the capitalisation.
See example below, with upper case U in schedUle. I would expect argo lint to produce an error. Instead it produces the following:
➜ argo lint cronWorkflow.yaml
✔ no linting errors found!
Version
v3.5.6
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.
agilgur5
added
area/cli
The `argo` CLI
P2
Important. All bugs with >=3 thumbs up that aren’t P0 or P1, plus: Any other bugs deemed important
labels
May 3, 2024
I checked a bit the codebase and it seems that the issues traces to the case-insensitivity from golang's encoding/json. The encoding/json will unmarshal both schedule and schedUle and therefore the argo lint command will not complain.
We could use a json package from kubernetes-sigproject , which allows unmarshaling with case-sensitive field tags. That will work only on the strict mode and the spec.schedUle will be reported as an unknown field. On non-strict it will not be reported, cause of the unknown field opt not enabled.
However since the jsonpkg is coming from argoproj/pkg it will always accept something like schedUle when you submit the wf. And finally another option would be to develop a checker for the keys against the schema which will be a bit more complicated approach.
edit: argo lint is by default running on strict mode
However since the jsonpkg is coming from argoproj/pkg
In which part of the code? Both encoding/json and argoproj/pkg/json are imported in a lot of places 😅
But I imagine we can similarly just substitute in the apimachinery package. Could potentially even add an additional wrapper method to argoproj/pkg if needed.
Pre-requisites
:latest
image tag (i.e.quay.io/argoproj/workflow-controller:latest
) and can confirm the issue still exists on:latest
. If not, I have explained why, in detail, in my description below.What happened/what did you expect to happen?
When attempting to lint a
CronWorkflow
definition file,argo lint
does not detect keys with incorrect capitalisation. If these are applied usingkubectl
, then the cron workflow does not work as expected. Usingargo cron create
works, as this tool appears to correct the capitalisation.See example below, with upper case
U
inschedUle
. I would expectargo lint
to produce an error. Instead it produces the following:Version
v3.5.6
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: