1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-06 00:48:45 +01:00
Commit Graph

127 Commits

Author SHA1 Message Date
staebler
abca904596 rhcos: ami regions from rhcos stream at runtime
Currently, the installer relies on a generated go file for determining
the AWS region in which the RHCOS image is published. The `go generate`
directive was inadvertently removed in https://github.com/openshift/installer/pull/4582.
Rather than resurrecting the directive, this commit removes the generated
code in favor of gathering the regions directly from the rhcos stream
data when needed.

https://issues.redhat.com/browse/CORS-1838
2021-12-09 15:19:54 -05:00
Christy Norman
421e1e20c6 close a verify-codegen ci failure loophole
if the go codegen commands failed, the the hack/verify-codegen.sh script
continued and the CI check passed. see #5406 for an example. the script
was not set to fail on a non-zero return code. this pr adds the bash e
option to the set builtin to catch errors and exit on failure.

Signed-off-by: Christy Norman <christy@linux.vnet.ibm.com>
2021-12-08 17:37:03 -06:00
Yaakov Selkowitz
1456b5e7e5 Require golang 1.17
This is the version being used in OpenShift 4.10, but the code still
compiles for now with golang 1.16.
2021-11-24 02:01:13 -05:00
Yaakov Selkowitz
7ec510fecb Revert "Workaround golang linux/arm64 link error"
golang 1.17 fixed the underlying bug.

This reverts commit 801ece6513.
2021-11-24 02:01:13 -05:00
Colin Walters
61605bdcac Move CoreOS stream metadata to data/data/coreos, add OWNERS
It's more logically owned by the CoreOS team and this will
allow us to have a separate `OWNERS` file.

The `OWNERS` file is copied from the current one in openshift/os.
2021-10-27 16:37:52 -04:00
Colin Walters
d773ee5573 Remove old RHCOS and FCOS metadata (not stream metadata)
In https://github.com/openshift/enhancements/pull/679
we landed support for a stream metadata format already used
by FCOS and now by RHCOS/OCP consumers to find the bootimages.

We kept the old metadata because the UPI CI jobs used it.
In https://github.com/openshift/release/pull/17482 I tried
to port the UPI CI jobs, but ran into huge levels of technical debt.

As best I can tell, the UPI CI jobs are not running on this repo
now and are likely broken for other reasons.

Let's remove the old data and avoid the confusing duplication.
Anyone who goes to work on the UPI CI jobs and sanitizes things
should be able to pick up the work to port to stream metadata
relatively easily.
2021-10-21 17:09:06 -04:00
Evgeny Slutsky
f821cbe00a Bump golang to version 1.16
Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
2021-08-31 14:59:23 +03:00
Jonathan Lebon
f9f3f67a4d hack/update-rhcos-bootimage.py: update RHCOS_RELEASES_APP
I think this was supposed to be part of #4928.

(cherry picked from commit f9165307f9)
2021-07-20 19:40:27 -04:00
OpenShift Merge Robot
36d10af265 Merge pull request #5062 from multi-arch/goflags
Fix build with multiple GOFLAGS
2021-07-15 19:56:15 -04:00
patrickdillon
1022e0d8ac verify-vendor: add go mod tidy
A recent commit passed the CI test for go mod tidy but introduced a bug
in master when we run go mod tidy. By including go mod tidy, we can
catch these earlier.
2021-07-14 16:53:31 -04:00
Yaakov Selkowitz
51869a7020 Fix build with multiple GOFLAGS
GOFLAGS is a space-separated value; quoting it here results in errors.
2021-07-08 12:17:13 -04:00
Yaakov Selkowitz
729882a8a2 Set default cluster architecture based on build host
All installer binaries extracted from a payload, regardless of their
runtime OS or architecture, are built on the payload architecture.
Therefore, GOHOSTARCH can be used to assume the cluster architecture for
which its payload was built.  This is set through the Dockerfiles so that
manual builds of installer will continue to default to amd64.
2021-06-20 00:58:44 -04:00
Timothée Ravier
2f41c0a7fa hack/update-rhcos-bootimage: Add aarch64 support 2021-05-19 10:48:57 +02:00
Yaakov Selkowitz
9017e2bf3a Revert "Link ppc64le binary dynamically"
This unblocked the build on other architectures, but the resulting
ppc64le binary had issues.  The golang bug which affected static linking
has been fixed with a one-line patch, which we are carrying downstream
until the upstream backports land.

