ADD Dockerfile reference is not validating HTTP status code in buildah und subsequentially in OpenShift Container Platform 4

Solution Verified - Updated -

Issue

  • During a OpenShift build we are executing a step like shown below with the ADD reference. If the webserver replies with a 404 error, the error is writen to the app.jar instead forcing the build to fail.

    STEP 8/12: ADD https://webserver.example.com/app.jar /deploy/app.jar
    time="2022-06-23T15:01:58Z" level=warning msg="Adding metacopy option, configured globally"
    --> fdbeb7ba0bf
    
  • buildah does not respect the HTTP status code returned when using ADD Dockerfile reference. Instead a file with the name is added with the HTTP response code included, showing the 404 error.

Environment

  • Red Hat OpenShift Container Platform (RHOCP) 4
  • buildah

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content