def get_oc_podman_login_cmd(): """ Function to get oc and podman login commands on node Returns: cmd_list (list): List of cmd for oc/podman login """ user = config.RUN['username'] filename = os.path.join(config.ENV_DATA['cluster_path'], config.RUN['password_location']) with open(filename) as f: password = f.read() helpers.refresh_oc_login_connection() ocp_obj = ocp.OCP() token = ocp_obj.get_user_token() route = get_default_route_name() cmd_list = [ 'export KUBECONFIG=/home/core/auth/kubeconfig', f"oc login -u {user} -p {password}", f"podman login {route} -u {user} -p {token}" ] master_list = helpers.get_master_nodes() helpers.rsync_kubeconf_to_node(node=master_list[0]) return cmd_list
def get_oc_podman_login_cmd(skip_tls_verify=True): """ Function to get oc and podman login commands on node Args: skip_tls_verify (bool): If true, the server's certificate will not be checked for validity Returns: cmd_list (list): List of cmd for oc/podman login """ user = config.RUN['username'] filename = os.path.join(config.ENV_DATA['cluster_path'], config.RUN['password_location']) with open(filename) as f: password = f.read().strip() cluster_name = config.ENV_DATA['cluster_name'] base_domain = config.ENV_DATA['base_domain'] cmd_list = [ 'export KUBECONFIG=/home/core/auth/kubeconfig', f"oc login -u {user} -p {password} " f"https://api-int.{cluster_name}.{base_domain}:6443" f" --insecure-skip-tls-verify={skip_tls_verify}", f"podman login -u {user} -p $(oc whoami -t) image-registry.openshift-image-registry.svc:5000" ] master_list = helpers.get_master_nodes() helpers.rsync_kubeconf_to_node(node=master_list[0]) return cmd_list
def get_oc_podman_login_cmd(): """ Function to get oc and podman login commands on node Returns: cmd_list (list): List of cmd for oc/podman login """ user = config.RUN['username'] helpers.refresh_oc_login_connection() ocp_obj = ocp.OCP() token = ocp_obj.get_user_token() route = get_default_route_name() cmd_list = [ 'export KUBECONFIG=/home/core/auth/kubeconfig', f"podman login {route} -u {user} -p {token}" ] master_list = helpers.get_master_nodes() helpers.rsync_kubeconf_to_node(node=master_list[0]) return cmd_list