Create the cloudrc file

You can useopenstack or glance client commands, within the openstackclient pod. pod. However you must create the cloudrc file on the openstackclient pod to use glance client commands. This file persists for the lifetime of the openstackclient pod.

Procedure

If the cloudrc does not exist, for instance it cannot be sourced, then use the following command to create it:
$ oc rsh openstackclient bash -c '
cat .config/openstack/* | while read key val; do
    case $key in
        "auth_url:") var=OS_AUTH_URL ;;
        "username:") var=OS_USERNAME ;;
        "password:") var=OS_PASSWORD ;;
        "project_name:") var=OS_PROJECT_NAME ;;
        "project_domain_name:") var=OS_PROJECT_DOMAIN_NAME ;;
        "user_domain_name:") var=OS_USER_DOMAIN_NAME ;;
        *) var="" ;;
    esac
    [ -z "$var" ] || echo "export ${var}=${val}"
done > cloudrc
'