Skip to content

Commit

Permalink
hack: pin the release image in build flags
Browse files Browse the repository at this point in the history
But still leave an override env var so that it can be overridden. Use the following env var to pin the image while building the binary:
```
$ # export the release-image variable
$ export OPENSHIFT_INSTALL_RELEASE_IMAGE=registry.redhat.io/openshift/origin-release:v4.0"
$ # build the openshift-install binary
$ ./hack/build.sh
$ # distribute the binary to customers and run with pinned image being picked up
$ ./bin/openshift-install create cluster...
```
The only way to override it would be to use an env var OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE while running the openshift-install binary.
  • Loading branch information
Rajat Chopra committed Nov 28, 2018
1 parent e15d801 commit e890b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export CGO_ENABLED=0
case "${MODE}" in
release)
TAGS="${TAGS} release"
if test -n "${OPENSHIFT_INSTALL_RELEASE_IMAGE}"
then
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/asset/ignition/bootstrap.defaultReleaseImage=${OPENSHIFT_INSTALL_RELEASE_IMAGE}"
fi
if test "${SKIP_GENERATION}" != y
then
go generate ./data
Expand Down
5 changes: 4 additions & 1 deletion pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ import (

const (
rootDir = "/opt/tectonic"
defaultReleaseImage = "registry.svc.ci.openshift.org/openshift/origin-release:v4.0"
bootstrapIgnFilename = "bootstrap.ign"
)

var (
defaultReleaseImage = "registry.svc.ci.openshift.org/openshift/origin-release:v4.0"
)

// bootstrapTemplateData is the data to use to replace values in bootstrap
// template files.
type bootstrapTemplateData struct {
Expand Down

0 comments on commit e890b7b

Please sign in to comment.