Bug 1773257 - openshift-install version not updated at extraction-time
Summary: openshift-install version not updated at extraction-time
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 4.3.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.4.0
Assignee: W. Trevor King
QA Contact: Johnny Liu
: 1780790 (view as bug list)
Depends On: 1715001
Blocks: 1728714 1790537
TreeView+ depends on / blocked
Reported: 2019-11-16 23:58 UTC by W. Trevor King
Modified: 2020-05-04 11:16 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1715001
: 1790537 (view as bug list)
Last Closed: 2020-05-04 11:15:36 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Github openshift installer pull 2682 'None' closed Bug 1773257: pkg/version: Prepare of extract-time oc version injection 2020-09-22 19:32:48 UTC
Github openshift oc pull 165 'None' closed Bug 1773257: pkg/cli/admin/release/extract_tools: Inject release version into installer 2020-09-22 19:32:52 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:16:14 UTC

Description W. Trevor King 2019-11-16 23:58:29 UTC
$ oc adm release extract --command=openshift-install quay.io/openshift-release-dev/ocp-release:4.2.7
$ ./openshift-install version
./openshift-install v4.2.5
built from commit 425e4ff0037487e32571258640b39f56d5ee5572
release image quay.io/openshift-release-dev/ocp-release@sha256:bac62983757570b9b8f8bc84c740782984a255c16372b3e30cfc8b52c0a187b9

Is potentially confusing, with the 4.2.7 installer printing 4.2.5 because the only installer thing that changed is the pinned release pullspec and ART hadn't bothered to rebuild the installer because the pullspec is injected automatically when oc extracts the installer.  oc should inject the release version as well, so the output would be:

./openshift-install v4.2.7

Comment 1 W. Trevor King 2019-11-23 05:22:09 UTC
Blocked by bug 1775875, but I'm not going to record that in structured Bugzilla metadata, because it would confuse the Bugzilla-labeling Prow bot.

Comment 2 W. Trevor King 2019-12-06 23:35:40 UTC
*** Bug 1780790 has been marked as a duplicate of this bug. ***

Comment 3 Clayton Coleman 2020-01-11 17:25:13 UTC
This severity is high because it’s confusing users.

Comment 4 W. Trevor King 2020-01-13 14:58:44 UTC
neither installer#249 nor oc#165 made it into release-4.3.  I'll clone a new bug for 4.3.

Comment 6 Johnny Liu 2020-01-14 02:06:32 UTC
Verified this bug with 4.4.0-0.nightly-2020-01-13-224954, pass.

# oc adm release extract --command='openshift-install' "registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-224954" --to=/usr/bin

# openshift-install version
openshift-install v4.4.0
built from commit 086545ea56051f1a89c1454739fc5f49344ad9c2
release image registry.svc.ci.openshift.org/ocp/release@sha256:650910de019056d637c2f3f92782346c9b20890e497f3ad0a60cfd83a013f89a

Comment 7 W. Trevor King 2020-01-14 02:52:56 UTC
Uh, I'd have expected it to use the nightly name.  Trying to reproduce, first grab a current oc:

$ oc adm release extract --command=oc registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-224954

Then use that oc to extract the installer:

$ ./oc adm release extract --command=openshift-install registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-224954
warning: Unable to make all expected replacements in openshift-install.  Remaining: release version
$ ./openshift-install version
./openshift-install v4.4.0
built from commit 086545ea56051f1a89c1454739fc5f49344ad9c2
release image registry.svc.ci.openshift.org/ocp/release@sha256:650910de019056d637c2f3f92782346c9b20890e497f3ad0a60cfd83a013f89a

That's because the nightly we're using is too old:

$ oc adm release info --commits registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-224954 | grep ' installer '
  installer                                      https://github.com/openshift/installer                                      086545ea56051f1a89c1454739fc5f49344ad9c2
$ git --no-pager log --oneline -8 origin/master
91d6918f2 (origin/master, origin/HEAD) Merge pull request #2841 from jcpowermac/CORS-1319
4cc3ffcf7 (origin/release-4.5, origin/release-4.4) Merge pull request #2911 from jaypoulz/patch-1
c4808d352 (origin/pr/2911) images/libvirt: remove epel-release
0ddfb8bb5 (origin/pr/2841) Add vsphereprovider api from machine-api-operator
60e6212d3 Adding terraform for vSphere IPI; changes to tfvars to support it Added tags to vSphere vCenter objects that will need to be destroyed. Removed the ability to create a resource pool.  Using the cluster default RP inplace.  The customer can move the machines to a properly configured RP if so desired.
4bb798683 Merge pull request #2682 from wking/extract-time-installer-version-injection
37d12b41a Merge pull request #1948 from rgolangh/ovirt_provider
086545ea5 Merge pull request #2899 from luis5tb/kuryr-destroy

Trying with [1]:

$ oc adm release extract --command=oc registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-232206
$ ./oc adm release extract --command=openshift-install registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-13-232206
$ ./openshift-install version
./openshift-install 4.4.0-0.nightly-2020-01-13-232206
built from commit 4bb7986830ec15de43f6f0b6a5f40d9b761925bf
release image registry.svc.ci.openshift.org/ocp/release@sha256:a87e166f22b11f0cafbb466327850a195feea7995c45bdc0b7f9c4d3846e3f8a

Which is what we were looking for, landing sometime between 4.4.0-0.nightly-2020-01-13-224954 and 4.4.0-0.nightly-2020-01-13-232206.

[1]: https://openshift-release.svc.ci.openshift.org/releasestream/4.4.0-0.nightly/release/4.4.0-0.nightly-2020-01-13-232206

Comment 8 Johnny Liu 2020-01-14 05:36:43 UTC
Thanks for your detailed steps.

Re-run verification:
1. install openshift-clinets from http://download.eng.bos.redhat.com/rcm-guest/puddles/RHAOS/AtomicOpenShift/4.4/latest/x86_64/os
2. extract and update oc from 4.4.0-0.nightly-2020-01-14-004804
# oc adm release extract --command=oc registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-14-004804

# mv ./oc /usr/bin/oc 

# oc version
Client Version: 4.4.0-0.nightly-2020-01-14-004804

# oc adm release extract --command='openshift-install' "registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-01-14-004804" --to=/usr/bin

# openshift-install version
openshift-install 4.4.0-0.nightly-2020-01-14-004804
built from commit 4cc3ffcf77119de9f7882f8588c06ca5c43837ea
release image registry.svc.ci.openshift.org/ocp/release@sha256:b0ddde478bbdf9215aebe24b4a4ed8f170f751ebea6eff8a9f5b8d4b7a63999d

Comment 10 errata-xmlrpc 2020-05-04 11:15:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.