Skip to content

Commit d1d55fa

Browse files
Merge pull request #28286 from dgoodwin/revert-28258-use_mirrored_images
Revert "Force using mirrored images in disruption tests"
2 parents 47ffece + 89f2076 commit d1d55fa

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

cmd/openshift-tests/openshift-tests.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ import (
1414
"github.com/openshift/origin/pkg/cmd/openshift-tests/disruption"
1515
"github.com/openshift/origin/pkg/cmd/openshift-tests/images"
1616
"github.com/openshift/origin/pkg/cmd/openshift-tests/monitor"
17-
run_monitor "github.com/openshift/origin/pkg/cmd/openshift-tests/monitor/run"
17+
run2 "github.com/openshift/origin/pkg/cmd/openshift-tests/monitor/run"
1818
"github.com/openshift/origin/pkg/cmd/openshift-tests/monitor/timeline"
1919
risk_analysis "github.com/openshift/origin/pkg/cmd/openshift-tests/risk-analysis"
2020
"github.com/openshift/origin/pkg/cmd/openshift-tests/run"
2121
run_disruption "github.com/openshift/origin/pkg/cmd/openshift-tests/run-disruption"
2222
run_test "github.com/openshift/origin/pkg/cmd/openshift-tests/run-test"
2323
run_upgrade "github.com/openshift/origin/pkg/cmd/openshift-tests/run-upgrade"
24-
run_resourcewatch "github.com/openshift/origin/pkg/resourcewatch/cmd"
24+
"github.com/openshift/origin/pkg/resourcewatch/cmd"
2525
testginkgo "github.com/openshift/origin/pkg/test/ginkgo"
2626
exutil "github.com/openshift/origin/test/extended/util"
2727
"github.com/sirupsen/logrus"
@@ -79,11 +79,11 @@ func main() {
7979
images.NewImagesCommand(),
8080
run_test.NewRunTestCommand(ioStreams),
8181
dev.NewDevCommand(),
82-
run_monitor.NewRunMonitorCommand(ioStreams),
82+
run2.NewRunMonitorCommand(ioStreams),
8383
monitor.NewMonitorCommand(ioStreams),
8484
disruption.NewDisruptionCommand(ioStreams),
8585
risk_analysis.NewTestFailureRiskAnalysisCommand(),
86-
run_resourcewatch.NewRunResourceWatchCommand(),
86+
cmd.NewRunResourceWatchCommand(),
8787
timeline.NewTimelineCommand(ioStreams),
8888
run_disruption.NewRunInClusterDisruptionMonitorCommand(ioStreams),
8989
)

pkg/cmd/openshift-tests/monitor/run/run_monitor_command.go

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010

1111
"github.com/openshift/origin/pkg/monitortestframework"
1212

13+
"github.com/openshift/origin/pkg/clioptions/imagesetup"
1314
"github.com/openshift/origin/pkg/monitor/monitorapi"
1415
"github.com/openshift/origin/test/extended/util/image"
1516

@@ -26,7 +27,6 @@ import (
2627
type RunMonitorFlags struct {
2728
ArtifactDir string
2829
DisplayFromNow bool
29-
FromRepository string
3030

3131
genericclioptions.IOStreams
3232
}
@@ -77,7 +77,6 @@ func newRunCommand(name string, streams genericclioptions.IOStreams) *cobra.Comm
7777
func (f *RunMonitorFlags) BindFlags(flags *pflag.FlagSet) {
7878
flags.StringVar(&f.ArtifactDir, "artifact-dir", f.ArtifactDir, "The directory where monitor events will be stored.")
7979
flags.BoolVar(&f.DisplayFromNow, "display-from-now", f.DisplayFromNow, "Only display intervals from at or after this comand was started.")
80-
flags.StringVar(&f.FromRepository, "from-repository", f.FromRepository, "A container image repository to retrieve test images from.")
8180
}
8281

8382
func (f *RunMonitorFlags) ToOptions() (*RunMonitorOptions, error) {
@@ -96,27 +95,23 @@ func (f *RunMonitorFlags) ToOptions() (*RunMonitorOptions, error) {
9695
ArtifactDir: f.ArtifactDir,
9796
DisplayFilterFn: displayFilterFn,
9897
IOStreams: f.IOStreams,
99-
FromRepository: f.FromRepository,
10098
}, nil
10199
}
102100

103101
type RunMonitorOptions struct {
104102
ArtifactDir string
105103
DisplayFilterFn monitorapi.EventIntervalMatchesFunc
106-
FromRepository string
107104

108105
genericclioptions.IOStreams
109106
}
110107

111108
// Run starts monitoring the cluster by invoking Start, periodically printing the
112109
// events accumulated to Out. When the user hits CTRL+C or signals termination the
113110
// condition intervals (all non-instantaneous events) are reported to Out.
114-
func (o *RunMonitorOptions) Run() error {
115-
// set globals so that helpers will create pods with the mapped images if we create them from this process.
116-
image.InitializeImages(o.FromRepository)
117-
118-
fmt.Fprintf(o.Out, "Starting the monitor.\n")
111+
func (f *RunMonitorOptions) Run() error {
112+
fmt.Fprintf(f.Out, "Starting the monitor.\n")
119113

114+
image.InitializeImages(imagesetup.DefaultTestImageMirrorLocation)
120115
restConfig, err := monitor.GetMonitorRESTConfig()
121116
if err != nil {
122117
return err
@@ -127,12 +122,12 @@ func (o *RunMonitorOptions) Run() error {
127122
abortCh := make(chan os.Signal, 2)
128123
go func() {
129124
<-abortCh
130-
fmt.Fprintf(o.ErrOut, "Interrupted, terminating\n")
125+
fmt.Fprintf(f.ErrOut, "Interrupted, terminating\n")
131126
sampler.TearDownInClusterMonitors(restConfig)
132127
cancelFn()
133128

134129
sig := <-abortCh
135-
fmt.Fprintf(o.ErrOut, "Interrupted twice, exiting (%s)\n", sig)
130+
fmt.Fprintf(f.ErrOut, "Interrupted twice, exiting (%s)\n", sig)
136131
switch sig {
137132
case syscall.SIGINT:
138133
os.Exit(130)
@@ -145,21 +140,21 @@ func (o *RunMonitorOptions) Run() error {
145140
monitorTestInfo := monitortestframework.MonitorTestInitializationInfo{
146141
ClusterStabilityDuringTest: monitortestframework.Stable,
147142
}
148-
recorder := monitor.WrapWithJSONLRecorder(monitor.NewRecorder(), o.Out, o.DisplayFilterFn)
143+
recorder := monitor.WrapWithJSONLRecorder(monitor.NewRecorder(), f.Out, f.DisplayFilterFn)
149144
m := monitor.NewMonitor(
150145
recorder,
151146
restConfig,
152-
o.ArtifactDir,
147+
f.ArtifactDir,
153148
defaultmonitortests.NewMonitorTestsFor(monitorTestInfo),
154149
)
155150
if err := m.Start(ctx); err != nil {
156151
return err
157152
}
158-
fmt.Fprintf(o.Out, "Monitor started, waiting for ctrl+C to stop...\n")
153+
fmt.Fprintf(f.Out, "Monitor started, waiting for ctrl+C to stop...\n")
159154

160155
<-ctx.Done()
161156

162-
fmt.Fprintf(o.Out, "Monitor shutting down, this may take up to five minutes...\n")
157+
fmt.Fprintf(f.Out, "Monitor shutting down, this may take up to five minutes...\n")
163158

164159
cleanupContext, cleanupCancel := context.WithTimeout(context.Background(), 5*time.Minute)
165160
defer cleanupCancel()

0 commit comments

Comments
 (0)