コード例 #1
0
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
コード例 #2
0
ファイル: registry.py プロジェクト: raghavendra-talur/ocs-ci
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