IBM / cloud-pak-deployer

Configuration-based installation of OpenShift and Cloud Pak for Data/Integration/Watson AIOps on various private and public cloud infrastructure providers. Deployment attempts to achieve the end-state defined in the configuration. If something fails along the way, you only need to restart the process to continue the deployment.
https://ibm.github.io/cloud-pak-deployer/
Apache License 2.0
130 stars 65 forks source link

missing keyword in command when using kubeconfig file for login (existing-cluster) #644

Closed israel-a-vizcarra closed 4 months ago

israel-a-vizcarra commented 4 months ago

Describe the bug If using existing cluster and kubeconfig file as a login method, the process fails due to missing keyword in task cloud-pak-deployer/automation-roles/99-generic/openshift/openshift-login/tasks/existing-ocp-check-kubeconfig.yml

To Reproduce Steps to reproduce the behavior:

  1. Use an existing cluster configuration file
  2. Create kubeconfig vault secret
  3. Run env apply
  4. Process fails with message oc use-context command doesnt exist

Expected behavior Process should complete successfully

Additional context problem in line5 file cloud-pak-deployer/automation-roles/99-generic/openshift/openshift-login/tasks/existing-ocp-check-kubeconfig.yml

  1 ---
  2 # If a kubeconfig file is used to login to the cluster, check that the context is correct
  3 - name: Set current context
  4   shell:
  5     oc use-context {{ _p_openshift_cluster_name }} <<<<
  6   failed_when: False

Adding config keyword fixes the problem

  1 ---
  2 # If a kubeconfig file is used to login to the cluster, check that the context is correct
  3 - name: Set current context
  4   shell:
  5     oc config use-context {{ _p_openshift_cluster_name }}
  6   failed_when: False
israel-a-vizcarra commented 4 months ago

645 PR