Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
183 changes: 179 additions & 4 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ignored = [
"github.com/openshift/installer/tests*",
"github.com/openshift/installer/pkg/terraform/exec*"
"github.com/boltdb/*",
"github.com/docker/distribution/metrics",
"github.com/mtrmac/gpgme",
"github.com/openshift/installer/pkg/terraform/exec*",
"github.com/openshift/installer/tests*"
]

[prune]
Expand Down
8 changes: 2 additions & 6 deletions hack/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi

MODE="${MODE:-release}"
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/version.Raw=$(git describe --always --abbrev=40 --dirty)"
TAGS="${TAGS:-}"
TAGS="${TAGS:-} containers_image_openpgp"
OUTPUT="${OUTPUT:-bin/openshift-install}"
export CGO_ENABLED=0

Expand All @@ -42,11 +42,7 @@ release)
TAGS="${TAGS} release"
if test -n "${RELEASE_IMAGE}"
then
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/asset/ignition/bootstrap.defaultReleaseImage=${RELEASE_IMAGE}"
fi
if test -n "${RHCOS_BUILD_NAME}"
then
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/rhcos.buildName=${RHCOS_BUILD_NAME}"
LDFLAGS="${LDFLAGS} -X github.com/openshift/installer/pkg/asset/release.defaultImage=${RELEASE_IMAGE}"
fi
if test "${SKIP_GENERATION}" != y
then
Expand Down
19 changes: 6 additions & 13 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/openshift/installer/pkg/asset/kubeconfig"
"github.com/openshift/installer/pkg/asset/machines"
"github.com/openshift/installer/pkg/asset/manifests"
"github.com/openshift/installer/pkg/asset/release"
"github.com/openshift/installer/pkg/asset/tls"
"github.com/openshift/installer/pkg/types"
)
Expand All @@ -35,10 +36,6 @@ const (
ignitionUser = "core"
)

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 Expand Up @@ -66,6 +63,7 @@ func (a *Bootstrap) Dependencies() []asset.Asset {
&machines.Master{},
&manifests.Manifests{},
&manifests.Openshift{},
new(release.Image),
&tls.AdminKubeConfigCABundle{},
&tls.AggregatorCA{},
&tls.AggregatorCABundle{},
Expand Down Expand Up @@ -116,9 +114,10 @@ func (a *Bootstrap) Dependencies() []asset.Asset {
// Generate generates the ignition config for the Bootstrap asset.
func (a *Bootstrap) Generate(dependencies asset.Parents) error {
installConfig := &installconfig.InstallConfig{}
dependencies.Get(installConfig)
releaseImage := new(release.Image)
dependencies.Get(installConfig, releaseImage)

templateData, err := a.getTemplateData(installConfig.Config)
templateData, err := a.getTemplateData(installConfig.Config, string(*releaseImage))
if err != nil {
return errors.Wrap(err, "failed to get bootstrap templates")
}
Expand Down Expand Up @@ -170,18 +169,12 @@ func (a *Bootstrap) Files() []*asset.File {
}

// getTemplateData returns the data to use to execute bootstrap templates.
func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig) (*bootstrapTemplateData, error) {
func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseImage string) (*bootstrapTemplateData, error) {
etcdEndpoints := make([]string, *installConfig.ControlPlane.Replicas)
for i := range etcdEndpoints {
etcdEndpoints[i] = fmt.Sprintf("https://etcd-%d.%s:2379", i, installConfig.ClusterDomain())
}

releaseImage := defaultReleaseImage
if ri, ok := os.LookupEnv("OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE"); ok && ri != "" {
logrus.Warn("Found override for ReleaseImage. Please be warned, this is not advised")
releaseImage = ri
}

return &bootstrapTemplateData{
EtcdCertSignerImage: etcdCertSignerImage,
PullSecret: installConfig.PullSecret,
Expand Down
Loading