I'm building some automation around "mirror-registry" (local quay) for a disconnected OpenShift installation in a customer environment.
I noticed that "mirror-registry" will abort the installation when a invalid (unknown) command-line argument is passed, but it still exits with a "0" exit code, which indicates success.
Therefore the automation continues without knowning that the installation failed.
Reproducer:
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/mirror-registry/1.3.11/mirror-registry.tar.gz tar xf mirror-registry.tar.gz chmod +x mirror-registry ./mirror-registry install --quayHostname ocp-mirror-registry.example.com --quayRoot /opt/registry --initUser admin --initPassword hunter.2 --quayPort 443 --ssl-cert --ssl-key __ __ / \ / \ ______ _ _ __ __ __ / /\ / /\ \ / __ \ | | | | / \ \ \ / / / / / / \ \ | | | | | | | | / /\ \ \ / \ \ \ \ / / | |__| | | |__| | / ____ \ | | \ \/ \ \/ / \_ ___/ \____/ /_/ \_\ |_| \__/ \__/ \ \__ \___\ by Red Hat Build, Store, and Distribute your Containers Error: unknown flag: --quayPort Usage: mirror-registry install [flags] Flags: --additionalArgs string Additional arguments you would like to append to the ansible-playbook call. Used mostly for development. --askBecomePass Whether or not to ask for sudo password during SSH connection. -h, --help help for install -i, --image-archive string An archive containing images --initPassword string The password of the initial user. If not specified, this will be randomly generated. --initUser string The username of the initial user. This defaults to init. (default "init") --pgStorage string The folder where postgres persistent storage data is saved. This defaults to a Podman named volume 'pg-storage'. Root is required to uninstall. (default "pg-storage") --quayHostname string The value to set SERVER_HOSTNAME in the Quay config.yaml. This defaults to <targetHostname>:8443 -r, --quayRoot string The folder where quay persistent data are saved. This defaults to ~/quay-install (default "~/quay-install") --quayStorage string The folder where quay persistent storage data is saved. This defaults to a Podman named volume 'quay-storage'. Root is required to uninstall. (default "quay-storage") -k, --ssh-key string The path of your ssh identity key. This defaults to ~/.ssh/quay_installer (default "/root/.ssh/quay_installer") --sslCert string The path to the SSL certificate Quay should use --sslCheckSkip Whether or not to check the certificate hostname against the SERVER_HOSTNAME in config.yaml. --sslKey string The path to the SSL key Quay should use -H, --targetHostname string The hostname of the target you wish to install Quay to. This defaults to $HOST (default "ocp-mirror-registry.example.com") -u, --targetUsername string The user on the target host which will be used for SSH. This defaults to $USER (default "root")Global Flags: -c, --no-color Control colored output -v, --verbose Display verbose logs echo $? 0