I am currently trying to modify my image:tag in my build config from shell command using oc patch.
My command is as such :
oc patch bc/my-bc-name --patch '{"spec":{"strategy":{"sourceStrategy":{"from":{"name": "image:tag" }}}}}'
what i want to do :
oc patch bc/my-bc-name --patch '{"spec":{"strategy":{"sourceStrategy":{"from":{"name": $myImage }}}}}'
such that the image name is specify as an environnement variable. Unfortunately, i got : Error from server (BadRequest): invalid character '
#x27; looking for beginning of valueusing simple/double quote nor ${myImage} does not seems to work as well.
any workaround to bypass this is more than welcomed :)
Kind regards
Surround your environment variable with single quotes as shown below. This will allow the shell to replace/expand it with its value.
oc patch bc/my-bc-name --patch '{"spec":{"strategy":{"sourceStrategy":{"from":{"name": "'$myImage'"}}}}}'