Open jeremych1000 opened 5 days ago
@jeremych1000 Are you saying you also want to lint the YAML and not just show the diff, is that correct?
I wonder if just updating the CLI with --lint
would be good (instead of changing the behavior).
Or are you saying this worked before and now it's not?
@jeremych1000 Are you saying you also want to lint the YAML and not just show the diff, is that correct?
I wonder if just updating the CLI with
--lint
would be good (instead of changing the behavior).Or are you saying this worked before and now it's not?
Yes both.
I would've expected app diff with server side generate to verify the desired manifests against the Kubernetes schema - this is not the case.
A -lint option would be amazing, assuming it does validate the Kubernetes schema and not just valid YAML e.g. replicas: foobar
is valid YAML but not valid Kubernetes manifest so would be invalid, and that it can be run for desired manifests i.e. against a specific revision/branch, or local chart that's WIP (likely as part of argocd app diff).
Happy to answer any further questions!
To confirm, I would expect this to have failed (server side diff enabled, server side generate on).
===== apps/Deployment heartbeat/heartbeat ======
--- /tmp/argocd-diff2895682643/heartbeat-live.yaml 2024-06-27 13:15:11.305950685 +0000
+++ /tmp/argocd-diff2895682643/heartbeat 2024-06-27 13:15:11.305950685 +0000
@@ -13,8 +13,9 @@
resourceVersion: "110284644"
uid: 0c403e5b-f950-4b9a-95d3-f787b570b95c
spec:
+ apples: oranges
progressDeadlineSeconds: 600
- replicas: 1
+ replicas: false
revisionHistoryLimit: 10
selector:
matchLabels:
Checklist:
argocd version
.Describe the bug
I have a repo of helm charts, and use
argocd app diff
to generate diffs in PRs about what's changed. For example, if I edit a helm values replicas from 2 to 3, argocd app diff will show me this. This has worked well before.However, I also want this to validate that the YAMLs are valid. For example,
replicas: apples
is valid YAML, so argocd app diff won't fail. However, it will obviously fail when it gets applied to Kubernetes.I tried to enable server side diffing for argo itself, as well as
--server-side-generate
for argocd app diff. I thought this meant argo tries to dryrun=server apply my invalid YAML to Kubernetes and it should error out - but it doesn't.To Reproduce
replicas: apples
argocd app diff xyz --revision xyz --server-side-generate
Expected behavior
Screenshots
desired deployment.yaml (replicas: false +apples should both invalidate this manifest)
Version
Logs