Open kotyara85 opened 1 day ago
Checklist:
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
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.
--dry-run=server
Checklist:
argocd version
.Describe the bug
I set annotation argocd.argoproj.io/compare-options=ServerSideDiff=true
Here's helm template sample:
which does work correctly with --dry-run=server using helm command
Template:
results into:
Version 1.12.6