Skip to content

Commit fcc191e

Browse files
committed
Removed pending functions for AppWrappers
1 parent c1b1f2d commit fcc191e

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

controllers/appwrapper_controller.go

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ type AppWrapperReconciler struct {
4646
}
4747

4848
var (
49-
scaledAppwrapper []string
5049
reuse = true
5150
ocmClusterID string
5251
ocmToken string
@@ -121,7 +120,6 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
121120
return ctrl.Result{}, nil
122121
}
123122

124-
//TODO Investigate isAWPending()
125123
demandPerInstanceType := r.discoverInstanceTypes(&appwrapper)
126124
//for userRequestedInstanceType := range demandPerInstanceType {
127125
if useMachineSets {
@@ -251,30 +249,6 @@ func canScaleMachinepool(demandPerInstanceType map[string]int) bool {
251249
return true
252250
}
253251

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-
278252
// add logic to check for matching pending AppWrappers
279253
func (r *AppWrapperReconciler) findExactMatch(ctx context.Context, aw *arbv1.AppWrapper) *arbv1.AppWrapper {
280254
var match *arbv1.AppWrapper = nil
@@ -315,17 +289,4 @@ func (r *AppWrapperReconciler) scaleDown(ctx context.Context, aw *arbv1.AppWrapp
315289
} else {
316290
r.deleteMachineSet(ctx, aw)
317291
}
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-
}
331292
}

0 commit comments

Comments
 (0)