-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix(cli): argo lint
with strict should report case-sensitive errors. Fixes #13006
#13250
Conversation
Signed-off-by: Miltiadis Alexis <alexmiltiadis@gmail.com>
e23a5ba
to
8b4147d
Compare
Signed-off-by: Miltiadis Alexis <alexmiltiadis@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy with this.
@agilgur5, I notice you were discussing making pkg
do this strict check instead of doing it in here. That feels slightly better as an approach, but I don't want to block this on that. Would you rather we went that way?
argo lint
with strict should report case-sensitive errors. Fixes #13006
In #13006 (comment) I was primarily concerned about the scenario of "strict + case-sensitive". If the k8s variant handles this, then perhaps the functions in But if we wanted to, we could add this as an additional function in |
…Fixes argoproj#13006 (argoproj#13250) Signed-off-by: Miltiadis Alexis <alexmiltiadis@gmail.com> Co-authored-by: Alan Clucas <alan@clucas.org>
Fixes #13006
Motivation
Currently, when linting a
CronWorkflow
definition file,argo lint
fails to detect keys with incorrect capitalization. This oversight can lead to unexpected behavior when applying these definitions usingkubectl
. Prior to this fix,argo cron create
would ignore capitalization issues and proceed with the provided values, creating an inconsistency betweenkubectl
andargo cron create
behaviors.By addressing this issue, we aim to:
argo cron create/argo submit
withkubectl
, ensuring both tools report errors for incorrectly capitalized fields.This change will help prevent potential errors by catching and reporting capitalization issues uniformly across all relevant tools.
Modifications
To address this issue, we've made the following change:
Modified the strict path of the linting process to utilize the
sigs.k8s.io/json
library for unmarshaling.k8s.io/apimachinery/pkg/runtime
library.This change ensures that
argo lint
will now flag incorrectly capitalized fields when strict mode is enabled, providing developers with immediate feedback on potential issues in their workflow definitions. It also aligns the behavior ofargo lint
andargo cron create/argo submit
withkubectl
, creating a consistent experience across these tools.Verification
To validate the effectiveness of this fix, I have extended the test suite with two new unit tests: