Page MenuHomePhabricator

Login procedure in install_platform.sh can be confusing for private registry mode
Open, Needs TriagePublic

Description

Following the instructions on https://phabricator.mitk.org/w/dktk-jip/dkfz-openstack as well as https://kaapana.readthedocs.io/en/latest/install_kaapana.html#step-2-platform-deployment I ran into some issues. I just added the registry URL and did not modify the USERNAME and PASSWORD lines. Running the script then only asks for a password:

ubuntu@vm-128-223:~$ ./install_platform.sh
USER: ubuntu
Check disk space: ok
SIZE:  194G
Check if helm is available...
ok
Get helm deployments...
Current deployments:
No previous deployment found -> installation
Helm login registry...
Credentials found!
Password:

and after entering e.g. a GitLab access token it fails with an error and to recover needs a manual docker logoff/logon procedure and possibly even more cleanup steps.

Maybe the logic in the install_platform.sh could be improved, or the documentation could be enhanced to give a clearer instruction on how to enter credentials for a private registry.

Event Timeline

Putting both in the script, like

CONTAINER_REGISTRY_USERNAME="nolden-test"
CONTAINER_REGISTRY_PASSWORD="SECRET"

works. But only if you do it on the first run.

I tried to reproduce Marco's problem and on a fresh instance I had the exact same issues.

image.png (1×941 px, 235 KB)

The install script didn't ask for my username but only for password.

nolden moved this task from Discussion to Community-Day Tasks on the Kaapana (internal) board.

This was discussed in the meeting, and it's considered to be a bug in the install.sh script, not properly checking for an empty USERNAME variable.

Free to claim if you would like to fix it ;)

Currently, what we have in the install_platform.sh under the if condition that checks credentials:

if [ ! -v CONTAINER_REGISTRY_USERNAME ] || [ ! -v CONTAINER_REGISTRY_PASSWORD ]

-> this checks if the variable exists, doesn’t matter if empty or not.
We just need to check if the value of the variable is empty or not with the following:

if [ -z "$CONTAINER_REGISTRY_USERNAME" ] || [ -z "$CONTAINER_REGISTRY_PASSWORD" ]

This fixes the problem.