ci: quote username for podman_login()

Jenkins does not like the passing of the username as variable to the
podman_login() function. Calling the function results in an error like

    Warning: A secret was passed to "sh" using Groovy String interpolation, which is insecure.
        Affected argument(s) used the following variable(s): [CREDS_USER]
        See https://jenkins.io/redirect/groovy-string-interpolation for details.
    + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@n7.pufty.ci.centos.org 'podman login --authfile=~/.podman-auth.json --username=$CREDS_USER --password=**** registry-****.apps.ocp.ci.centos.org'
    Username: Error: error getting username and password: error reading username: EOF

By single quoting the username, just like the password, it may work
better.

Fixes: aca3745e2 ("ci: do not use Groovy string interpolation for credentials")
Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-07-15 10:29:27 +02:00
parent aca3745e24
commit f129719f18
6 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it

View File

@ -18,7 +18,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it

View File

@ -17,7 +17,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it

View File

@ -19,7 +19,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it

View File

@ -16,7 +16,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it

View File

@ -16,7 +16,7 @@ def ssh(cmd) {
} }
def podman_login(registry, username, passwd) { def podman_login(registry, username, passwd) {
ssh "podman login --authfile=~/.podman-auth.json --username=${username} --password='${passwd}' ${registry}" ssh "podman login --authfile=~/.podman-auth.json --username='${username}' --password='${passwd}' ${registry}"
} }
// podman_pull pulls image from the source (CI internal) registry, and tags it // podman_pull pulls image from the source (CI internal) registry, and tags it