]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
monitoring/grafana/build/Makefile: use --authfile
authorDan Mick <dmick@redhat.com>
Wed, 26 May 2021 19:47:36 +0000 (19:47 +0000)
committerDan Mick <dmick@redhat.com>
Wed, 26 May 2021 20:37:25 +0000 (13:37 -0700)
podman login caches auth tokens in auth.json; for sudo, it may be
placed in /run/containers/0 or it may be in /run/users/0/containers;
the latter directory is removed when root "logs out", which isn't
clear what it means with sudo/su.  Several builds failed because
they couldn't find the cached auth between sudo podman login and sudo
podman push.  Sidestep the confusion by just using a local file for
the auth cache.

Signed-off-by: Dan Mick <dmick@redhat.com>
monitoring/grafana/build/Makefile

index 46b1f25c39a819274f0348a64cc766d03f634355..ed641bb102fdc563f5e31643a3b02e9ec8564760 100755 (executable)
@@ -74,14 +74,15 @@ providers: \\n\
 push:
        sudo podman tag ${LOCALTAG} docker.io/${TAG}
        sudo podman tag ${LOCALTAG} quay.io/${TAG}
-       sudo podman login -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD} docker.io
-       sudo podman login -u $(CONTAINER_REPO_USERNAME) -p $(CONTAINER_REPO_PASSWORD) quay.io
-       sudo podman push --format v2s2 docker.io/${TAG}
-       sudo podman push --format v2s2 quay.io/${TAG}
+       # sudo podman has issues with auth.json; just override it
+       sudo podman login --authfile=auth.json -u ${DOCKER_HUB_USERNAME} -p ${DOCKER_HUB_PASSWORD} docker.io
+       sudo podman login --authfile=auth.json -u $(CONTAINER_REPO_USERNAME) -p $(CONTAINER_REPO_PASSWORD) quay.io
+       sudo podman push --authfile=auth.json --format v2s2 docker.io/${TAG}
+       sudo podman push --authfile=auth.json --format v2s2 quay.io/${TAG}
 
 clean:
        sudo podman rmi ${LOCALTAG} || true
        sudo podman rmi docker.io/${TAG} || true
        sudo podman rmi quay.io/${TAG} || true
-       rm -f grafana-*.rpm*
+       rm -f grafana-*.rpm* auth.json
        rm -f ${DASHBOARD_PROVISIONING}