@@ -34,13 +34,15 @@ public class HoptimatorOperatorApp {
34
34
35
35
final String modelPath ;
36
36
final String namespace ;
37
+ final ApiClient apiClient ;
37
38
final Properties properties ;
38
39
final Resource .Environment environment ;
39
40
40
41
/** This constructor is likely to evolve and break. */
41
- public HoptimatorOperatorApp (String modelPath , String namespace , Properties properties ) {
42
+ public HoptimatorOperatorApp (String modelPath , String namespace , ApiClient apiClient , Properties properties ) {
42
43
this .modelPath = modelPath ;
43
44
this .namespace = namespace ;
45
+ this .apiClient = apiClient ;
44
46
this .properties = properties ;
45
47
this .environment = new Resource .SimpleEnvironment (properties );
46
48
}
@@ -73,7 +75,8 @@ public static void main(String[] args) throws Exception {
73
75
String modelFileInput = cmd .getArgs ()[0 ];
74
76
String namespaceInput = cmd .getOptionValue ("namespace" , "default" );
75
77
76
- new HoptimatorOperatorApp (modelFileInput , namespaceInput , new Properties ()).run ();
78
+ new HoptimatorOperatorApp (modelFileInput , namespaceInput , Config .defaultClient (),
79
+ new Properties ()).run ();
77
80
}
78
81
79
82
public void run () throws Exception {
@@ -83,7 +86,6 @@ public void run() throws Exception {
83
86
// ensure model file works, and that static classes are initialized in the main thread
84
87
HoptimatorPlanner planner = plannerFactory .makePlanner ();
85
88
86
- ApiClient apiClient = Config .defaultClient ();
87
89
apiClient .setHttpClient (apiClient .getHttpClient ().newBuilder ()
88
90
.readTimeout (0 , TimeUnit .SECONDS ).build ());
89
91
SharedInformerFactory informerFactory = new SharedInformerFactory (apiClient );
0 commit comments