Skip to content

Commit

Permalink
chore(scheduler): improve logging (#2283)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffrey1330 committed Oct 18, 2023
1 parent dc6a651 commit 59fa565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scheduler/pkg/klcpermit/permit.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ func (pl *Permit) Name() string {

func (pl *Permit) Permit(ctx context.Context, state *framework.CycleState, p *v1.Pod, nodeName string) (*framework.Status, time.Duration) {

klog.Infof("[Keptn Permit Plugin] waiting for pre-deployment checks on %s", p.GetObjectMeta().GetName())
klog.Infof("[Keptn Permit Plugin] waiting for pre-deployment checks on %s in namespace %s", p.GetObjectMeta().GetName(), p.GetObjectMeta().GetNamespace())

// check the permit immediately, to fail early in case the pod cannot be queued
switch pl.workloadManager.Permit(ctx, p) {

case Success:
klog.Infof("[Keptn Permit Plugin] passed pre-deployment checks on %s", p.GetObjectMeta().GetName())
klog.Infof("[Keptn Permit Plugin] passed pre-deployment checks on %s in namespace %s", p.GetObjectMeta().GetName(), p.GetObjectMeta().GetNamespace())
return framework.NewStatus(framework.Success), 0 * time.Second
default:
klog.Infof("[Keptn Permit Plugin] waiting for pre-deployment checks on %s to succeed", p.GetObjectMeta().GetName())
klog.Infof("[Keptn Permit Plugin] waiting for pre-deployment checks on %s in namespace %s to succeed", p.GetObjectMeta().GetName(), p.GetObjectMeta().GetNamespace())
go func() {
// create a new context since we are in a new goroutine
ctx2, cancel := context.WithCancel(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion scheduler/pkg/klcpermit/workflow_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (sMgr *WorkloadManager) Permit(ctx context.Context, pod *corev1.Pod) Status
crd, err := sMgr.GetCRD(ctx, pod.Namespace, name)

if err != nil {
klog.Infof("[Keptn Permit Plugin] could not find workloadVersion crd %s, err:%s", name, err.Error())
klog.Infof("[Keptn Permit Plugin] could not find workloadVersion crd %s in namespace %s, err:%s", name, pod.GetObjectMeta().GetNamespace(), err.Error())
return WorkloadVersionNotFound
}

Expand Down

0 comments on commit 59fa565

Please sign in to comment.