Skip to content

Commit

Permalink
Handle cluster info with proper kubeconfig or aks style kubeconfig (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Sep 19, 2024
1 parent dbd36fe commit 5fbf090
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions charts/cluster-manager-spoke/templates/klusterlets.cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ spec:

{{- $spokeServer := "" }}
{{- with (lookup "v1" "ConfigMap" "kube-public" "cluster-info") }}
{{- $spokeConfig := .data.kubeconfig | fromYaml }}
{{- $spokeServer = default (dig "cluster" "server" "" (first $spokeConfig.clusters)) "" -}}
{{ range $c := get (.data.kubeconfig | fromYaml) "clusters" }}
{{- $spokeServer = dig "cluster" "server" $c.server $c -}}
{{ end }}
{{- end }}

apiVersion: operator.open-cluster-management.io/v1
Expand Down

0 comments on commit 5fbf090

Please sign in to comment.