This reverts commit 24ac0a15e7.
2021-04-29 12:42:26 -04:00
Yaakov Selkowitz
24ac0a15e7 Link ppc64le binary dynamically
Recent versions of Go have had issues statically linking some ppc64le
binaries:

https://github.com/golang/go/issues/45564
2021-04-26 15:41:05 -04:00
staebler
d3fbc32817 hack: use yaml for coreos manifest
Marshal the coreos-bootimages ConfigMap included in the installer
manifests as yaml instead of json. This allows `oc` to replace
the `0.0.1-snapshot` value of the `releaseVersion`. The quotes
around the value when marshalled as json were preventing the
value from matching the regular expression that `oc` uses.

/fixes https://github.com/openshift/installer/issues/4797
2021-04-02 12:30:59 -04:00
Colin Walters
260b21cbb9 Inject CoreOS stream metadata as configmap via CVO manifest
Split out from https://github.com/openshift/installer/pull/4582

This copies the bits from https://github.com/cgwalters/rhel-coreos-bootimages
which builds a ConfigMap out of the stream metadata and injects
it into the cluster.

We have an `installer` image in the release image today; this adds
the "is an operator" label, even though it's not really an
operator.  We just want the CVO to inject the manifest.

Among other important semantics, this will ensure that in-place
cluster upgrades that have new pinned CoreOS stream data will
have this configmap updated.
2021-03-25 13:28:05 +00:00
Colin Walters
7a7b055d32 Add docs/dev/pinned-coreos.md
Briefly describe the history and future of the pinned {RHEL, Fedora} CoreOS
metadata in the installer.

Co-authored-by: Matthew Staebler <staebler@redhat.com>
2021-03-24 18:21:29 +00:00
Colin Walters
b64d699a13 Add stream metadata for RHCOS
This implements part of the plan from:
https://github.com/openshift/os/issues/477

When we originally added the pinned RHCOS metadata `rhcos.json`
to the installer, we also changed the coreos-assembler `meta.json`
format into an arbitrary new format in the name of some cleanups.
In retrospect, this was a big mistake because we now have two
formats.

Then Fedora CoreOS appeared and added streams JSON as a public API.

We decided to unify on streams metadata; there's now a published
Go library for it: https://github.com/coreos/stream-metadata-go

Among other benefits, it is a single file that supports multiple
architectures.

UPI installs should now use stream metadata, particularly
to find public cloud images.  This is exposed via a new
`openshift-install coreos print-stream-json` command.

This is an important preparatory step for exposing this via
`oc` as well as having something in the cluster update to
it.

HOWEVER as a (really hopefully temporary) hack, we *duplicate*
the metadata so that IPI installs use the new stream format,
and UPI CI jobs can still use the old format (with different RHCOS versions).

We will port the UPI docs and CI jobs after this merges.

Co-authored-by: Matthew Staebler <staebler@redhat.com>
2021-03-24 18:21:26 +00:00
staebler
6b1daea951 hack: use mockgen from vendor
Rather than building an image to run mockgen and having that image
always get the latest verion of mockgen, use the mockgen from the
vendor directory. This has a couple benefits.
 1) We do not get changes to the client mocks that pop up in random
    PRs when a new version of mockgen is released.
 2) Contributors that do not have access to the CI registry can
    generate the mock clients.
2021-02-21 11:21:09 -05:00
OpenShift Merge Robot
98387b7421 Merge pull request #4243 from multi-arch/master
Workaround golang linux/arm64 link error
2021-02-12 16:32:45 -05:00
OpenShift Merge Robot
19dc9ed7e9 Merge pull request #4608 from Fedosin/env_var_typo
Bug 1924140: fix a typo in an env variable name
2021-02-11 10:39:59 -05:00
Mike Fedosin
bdce4b17c6 Fix OWNERS for openstack
Now OwWNERS is a symbolic link and looks like github doesn't accept
it.
2021-02-10 17:00:06 +01:00
Mike Fedosin
3d8d58114e Bug 1924140: fix a typo in the env variable name
It should be called OPENSHIFT_INSTALL_SKIP_PREFLIGHT_VALIDATIONS.
2021-02-02 18:10:47 +01:00
OpenShift Merge Robot
35d7aa255a Merge pull request #4459 from shiftstack/python-manifest-test
openstack: Test Nova AZ manifest generation
2020-12-08 14:11:05 -05:00
OpenShift Merge Robot
0b8525c49a Merge pull request #4421 from shiftstack/verify-gosum
hack/verify-vendor.sh: Fail early if error
2020-12-07 17:11:49 -05:00
Pierre Prinetti
feebe4c70c openstack: Test Nova AZ manifest generation
* instrument the manifest-generation test-framework to execute Python
testfiles
* test machinesets with availability zones
2020-12-07 14:32:58 +01:00
Pierre Prinetti
b85276295a openstack: Test manifest creation
Add a script for testing OpenStack manifest generation.

