@@ -11,7 +11,6 @@ import (
1111
1212 "github.com/openshift/origin/pkg/monitortestframework"
1313
14- "github.com/openshift/origin/pkg/clioptions/imagesetup"
1514 "github.com/openshift/origin/pkg/monitor/monitorapi"
1615 "github.com/openshift/origin/test/extended/util/image"
1716
@@ -30,6 +29,7 @@ type RunMonitorFlags struct {
3029 DisplayFromNow bool
3130 ExactMonitorTests []string
3231 DisableMonitorTests []string
32+ FromRepository string
3333
3434 genericclioptions.IOStreams
3535}
@@ -89,6 +89,7 @@ func (f *RunMonitorFlags) BindFlags(flags *pflag.FlagSet) {
8989 flags .StringSliceVar (& f .ExactMonitorTests , "monitor" , f .ExactMonitorTests ,
9090 fmt .Sprintf ("list of exactly which monitors to enable. All others will be disabled. Current monitors are: [%s]" , strings .Join (monitorNames , ", " )))
9191 flags .StringSliceVar (& f .DisableMonitorTests , "disable-monitor" , f .DisableMonitorTests , "list of monitors to disable. Defaults for others will be honored." )
92+ flags .StringVar (& f .FromRepository , "from-repository" , f .FromRepository , "A container image repository to retrieve test images from." )
9293}
9394
9495func (f * RunMonitorFlags ) ToOptions () (* RunMonitorOptions , error ) {
@@ -113,6 +114,7 @@ func (f *RunMonitorFlags) ToOptions() (*RunMonitorOptions, error) {
113114 DisplayFilterFn : displayFilterFn ,
114115 MonitorTests : monitorTestRegistry ,
115116 IOStreams : f .IOStreams ,
117+ FromRepository : f .FromRepository ,
116118 }, nil
117119}
118120
@@ -140,6 +142,7 @@ type RunMonitorOptions struct {
140142 ArtifactDir string
141143 DisplayFilterFn monitorapi.EventIntervalMatchesFunc
142144 MonitorTests monitortestframework.MonitorTestRegistry
145+ FromRepository string
143146
144147 genericclioptions.IOStreams
145148}
@@ -148,9 +151,11 @@ type RunMonitorOptions struct {
148151// events accumulated to Out. When the user hits CTRL+C or signals termination the
149152// condition intervals (all non-instantaneous events) are reported to Out.
150153func (o * RunMonitorOptions ) Run () error {
154+ // set globals so that helpers will create pods with the mapped images if we create them from this process.
155+ image .InitializeImages (o .FromRepository )
156+
151157 fmt .Fprintf (o .Out , "Starting the monitor.\n " )
152158
153- image .InitializeImages (imagesetup .DefaultTestImageMirrorLocation )
154159 restConfig , err := monitor .GetMonitorRESTConfig ()
155160 if err != nil {
156161 return err
@@ -176,12 +181,15 @@ func (o *RunMonitorOptions) Run() error {
176181 }()
177182 signal .Notify (abortCh , syscall .SIGINT , syscall .SIGTERM )
178183
184+ monitorTestInfo := monitortestframework.MonitorTestInitializationInfo {
185+ ClusterStabilityDuringTest : monitortestframework .Stable ,
186+ }
179187 recorder := monitor .WrapWithJSONLRecorder (monitor .NewRecorder (), o .Out , o .DisplayFilterFn )
180188 m := monitor .NewMonitor (
181189 recorder ,
182190 restConfig ,
183191 o .ArtifactDir ,
184- o . MonitorTests ,
192+ defaultmonitortests . NewMonitorTestsFor ( monitorTestInfo ) ,
185193 )
186194 if err := m .Start (ctx ); err != nil {
187195 return err
0 commit comments