Log correct runner that was deleted (#349)

This commit is contained in:
Johannes Nicolai 2021-02-25 00:38:55 +01:00 committed by GitHub
parent 1d1453c5f2
commit 31e5e61155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,10 @@ import (
"context"
"errors"
"fmt"
gogithub "github.com/google/go-github/v33/github"
"time"
gogithub "github.com/google/go-github/v33/github"
"github.com/go-logr/logr"
kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
@ -159,7 +160,6 @@ func (r *RunnerReplicaSetReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e
if offline {
notBusy = append(notBusy, runner)
}
} else if !busy {
notBusy = append(notBusy, runner)
}
@ -176,7 +176,7 @@ func (r *RunnerReplicaSetReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e
return ctrl.Result{}, err
}
r.Recorder.Event(&rs, corev1.EventTypeNormal, "RunnerDeleted", fmt.Sprintf("Deleted runner '%s'", myRunners[i].Name))
r.Recorder.Event(&rs, corev1.EventTypeNormal, "RunnerDeleted", fmt.Sprintf("Deleted runner '%s'", notBusy[i].Name))
log.Info("Deleted runner", "runnerreplicaset", rs.ObjectMeta.Name)
}
} else if desired > available {