Comments (5)
On a private App with 3 sources, the diff is even stranger: as if it completely removed the resources for the first source (it's a helm release with value.yaml file from the 3rd source, using ref).
I just upgraded to ArgoCD v2.11 and wanted to try out this new feature and I'm facing the same problem. In ArgoCD I have several apps with two sources, one a helm chart and the other values in a git repository. When I run argocd app diff my-app --revisions 1234 --source-positions 1 --revisions 1234 --source-positions 2
the diff shows me that everything is removed (the revisions I tested against where some where no changes should be expected).
My application spec is basically looking the same as the one posted by @thomas-riccardi, except I only use one additional repoURL source.
from argo-cd.
I reproduce the issue with the new rc3:
argocd: v2.11.0-rc3+20fd621
BuildDate: 2024-04-29T20:18:11Z
GitCommit: 20fd621aa20d546378d4643862054307773a1dd0
GitTreeState: clean
GoVersion: go1.21.9
Compiler: gc
Platform: linux/amd64
argocd-server: v2.11.0-rc3+20fd621
BuildDate: 2024-04-29T19:57:20Z
GitCommit: 20fd621aa20d546378d4643862054307773a1dd0
GitTreeState: clean
GoVersion: go1.21.9
Compiler: gc
Platform: linux/amd64
Kustomize Version: v5.2.1 2023-10-19T20:13:51Z
Helm Version: v3.14.3+gf03cc04
Kubectl Version: v0.26.11
Jsonnet Version: v0.20.0
from argo-cd.
@thomas-riccardi , I am curious to see the app spec you are creating. Based on the step mentioned in setup, the command
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default
would create a single source app and not a multi-source app.
I also just tried the command on release 2.11.0-rc3
locally and below is what I see the diff as post sync:
% ./dist/argocd app diff guestbook --revisions 4171e73dec711bde9a130398d3cfc93363b16339 --source-positions 1
===== apps/Deployment default/guestbook-helm-guestbook ======
133c133
< replicas: 4
---
> replicas: 3
Can you share an example of the application that I could use to see the issue?
from argo-cd.
I am curious to see the app spec you are creating
Indeed my reproduction here came after my initial issue with private app. My hope is that fixing the issue with mono-source apps would also fix my issue with multi-source app.
Here is an anonymized version of my private multi-source app:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: foo
namespace: argocd
ownerReferences:
- apiVersion: argoproj.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: ApplicationSet
name: foo-appset
spec:
destination:
namespace: foo
server: https://kubernetes.default.svc
project: myproject
sources:
- helm:
releaseName: my-helm-release
valueFiles:
- $values/some/path/to/value.yaml
values: |
more: values
path: charts/some-chart/
repoURL: https://github.com/bar/foo-helm-charts
targetRevision: main
- path: /baz
repoURL: https://github.com/bar/other-resources-to-load
targetRevision: main
- ref: values
repoURL: https://github.com/bar/foo-values
targetRevision: main
syncPolicy:
syncOptions:
- CreateNamespace=true
I also just tried the command on release 2.11.0-rc3 locally and below is what I see the diff as post sync:
Maybe it's related to the way we deploy our argocd? (with the helm chart); so I tried with kind locally:
$ kind version
kind v0.22.0 go1.20.13 linux/amd64
$ kind create cluster
$ kubectl get node
NAME STATUS ROLES AGE VERSION
kind-control-plane Ready control-plane 22s v1.29.2
$ kubectl apply -n argocd -f https://github.com/argoproj/argo-cd/raw/master/manifests/install.yaml
$ kubectl port-forward svc/argocd-server -n argocd 8080:443 &
$ argocd admin initial-password -n argocd
$ argocd login localhost:8080
# I then saw it was not the rc3, so I (down?)graded to 2.11.0-rc3:
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v2.11.0-rc3/manifests/install.yaml
# wait pod ready
=> Then I reproduce as in my initial comment: result: I still get the bug: no diff with the new options.
from argo-cd.
Unfortunately, the problem still exists with the latest ArgoCD v2.11.1. I also tested it with the guestbook single source application above and found the following:
It seems that the --revisions
and --source-positions
do not change the actual commit SHA compared to the deployed state in the diff. You can see this quite clearly by comparing it to the "old" --revision
.
What I did:
- Deployed the guestbook app:
argocd app create guestbook --repo https://github.com/argoproj/argocd-example-apps.git --path guestbook --dest-server https://kubernetes.default.svc --dest-namespace default
- Changed the replicas manually from 1 to 2
- Executed:
argocd app diff guestbook --revisions b0decab622473b6526a7025b2b52e2a6301dd83a --source-positions 1
(Notice that the revisions is different to HEAD!)
===== apps/Deployment default/guestbook-ui ======
109c109
< replicas: 2
---
> replicas: 1
- Executed the "old" diff check:
argocd app diff guestbook --revision b0decab622473b6526a7025b2b52e2a6301dd83a
===== /Service default/guestbook-ui ======
1,56d0
< apiVersion: v1
< kind: Service
< metadata:
< annotations:
< kubectl.kubernetes.io/last-applied-configuration: |
< {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"labels":{"argocd.argoproj.io/instance":"guestbook"},"name":"guestbook-ui","namespace":"default"},"spec":{"ports":[{"port":80,"targetPort":80}],"selector":{"app":"guestbook-ui"}}}
< labels:
< argocd.argoproj.io/instance: guestbook
< managedFields:
< - apiVersion: v1
< fieldsType: FieldsV1
< fieldsV1:
< f:metadata:
< f:annotations:
< .: {}
< f:kubectl.kubernetes.io/last-applied-configuration: {}
< f:labels:
< .: {}
< f:argocd.argoproj.io/instance: {}
< f:spec:
< f:internalTrafficPolicy: {}
< f:ports:
< .: {}
< k:{"port":80,"protocol":"TCP"}:
< .: {}
< f:port: {}
< f:protocol: {}
< f:targetPort: {}
< f:selector: {}
< f:sessionAffinity: {}
< f:type: {}
< manager: argocd-controller
< operation: Update
< time: "2024-05-22T07:27:42Z"
< name: guestbook-ui
< namespace: default
< resourceVersion: "612483492"
< uid: d326e40a-8ae6-4400-8085-b293e7d858ba
< spec:
< clusterIP: 10.236.108.68
< clusterIPs:
< - 10.236.108.68
< internalTrafficPolicy: Cluster
< ipFamilies:
< - IPv4
< ipFamilyPolicy: SingleStack
< ports:
< - port: 80
< protocol: TCP
< targetPort: 80
< selector:
< app: guestbook-ui
< sessionAffinity: None
< type: ClusterIP
< status:
< loadBalancer: {}
===== apps/Deployment default/guestbook-ui ======
1c1
< apiVersion: apps/v1
---
> apiVersion: apps/v1beta2
109c109
< replicas: 2
---
> replicas: 1
In this example, you can see that the new diff feature does not use the different commit SHA.
@ishitasequeira, in your example above, did you also run the diff command with a different commit SHA than the one from HEAD? Also, can you take a look at this issue
from argo-cd.
Related Issues (20)
- application-controller hung mid-processing
- Add livenessProbe for argocd-application-controller HOT 1
- Large binary log output in Loki
- Server-Side Diff shows OutOfSync despite ignoreDifferences enabled and slow reconciliation performance
- Refresh Failed: can not refresh repository which contains submodules cause argocd modified some files
- helm post-delete hooks is not working with argocd as expected
- argocd-redis secret-init initcontainer timeout HOT 10
- The order of sources (git/helm) in multi-source application matters in case of app diff & manifests features HOT 1
- AppProjects don't check all namespaces before finalizing deletion HOT 1
- Concurrency Issue with Slugify Function HOT 1
- UI error
- Unable to override json value when using multiple sources to build argocd application HOT 1
- Generic Web API Provider Configuration
- argocd app sync --preview-changes actually performes sync HOT 1
- Argo CD validating duplicate variables and causing sync issues HOT 1
- ArgoCD webhook refresh causes apps to go into Unknown state
- The pod log view dark mode toggle fails to set the log background to dark when activated
- Docs - site is confused about current version HOT 1
- Mitigate issues with helm charts using the 'app.kubernetes.io/instance' label
- Same CRDs deployed by two ArgoCD apps causes loop and memory exhaustion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argo-cd.