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

ServerSide diff is not working #20473

Open
kotyara85 opened this issue Oct 21, 2024 · 1 comment
Open

ServerSide diff is not working #20473

kotyara85 opened this issue Oct 21, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kotyara85
Copy link

Checklist:

  • [ x] I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
  • [x ] I've included steps to reproduce the bug.
  • [x ] I've pasted the output of argocd version.

Describe the bug

I set annotation argocd.argoproj.io/compare-options=ServerSideDiff=true

Here's helm template sample:

{{- define "k8sServiceHost" }}
  {{- if lookup "v1" "ConfigMap" "kube-public" "cluster-info" }}
    {{- $configmap := (lookup "v1" "ConfigMap" "kube-public" "cluster-info") }}
    {{- $kubeconfig := get $configmap.data "kubeconfig" }}
    {{- $k8sServer := get ($kubeconfig | fromYaml) "clusters" | mustFirst | dig "cluster" "server" "" }}
    {{- $uri := (split "https://" $k8sServer)._1 | trim }}
    {{- (split ":" $uri)._0 | quote }}
  {{- end }}
{{- end }}

which does work correctly with --dry-run=server using helm command

Template:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test
data:
    host: {{ include "k8sServiceHost" . }}

results into:

apiVersion: v1
data:
  host: ''
kind: ConfigMap
metadata:
  labels:
    argocd.argoproj.io/instance: test
  name: test
  namespace: test

Version
1.12.6

@kotyara85 kotyara85 added the bug Something isn't working label Oct 21, 2024
@crenshaw-dev
Copy link
Member

I don't think this is related to ServerSideDiff. Argo CD doesn't support Helm lookups (i.e. Helm's --dry-run=server. ServerSideDiff uses the Kubernetes API's server-side dry run feature, not Helm's.

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

2 participants