Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/rhcos/builds: allow use of env var to override stream URL. #1168

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ release)
then
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/rhcos.buildName=${RHCOS_BUILD_NAME}"
fi
if test -n "${RHCOS_BUILD_URL}"
then
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/rhcos.baseURL=${RHCOS_BUILD_URL}"
fi
if test "${SKIP_GENERATION}" != y
then
go generate ./data
Expand Down
8 changes: 8 additions & 0 deletions pkg/rhcos/builds.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"os"

"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand All @@ -22,6 +23,13 @@ var (
baseURL = "https://releases-rhcos.svc.ci.openshift.org/storage/releases"
)

func init() {
if or, ok := os.LookupEnv("OPENSHIFT_INSTALL_COREOS_IMAGE_URL"); ok && or != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why COREOS and not RHCOS ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'd vaguely thought that we want to enable e.g. pointing the installer at a custom Fedora CoreOS build with kubelet for testing.

logrus.Warn("Found override for OS BASE URL. Untrusted repository will be used. This is not advised")
baseURL = or
}
}

type metadata struct {
AMIs []struct {
HVM string `json:"hvm"`
Expand Down