]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monitoring/grafana/build/Makefile: work around buildah bug 41559/head
authorDan Mick <dmick@redhat.com>
Wed, 26 May 2021 19:51:19 +0000 (19:51 +0000)
committerDan Mick <dmick@redhat.com>
Wed, 26 May 2021 20:37:25 +0000 (13:37 -0700)
Workaround https://github.com/containers/buildah/issues/3253
by pushing to a local OCI-format image to clear out erroneously-left
'parent' field in buildah commit --squash output.  Can be removed
when the fix for the above is available.

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

index ed641bb102fdc563f5e31643a3b02e9ec8564760..c0cda1130a3937e50d8d8d18060d762b145612ac 100755 (executable)
@@ -72,8 +72,15 @@ providers: \\n\
        sudo buildah commit --format docker --squash $(CONTAINER) $(LOCALTAG)
 
 push:
-       sudo podman tag ${LOCALTAG} docker.io/${TAG}
-       sudo podman tag ${LOCALTAG} quay.io/${TAG}
+       # this transition-through-oci image is a workaround for
+       # https://github.com/containers/buildah/issues/3253 and
+       # can be removed when that is fixed and released.  The
+       # --format v2s2 on push is to convert oci back to docker format.
+       sudo podman push $(LOCALTAG) --format=oci dir://tmp/oci-image
+       sudo podman pull dir://tmp/oci-image
+       sudo rm -rf /tmp/oci-image
+       sudo podman tag localhost/tmp/oci-image docker.io/${TAG}
+       sudo podman tag localhost/tmp/oci-image 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
@@ -84,5 +91,6 @@ clean:
        sudo podman rmi ${LOCALTAG} || true
        sudo podman rmi docker.io/${TAG} || true
        sudo podman rmi quay.io/${TAG} || true
+       sudo podman rmi localhost/tmp/oci-image || true
        rm -f grafana-*.rpm* auth.json
        rm -f ${DASHBOARD_PROVISIONING}