From d1b006a281b62cc09551a26b91f6bc61cb6e400d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 15 Nov 2019 21:57:27 -0800 Subject: [PATCH] pkg/cli/admin/release/extract_tools: Inject release version into installer We've been injecting the release version into oc since 13215d7176 (Bug 1715001: when extracting tools from payload, 'oc version' should report payload version, 2019-09-10, #88), but we want to inject it into the installer to to avoid potential confusion from: $ 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 --- pkg/cli/admin/release/extract_tools.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkg/cli/admin/release/extract_tools.go b/pkg/cli/admin/release/extract_tools.go index 8bc892c5a7..bcc63f4b9e 100644 --- a/pkg/cli/admin/release/extract_tools.go +++ b/pkg/cli/admin/release/extract_tools.go @@ -180,18 +180,20 @@ func (o *ExtractOptions) extractCommand(command string) error { Command: "openshift-install", Mapping: extract.Mapping{Image: "installer-artifacts", From: "usr/share/openshift/mac/openshift-install"}, - Readme: readmeInstallUnix, - InjectReleaseImage: true, - ArchiveFormat: "openshift-install-mac-%s.tar.gz", + Readme: readmeInstallUnix, + InjectReleaseImage: true, + InjectReleaseVersion: true, + ArchiveFormat: "openshift-install-mac-%s.tar.gz", }, { OS: "linux", Command: "openshift-install", Mapping: extract.Mapping{Image: "installer", From: "usr/bin/openshift-install"}, - Readme: readmeInstallUnix, - InjectReleaseImage: true, - ArchiveFormat: "openshift-install-linux-%s.tar.gz", + Readme: readmeInstallUnix, + InjectReleaseImage: true, + InjectReleaseVersion: true, + ArchiveFormat: "openshift-install-linux-%s.tar.gz", }, { OS: "linux", @@ -199,9 +201,10 @@ func (o *ExtractOptions) extractCommand(command string) error { Optional: true, Mapping: extract.Mapping{Image: "baremetal-installer", From: "usr/bin/openshift-install"}, - Readme: readmeInstallUnix, - InjectReleaseImage: true, - ArchiveFormat: "openshift-baremetal-install-linux-%s.tar.gz", + Readme: readmeInstallUnix, + InjectReleaseImage: true, + InjectReleaseVersion: true, + ArchiveFormat: "openshift-baremetal-install-linux-%s.tar.gz", }, }