Skip to content
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

The status field in the CRDs causes a perpetual diff in ArgoCD #700

Open
ribbybibby opened this issue Jun 27, 2020 · 3 comments
Open

The status field in the CRDs causes a perpetual diff in ArgoCD #700

ribbybibby opened this issue Jun 27, 2020 · 3 comments
Labels
bug Something isn't working production issue triaged

Comments

@ribbybibby
Copy link
Contributor

What steps did you take and what happened:
ArgoCD always identifies a diff in the status field when syncing the configs.config.gatekeeper.sh and constrainttemplates.templates.gatekeeper.sh CRDs.

I believe this happens because both CRDs contain an empty status field that is immediately updated by the api server upon apply:

status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []

ArgoCD identifies this as a difference between git and the live cluster state (which it is).

Omitting the status field entirely should resolve this problem.

What did you expect to happen:
ArgoCD to sync the CRDs successfully without a diff being identified.

Anything else you would like to add:
This can be worked around in ArgoCD by ignoring differences in the status field:

  ignoreDifferences:
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      name: configs.config.gatekeeper.sh
      jsonPointers:
        - /status
    - group: apiextensions.k8s.io
      kind: CustomResourceDefinition
      name: constrainttemplates.templates.gatekeeper.sh
      jsonPointers:
        - /status

Environment:

  • ArgoCD version: 1.6.1
  • Gatekeeper version: 3.1.0-beta.9
  • Kubernetes version: (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T23:35:15Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.3", GitCommit:"2e7996e3e2712684bc73f0dec0200d64eec7fe40", GitTreeState:"clean", BuildDate:"2020-05-20T12:43:34Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
    
@ribbybibby ribbybibby added the bug Something isn't working label Jun 27, 2020
@maxsmythe
Copy link
Contributor

This is the generated CRD output from controller-gen, it might be useful to fix this generally, as no manifest should have status included.

@maxsmythe
Copy link
Contributor

filed: kubernetes-sigs/controller-tools#456

@knanao
Copy link

knanao commented Mar 28, 2023

This issue was resolved by #2466, so you can use v3.12.0-rc.0 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working production issue triaged
Projects
None yet
Development

No branches or pull requests

4 participants