From 89cbaa544f23d7507a724f95943cde3b0a17fa8a Mon Sep 17 00:00:00 2001 From: Nick Carboni Date: Mon, 6 Jan 2025 16:20:21 -0500 Subject: [PATCH] add coreos image installer cli arg --- src/commands/actions/install_cmd.go | 4 ++++ src/commands/actions/install_cmd_test.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/commands/actions/install_cmd.go b/src/commands/actions/install_cmd.go index 58bfd7d77..775524ebf 100644 --- a/src/commands/actions/install_cmd.go +++ b/src/commands/actions/install_cmd.go @@ -170,6 +170,10 @@ func (a *install) getFullInstallerCommand() string { installerCmdArgs = append(installerCmdArgs, "--service-ips", strings.Join(a.installParams.ServiceIps, ",")) } + if len(a.installParams.CoreosImage) > 0 { + installerCmdArgs = append(installerCmdArgs, "--coreos-image", a.installParams.CoreosImage) + } + return fmt.Sprintf("%s %s %s", shellescape.QuoteCommand(podmanCmd), swag.StringValue(a.installParams.InstallerImage), shellescape.QuoteCommand(installerCmdArgs)) } diff --git a/src/commands/actions/install_cmd_test.go b/src/commands/actions/install_cmd_test.go index 2297b7dc2..6b6482973 100644 --- a/src/commands/actions/install_cmd_test.go +++ b/src/commands/actions/install_cmd_test.go @@ -421,4 +421,9 @@ var _ = Describe("installer test", func() { }) + It("Args adds the CoreosImage from the install command request when set", func() { + installCommandRequest.CoreosImage = "example.com/openshift/coreos:tag" + args := getInstall(installCommandRequest, filesystem, false).Args() + Expect(strings.Join(args, " ")).To(ContainSubstring("--coreos-image example.com/openshift/coreos:tag")) + }) })