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

fix: removed failure branch #1175

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Changes from all 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
8 changes: 1 addition & 7 deletions scheduler/pkg/klcpermit/permit.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ func (pl *Permit) Permit(ctx context.Context, state *framework.CycleState, p *v1
// check the permit immediately, to fail early in case the pod cannot be queued
switch pl.workloadManager.Permit(ctx, p) {

case Failure:
klog.Infof("[Keptn Permit Plugin] failed pre-deployment checks on %s", p.GetObjectMeta().GetName())
return framework.NewStatus(framework.Error), 0 * time.Second
case Success:
klog.Infof("[Keptn Permit Plugin] passed pre-deployment checks on %s", p.GetObjectMeta().GetName())
return framework.NewStatus(framework.Success), 0 * time.Second
default:
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 to succeed", p.GetObjectMeta().GetName())
go func() {
// create a new context since we are in a new goroutine
ctx2, cancel := context.WithCancel(context.Background())
Expand All @@ -60,9 +57,6 @@ func (pl *Permit) monitorPod(ctx context.Context, p *v1.Pod) {

for {
switch pl.workloadManager.Permit(ctx, p) {
case Failure:
waitingPodHandler.Reject(PluginName, "Pre Deployment Check failed")
return
case Success:
waitingPodHandler.Allow(PluginName)
return
Expand Down