Bug 1947164 - Print "Successfully pushed" even if the build push fails.
Summary: Print "Successfully pushed" even if the build push fails.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Build
Version: 4.7
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
: 4.8.0
Assignee: Adam Kaplan
QA Contact: XiuJuan Wang
Srivaralakshmi Ramani
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-07 19:50 UTC by Vinu K
Modified: 2021-07-27 22:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, builds did not perform an error check to see if an image push had failed. As a result, builds always logged the `Successfully pushed` message. Now, builds check if an error has occurred, and only log the `Successfully pushed` message after an image push has succeeded.
Clone Of:
Environment:
Last Closed: 2021-07-27 22:57:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift builder pull 232 0 None open BZ1947164: Print "Successfully pushed" only if push succeeded 2021-04-07 20:05:34 UTC
Red Hat Product Errata RHSA-2021:2438 0 None None None 2021-07-27 22:58:16 UTC

Description Vinu K 2021-04-07 19:50:01 UTC
Description of problem:
The build push prints a "Successfully pushed" message even if the actual image push fails.

Version-Release number of selected component (if applicable):
v4u7

How reproducible:
Easy

Steps to Reproduce:

---
$ oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"managementState":"Managed"}}' --type=merge

$ oc new-project foo

$ cat < EOF | oc create -f -
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  name: busybox
---
apiVersion: v1
kind: BuildConfig
metadata:
  name: busybox
spec:
  output:
    to:
      kind: ImageStreamTag
      name: busybox:latest
  source:
    type: Dockerfile
    dockerfile: |-
      FROM k8s.gcr.io/busybox
      ENTRYPOINT ["sleep", "6000"]
  strategy:
    dockerStrategy:
      from:
        kind: DockerImage
        name: k8s.gcr.io/busybox
    type: Docker
  triggers:
  - imageChange: {}
    type: ImageChange
EOF

$ oc start-build busybox --wait=true --follow=true
---

Actual results:
The output print a "Successfully pushed" message even if the image push fails.

---
Pushing image image-registry.openshift-image-registry.svc:5000/foo/busybox:latest ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Successfully pushed image-registry.openshift-image-registry.svc:5000/foo/busybox:latest
Warning: Push failed, retrying in 5s ...
error: build error: Failed to push image: error copying layers and metadata from "containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.imagestore=/var/lib/shared]image-registry.openshift-image-registry.svc:5000/foo/busybox:latest" to "docker://image-registry.openshift-image-registry.svc:5000/foo/busybox:latest": Error trying to reuse blob sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4 at destination: error pinging docker registry image-registry.openshift-image-registry.svc:5000: Get "https://image-registry.openshift-image-registry.svc:5000/v2/": dial tcp: lookup image-registry.openshift-image-registry.svc on 172.30.0.10:53: no such host
---

Expected results:
It should not print a "Successfully pushed" message.

Additional info:

Comment 2 XiuJuan Wang 2021-04-12 03:34:47 UTC
No 'Successfully pushed' message shown when image push failed.

Writing manifest to image destination
Storing signatures
--> d5b6e2ad097
d5b6e2ad097090fe73fe25e5b6d8e427331e3c3021fddc6911d6bb3fa7332ff5

Pushing image image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Getting image source signatures
Warning: Push failed, retrying in 5s ...
Registry server Address: 
Registry server User Name: serviceaccount
Registry server Email: serviceaccount
Registry server Password: <<non-empty>>
error: build error: Failed to push image: error copying layers and metadata from "containers-storage:[overlay@/var/lib/containers/storage+/var/run/containers/storage:overlay.imagestore=/var/lib/shared]image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest" to "docker://image-registry.openshift-image-registry.svc:5000/xiuwang/ruby-hello-world:latest": Error trying to reuse blob sha256:b77f42d650dc7d0d6fa21f8661f03957cfe70fcf92e48245d2a7cad7d795eb56 at destination: error pinging docker registry image-registry.openshift-image-registry.svc:5000: Get "https://image-registry.openshift-image-registry.svc:5000/v2/": dial tcp 172.30.60.102:5000: connect: connection refused

Comment 10 errata-xmlrpc 2021-07-27 22:57:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438


Note You need to log in before you can comment on or make changes to this bug.