@@ -46,7 +46,6 @@ type AppWrapperReconciler struct {
46
46
}
47
47
48
48
var (
49
- scaledAppwrapper []string
50
49
reuse = true
51
50
ocmClusterID string
52
51
ocmToken string
@@ -121,7 +120,6 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
121
120
return ctrl.Result {}, nil
122
121
}
123
122
124
- //TODO Investigate isAWPending()
125
123
demandPerInstanceType := r .discoverInstanceTypes (& appwrapper )
126
124
//for userRequestedInstanceType := range demandPerInstanceType {
127
125
if useMachineSets {
@@ -251,30 +249,6 @@ func canScaleMachinepool(demandPerInstanceType map[string]int) bool {
251
249
return true
252
250
}
253
251
254
- func (r * AppWrapperReconciler ) IsAwPending (ctx context.Context ) (false bool , aw * arbv1.AppWrapper ) {
255
- queuedJobs := arbv1.AppWrapperList {}
256
- err := r .List (ctx , & queuedJobs )
257
- if err != nil {
258
- klog .Fatalf ("Error listing: %v" , err )
259
- }
260
- for _ , aw := range queuedJobs .Items {
261
- //skip
262
- if contains (scaledAppwrapper , aw .Name ) {
263
- continue
264
- }
265
-
266
- status := aw .Status .State
267
- allconditions := aw .Status .Conditions
268
- for _ , condition := range allconditions {
269
- if status == "Pending" && strings .Contains (condition .Message , "Insufficient" ) {
270
- klog .Infof ("Pending AppWrapper %v needs scaling" , aw .Name )
271
- return true , & aw
272
- }
273
- }
274
- }
275
- return false , nil
276
- }
277
-
278
252
// add logic to check for matching pending AppWrappers
279
253
func (r * AppWrapperReconciler ) findExactMatch (ctx context.Context , aw * arbv1.AppWrapper ) * arbv1.AppWrapper {
280
254
var match * arbv1.AppWrapper = nil
@@ -315,17 +289,4 @@ func (r *AppWrapperReconciler) scaleDown(ctx context.Context, aw *arbv1.AppWrapp
315
289
} else {
316
290
r .deleteMachineSet (ctx , aw )
317
291
}
318
-
319
- // make a separate slice
320
- for idx := range scaledAppwrapper {
321
- if scaledAppwrapper [idx ] == aw .Name {
322
- scaledAppwrapper [idx ] = ""
323
- }
324
- }
325
-
326
- pending , aw := r .IsAwPending (ctx )
327
- if pending {
328
- //demandPerInstanceType := r.discoverInstanceTypes(aw)
329
- //r.scaleUp(ctx, aw, demandPerInstanceType)
330
- }
331
292
}
0 commit comments