Apply suggestions from code review

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/351/head
Derek Nola 2025-02-06 09:02:47 -08:00 committed by GitHub
parent 61ce6f9b68
commit 9f0d493fdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -157,12 +157,12 @@
become: false
- name: Merge with any existing kubeconfig on control node
when: kubeconfig != "~/.kube/config"
when: kubeconfig == "~/.kube/config.new"
ansible.builtin.shell: |
TFILE=$(mktemp)
KUBECONFIG={{ kubeconfig }}:~/.kube/config kubectl config set-context {{ cluster_context }} --user={{ cluster_context }} --cluster={{ cluster_context }}
KUBECONFIG={{ kubeconfig }}:~/.kube/config kubectl config view --flatten > ${TFILE}
mv ${TFILE} {{ kubeconfig }}
mv ${TFILE} ~/.kube/config
delegate_to: 127.0.0.1
become: false
register: mv_result