Skip to content

Commit

Permalink
Remove tolerations if machine pool is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
psav committed Mar 31, 2022
1 parent b841d60 commit 880d531
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controllers/cloud.redhat.com/providers/cronjob/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ func buildPodTemplate(app *crd.ClowdApp, env *crd.ClowdEnvironment, pt *core.Pod
Operator: core.TolerationOpEqual,
Value: "true",
}}
} else {
pt.Spec.Tolerations = []core.Toleration{}
}

// set service account for pod
Expand Down
2 changes: 2 additions & 0 deletions controllers/cloud.redhat.com/providers/deployment/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ func initDeployment(app *crd.ClowdApp, env *crd.ClowdEnvironment, d *apps.Deploy
Operator: core.TolerationOpEqual,
Value: "true",
}}
} else {
d.Spec.Template.Spec.Tolerations = []core.Toleration{}
}

d.Spec.Template.Spec.InitContainers = ics
Expand Down
2 changes: 2 additions & 0 deletions controllers/cloud.redhat.com/providers/job/impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ func CreateJobResource(cji *crd.ClowdJobInvocation, env *crd.ClowdEnvironment, a
Operator: core.TolerationOpEqual,
Value: "true",
}}
} else {
j.Spec.Template.Spec.Tolerations = []core.Toleration{}
}

if !env.Spec.Providers.Deployment.OmitPullPolicy {
Expand Down

0 comments on commit 880d531

Please sign in to comment.