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

Unable to ignore differences in metadata annotations #2918

Closed
yujunz opened this issue Dec 26, 2019 · 6 comments
Closed

Unable to ignore differences in metadata annotations #2918

yujunz opened this issue Dec 26, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@yujunz
Copy link
Contributor

yujunz commented Dec 26, 2019

Describe the bug

Trying to ignore the differences introduced by kubedb-operator on the ApiService but failed.

To Reproduce

  1. configure kubedb argo application to ignore differences
  ignoreDifferences:
  - kind: APIService
    name: v1alpha1.validators.kubedb.com
    jsonPointers:
    - /spec/caBundle
    - /metadata
  1. Install kubedb with argocd
  2. Wait for reconcile

Expected behavior

Differences ignored as configured

Screenshots

Screen Shot 2019-12-26 at 10 20 10 AM

Version

argocd: v1.3.0+b624c5c
  BuildDate: 2019-12-09T02:36:59Z
  GitCommit: b624c5c054e7cd26a196c865556e9736409abaa4
  GitTreeState: clean
  GoVersion: go1.13
  Compiler: gc
  Platform: darwin/amd64
argocd-server: v1.3.0+03acca8
  BuildDate: 2019-12-09T02:22:55Z
  GitCommit: 03acca8ef7de8070fca58539c046f9b64345d6a1
  GitTreeState: clean
  GoVersion: go1.12.6
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: Version: {Version:kustomize/v3.2.1 GitCommit:d89b448c745937f0cf1936162f26a5aac688f840 BuildDate:2019-09-27T00:10:52Z GoOs:linux GoArch:amd64}
  Helm Version: v2.15.2
  Kubectl Version: v1.14.0

Logs
N/A

@yujunz yujunz added the bug Something isn't working label Dec 26, 2019
@alexmt
Copy link
Collaborator

alexmt commented Dec 29, 2019

Hello @yujunz , The name field holds resource name (if you need to ignore the difference in one particular resource ), not group. Please try using group field instead.

@yujunz
Copy link
Contributor Author

yujunz commented Dec 30, 2019

@alexmt I do want to ignore one particular resource.

apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  annotations:
    admission-webhook.appscode.com/active: 'true'
    admission-webhook.appscode.com/status: ''
    kubectl.kubernetes.io/last-applied-configuration: >
      ...
  creationTimestamp: '2019-12-26T01:45:40Z'
  labels:
    app: kubedb
    app.kubernetes.io/instance: kubedb
    chart: kubedb-0.12.0
    heritage: Tiller
    release: kubedb
  name: v1alpha1.validators.kubedb.com

caBundle will be injected into this api service and annotates as active. These changes happens out of argocd and I want to ignore these differences.

@alexmt
Copy link
Collaborator

alexmt commented Dec 30, 2019

Ah, I see. I believe diff settings were not applied because group is missing. If group field is not specified it defaults to an empty string and so resource apiregistration.k8s.io/v1alpha1.validators.kubedb.com does not match. Please try following settings:

  ignoreDifferences:
  - kind: APIService
    group: apiregistration.k8s.io
    name: v1alpha1.validators.kubedb.com
    jsonPointers:
    - /spec/caBundle
    - /metadata

@yujunz
Copy link
Contributor Author

yujunz commented Dec 30, 2019

Now I remember. When group is missing, it defaults to the core api group.

@yujunz yujunz closed this as completed Dec 30, 2019
@abdennour
Copy link

What about specific annotation and not all annotations? I am not able to skip slashes and times ( dots) in the json pointer ( json path ) :(

@alex-souslik-hs
Copy link
Contributor

What about specific annotation and not all annotations? I am not able to skip slashes and times ( dots) in the json
pointer ( json path ) :(

@abdennour use '~1' in place of '/'.
https://jsonpatch.com/#json-pointer

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

No branches or pull requests

4 participants