gitops-operator icon indicating copy to clipboard operation
gitops-operator copied to clipboard

Diffs not being detected

Open jesusmah opened this issue 1 year ago • 0 comments

Describe the bug I have used the GitOps operator to get a service resource created in. my openshift cluster. It does get created fine according to its definition in Git. However, if I then add stuff to that service resource definition straight from the OpenShift UI, ArgoCD does not detect the diff and therefore does not remediate such manual change which breaks the foundation of GitOps.

To Reproduce Steps to reproduce the behavior:

  1. Create a service definition in Git like
apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/name: es-starter-app
  name: es-starter-app
spec:
  ports:
  - name: http
    port: 8080
    targetPort: 8080
  selector:
    name: es-starter-app
  type: ClusterIP
  1. Create an ArgoCD Application that points to the github repo where that service is defined.
  2. Check that the service is properly created in OpenShift.
  3. Through the OpenShift web UI, inspect that service in its yaml tab and add the following fake port to its spec
  - name: fake
    port: 8000
    targetPort: 8000
  1. Click save
  2. Wait as long as you want or even force sync the ArgoCD app in ArgoCD web UI. ArgoCD does not detect the diff and therefore does not remediate the change

Expected behavior ArgoCD should have detected the diff between the service definition in GIt, the source of truth, and the current existing living manifest of that service in the cluster and remediate it so that it matches the source of truth.

Screenshots Live Manifest

image

Desired manifest

image

Diff (its empty, it does not detect a diff and therefore no remediation happens)

image

Additional context

Im using GitOps Operator version 1.11.0 This is the ArgoCD version that ships:

{
    "Version": "v2.9.2+c5ea5c4",
    "BuildDate": "2023-12-01T19:21:49Z",
    "GitCommit": "c5ea5c4df52943a6fff6c0be181fde5358970304",
    "GitTreeState": "clean",
    "GoVersion": "go1.20.10",
    "Compiler": "gc",
    "Platform": "linux/amd64",
    "KustomizeVersion": "v5.2.1 unknown",
    "HelmVersion": "v3.13.2+g2a2fb3b",
    "KubectlVersion": "v0.24.2",
    "JsonnetVersion": "v0.20.0",
    "ExtraBuildInfo": "{Vendor Information: Red Hat OpenShift GitOps version: v1.11.0}"
}

I found a similar issue filed against ArgoCD (but no work done against it at all) --> https://github.com/argoproj/argo-cd/issues/16092

jesusmah avatar Jan 05 '24 18:01 jesusmah