Use "amp &"; (ampersand) in environment variables of oc start-build in OpenShift 4

Solution Verified - Updated -

Issue

  • Using oc start-build with environment variables that contains '&' will be encoded to \u0026

        $ oc start-build ruby-hello --follow  --env=ARTIFACT_URL='http://some.url.com/with?query=params&second=param'
    
        build.build.openshift.io/ruby-hello-4 started
        Adding cluster TLS certificate authority to trust store
        Cloning "https://github.com/openshift/ruby-hello-world" ...
            Commit:    0c607af092aa3d4d8769612faa395b2d1020c8e2 (Merge pull request #125 from multi-arch/master)
            Author:    Ben Parees <bparees@users.noreply.github.com>
            Date:    Mon Jun 14 20:43:14 2021 -0400
        Adding cluster TLS certificate authority to trust store
        Replaced Dockerfile FROM image registry.access.redhat.com/ubi8/ruby-27
        Adding cluster TLS certificate authority to trust store
        Caching blobs under "/var/cache/blobs".
    
        Pulling image registry.access.redhat.com/ubi8/ruby-27@sha256:2d92e444fa2a2fcee32500a0327f67b35201001f45a23492f2b57e13a149af7c ...
        Getting image source signatures
        Copying blob sha256:63f9f4c31162a6a5dacd999a0dc65007e15b2ca6b2d9360a1234c27de12e7f38
        Copying blob sha256:ce3c6836540f978b55c511d236429e26b7a45f5a6f1204ab8d4378afaf77332f
        Copying blob sha256:d49355ce848e2c86326ad8d7c3e4905e2883c89e1f6b79553427f1acf21ea7d1
        Copying blob sha256:baeb54a6356aad706951510560f86dc0e36418bf049450d979e4ddf1d0fbbe14
        Copying blob sha256:0fc972655972b3a911d7d9adf0faacb870f7989f9129ff37569d96ca82c1ee8b
        Copying config sha256:3f8815c36c0a69f38baa53359ada1b773229925624f826893fc691bfdce3a6cf
        Writing manifest to image destination
        Storing signatures
        STEP 1: FROM registry.access.redhat.com/ubi8/ruby-27@sha256:2d92e444fa2a2fcee32500a0327f67b35201001f45a23492f2b57e13a149af7c
        STEP 2: ENV "ARTIFACT_URL"="http://some.url.com/with?query=params\u0026second=param"
        --> a6231e824c7
        STEP 3: USER default
        --> 78b1ed51992
        ...
    

Environment

  • OpenShift Container Platform
    • 4.6

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