Skip to content

Commit e08a8b4

Browse files
Merge pull request #31025 from hongkailiu/apiserver-incluster-availability
NO-JIRA: Fix UpgradeTargetPayloadImagePullSpec
2 parents dcd145e + 3313787 commit e08a8b4

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

pkg/cmd/openshift-tests/run-upgrade/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func NewRunUpgradeSuiteFlags(streams genericclioptions.IOStreams, fromRepository
4848
func (f *RunUpgradeSuiteFlags) BindFlags(flags *pflag.FlagSet) {
4949
flags.StringVar(&f.FromRepository, "from-repository", f.FromRepository, "A container image repository to retrieve test images from.")
5050
flags.StringVar(&f.ProviderTypeOrJSON, "provider", f.ProviderTypeOrJSON, "The cluster infrastructure provider. Will automatically default to the correct value.")
51-
flags.StringVar(&f.ToImage, "to-image", f.ToImage, "Specify the image to test an upgrade to.")
51+
flags.StringVar(&f.ToImage, "to-image", f.ToImage, "Specify the images to test an upgrade to, separated by comma.")
5252
flags.StringSliceVar(&f.TestOptions, "options", f.TestOptions, "A set of KEY=VALUE options to control the test. See the help text.")
5353
f.GinkgoRunSuiteOptions.BindFlags(flags)
5454
f.TestSuiteSelectionFlags.BindFlags(flags)

pkg/cmd/openshift-tests/run-upgrade/options.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"os"
77
"path/filepath"
8+
"strings"
89

910
"github.com/openshift/origin/pkg/monitortestframework"
1011

@@ -109,10 +110,19 @@ func (o *RunUpgradeSuiteOptions) Run(ctx context.Context) error {
109110
return err
110111
}
111112

113+
last := o.ToImage
114+
if strings.Contains(last, ",") {
115+
splits := strings.Split(o.ToImage, ",")
116+
last = strings.TrimSpace(splits[len(splits)-1])
117+
if last == "" {
118+
return fmt.Errorf("failed to get the final upgrade destination from %s", o.ToImage)
119+
}
120+
}
121+
112122
// TODO the gingkoRunSuiteOptions needs to have flags then calculated options to express specified versus computed values
113123
monitorTestInfo := monitortestframework.MonitorTestInitializationInfo{
114124
ClusterStabilityDuringTest: monitortestframework.Stable,
115-
UpgradeTargetPayloadImagePullSpec: o.ToImage,
125+
UpgradeTargetPayloadImagePullSpec: last,
116126
ExactMonitorTests: o.GinkgoRunSuiteOptions.ExactMonitorTests,
117127
DisableMonitorTests: o.GinkgoRunSuiteOptions.DisableMonitorTests,
118128
}

0 commit comments

Comments
 (0)