Co-Authored-By: Matthew Booth <mbooth@redhat.com>
2020-12-02 11:23:33 +01:00
Pierre Prinetti
9e7155389c hack/verify-vendor.sh: Fail early if error
Prior to this patch, errors in vendoring or verification were ignored.

With this patch, `verify-vendor` fails if the dependency files are
corrupted.
2020-11-26 12:10:05 +01:00
Yaakov Selkowitz
801ece6513 Workaround golang linux/arm64 link error
There is a bug with the golang internal linker for the linux/arm64 target
that has yet to be fixed:

https://github.com/golang/go/issues/40492
2020-10-05 14:53:57 -04:00
Benjamin Gilbert
6651680105 hack/update-rhcos-bootimage: update usage example
The example URL is missing the /art/ path prefix, which makes it unclear
how to derive the external URL from the meta.json link in the ART build
browser.
2020-09-01 13:25:28 -04:00
Abhinav Dahiya
46a5f49709 bump the minimum version for building installer to go 1.14
With Go 1.14 the handling of modules has improved in the sense that all the subcommands `go {test, generate}` now use the vendor when available by default. This makes it easier for us to run generate using the vendored tools like controller-tools etc. as it now uses the checked in vendor.
2020-07-06 12:19:20 -07:00
Abhinav Dahiya
cedd117f62 pkg/asset/installconfig/gcp: update go generate for moc generation
update the destination of the generated mocks
2020-05-13 21:18:34 -07:00
Abhinav Dahiya
6f929ae507 hack: include verify-codegen script 2020-05-08 09:26:11 -07:00
Andy McCrae
25e0be9aeb Add ppc64le to update-rhcos-bootimage.py
(cherry picked from commit 28fb0bd40ce2071ca2bc3768fb20591895a4d559)
2020-04-15 18:28:21 +01:00
Alex Crawford
928ab9022d *: enable s390x bootimage support
(cherry picked from commit b7d7474080)
2020-04-15 18:27:52 +01:00
OpenShift Merge Robot
6faec8403a Merge pull request #2972 from wking/drop-rhcos-update-f-string
hack/update-rhcos-bootimage: Drop the f-string
2020-04-15 00:10:24 +02:00
Christian Glombek
8218eed083 Prepare migration to Go Modules and 1.13 2020-02-14 00:07:48 +01:00
W. Trevor King
67abd26ae8 hack/update-rhcos-bootimage: Drop the f-string
F-strings are new in 3.6 [1], and my old RHEL 7.5 CSB has the old
Python 3.4.9 by default.  I'm probably just way behind the times, but
it doesn't cost much to use the older .format() to make this
compatible with all of Python 3 ;).

[1]: https://www.python.org/dev/peps/pep-0498/
2020-01-23 22:05:54 -08:00
Alex Crawford
b1726d2c5e hack: update format of rhcos build metadata
This splits the RHCOS build metadata into architecture-specific files.
This will allow the metadata to contain information about bootimages of
multiple architectures. In order to preserve backward compatibility
(there are a few users, including certain CI jobs, that pull rhcos.json
from GitHub directly), I've opted to use separate files for each
architecture. Normally, we could have just symlinked the legacy metadata
file, but when hosted on raw.githubcontent.com, the symlinks aren't
followed.

When updating the RHCOS bootimages, this script will need to be run once
for each architecture that is being updated.
2020-01-14 15:25:22 -08:00
Alex Crawford
8428471c62 hack: improve portability of bootimage script
Not everyone has python3 installed into /usr/bin/.
2020-01-14 14:28:55 -08:00
Joseph Callen
16bd4f9e88 Add terraform vendor path to shellcheck
Causing test failures
2020-01-10 16:33:46 -05:00
Christian Glombek
485e475c17 Remove unused tests/ directory
also removes hack/run_bdd_suite.sh

