Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(scheduler): improve logging #2283

Merged
merged 5 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scheduler/pkg/klcpermit/permit.go
RealAnna marked this conversation as resolved.
Show resolved Hide resolved
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", p.GetObjectMeta().GetName(), p.GetObjectMeta().GetNamespace())
odubajDT marked this conversation as resolved.
Show resolved Hide resolved

// 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", 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 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, err:%s", name, err.Error(), pod.GetObjectMeta().GetName(), pod.GetObjectMeta().GetNamespace())
odubajDT marked this conversation as resolved.
Show resolved Hide resolved
return WorkloadVersionNotFound
}

Expand Down
Loading