From c190463ad8b55bbfb2a6df1f00835375e365a385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Lobillo?= Date: Thu, 6 Feb 2025 10:37:56 +0100 Subject: [PATCH] Switch incluster-kubeconfig to admin context By switching to the admin context we facilitate the usage of the kubeconfig in the shiftstackclient pod. --- roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml b/roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml index b9eb9b861c..768c3f4c1f 100644 --- a/roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml +++ b/roles/shiftstack/tasks/deploy_shiftstackclient_pod.yml @@ -14,6 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. +- name: Switch context to admin on {{ cifmw_openshift_kubeconfig }} + ansible.builtin.command: oc config use-context admin --kubeconfig={{ cifmw_openshift_kubeconfig }} + changed_when: true + - name: Encode kubeconfig file to Base64 ansible.builtin.set_fact: incluster_kubeconfig_base64: "{{ lookup('ansible.builtin.file', cifmw_openshift_kubeconfig ) | b64encode }}"