This is in preparation of flattening all vendor
directories in this repository into one:

These tests had their own vendor directories
with outdated dependencies conflicting with
deps from the main vendor/ dir.

Due to the fact that this is
unused/dead code, removal should be safe.
2019-12-09 23:48:15 +01:00
OpenShift Merge Robot
a9d73356bf Merge pull request #2506 from JAORMX/add-gosec
Introduce gosec for security checks
2019-10-29 03:31:50 +01:00
Mike Fedosin
1282443188 Bump golang version to 1.12
This PR updated the current building system and ci images from
golang 1.10 to 1.12.
2019-10-22 22:48:24 +02:00
Juan Antonio Osorio Robles
0a854cdda0 Introduce gosec for security checks
gosec does static code analysis and checks for common security issues in
golang codebases.

This PR introduces a script that will run gosec similarly to other check
tools.
2019-10-21 10:54:39 +01:00
Colin Walters
05a3e852dd hack/update-rhcos-bootimage: Require ART endpoint
Don't allow people to point to e.g. an RHT-internal endpoint.

See: https://github.com/openshift/installer/pull/2462
2019-10-07 14:22:50 +00:00
OpenShift Merge Robot
5b714fe2e4 Merge pull request #1829 from wking/source-git-tag
Bug 1715001: hack/build: Use BUILD_VERSION if non-empty
2019-08-28 20:50:51 -07:00
Stephen Benjamin
0c706c455a hack: remove compile time RELEASE_IMAGE override
The location of the defaultReleaseImage variable has moved to
pkg/asset/releaseimage, and this doesn't currently work. It also appears
nothing is relying on this feature so we can remove it.  If you want to
override the release image, you can do at run time with
OPENSHIFT_RELEASE_IMAGE_OVERRIDE, which functions the same other than
not being embedded in the produced openshift-install binary.
2019-08-14 19:24:03 -04:00
W. Trevor King
dd7cff388d hack/build: Use BUILD_VERSION if non-empty
Like 3313c08266 (hack/build: Use SOURCE_GIT_COMMIT if set, 2019-05-13, #1828).
This should fix [1]:

  $ ./openshift-install version
  ./openshift-install v4.1.0-201905212232-dirty
  ...

which is from Git looking at the build directory (and seeing -dirty
because doozer is adjusting our Dockerfile?).  Since the tags aren't
in the source repository (github.com/openshift/install), we need to
use the BUILD_* variables which were added to Doozer in [2].  In a
recent build [3], these looked like:

  ENV SOURCE_GIT_COMMIT=8aa5b10aa82d201deba0befbfac9fabf76f719f4 SOURCE_DATE_EPOCH=1561485623 BUILD_VERSION=v4.1.9 SOURCE_GIT_URL=https://github.com/openshift/installer SOURCE_GIT_TAG=8aa5b10a BUILD_RELEASE=201907311355

With this commit, we prefer BUILD_VERSION, falling back to 'git
describe' in the local repository if BUILD_VERSION is unset or empty.

Doozer also sets BUILD_RELEASE, but Luke says we always set
BUILD_VERSION in OpenShift 4 so there's no need to include it in the
fallback chain [4] (otherwise I'd have preferred BUILD_VERSION,
falling back to BUILD_RELEASE, falling back to Git inspection).

I don't see a need to use:

  GIT_TAG="${BUILD_VERSION}-${BUILD_RELEASE}"

with both, because if we know the version is v4.1.8, who cares about
the timestamp?  We only ever get a single 4.1.8 far enough along to
show up in front of end-users, even if there's a build hiccup or some
such that causes us to build multiple rounds with the same version
internally.  There's a bunch of v4.2.0, etc., in the run-up to a new
minor release, but we have commit hashes to distinguish between those.

[1]: https://github.com/openshift/installer/issues/1828
[2]: b02114a0bb
     distgit.py: ART-165 add build ENV vars, 2019-07-07
[3]: http://pkgs.devel.redhat.com/cgit/containers/ose-installer/tree/Dockerfile?h=rhaos-4.1-rhel-7
[4]: https://github.com/openshift/installer/pull/1829#discussion_r310290990
2019-08-02 15:13:58 -07:00