Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #21 from deliveroo/PRIC-444/force-kill-pod
Browse files Browse the repository at this point in the history
Try killing the pod before creating a new one
  • Loading branch information
alexstoick authored Nov 7, 2018
2 parents 2f8200a + d4b8e07 commit a46a400
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/pipeline/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,11 @@ func runPipelineStep(pipeline *PipelineDefinition, step *PipelineDefinitionStep,
func deleteAndWait(c kubernetes.Interface, podDefinition *PodDefinition, flags *runCmdFlagsStruct) error {
pods := clientset.CoreV1().Pods(podDefinition.Namespace)
deleting := false
var gracePeriod int64
opts := metav1.DeleteOptions{GracePeriodSeconds: &gracePeriod}
err := wait.PollImmediate(flags.DeletePollInterval, deleteTimeout, func() (bool, error) {
var err error
err = pods.Delete(podDefinition.PodName, &metav1.DeleteOptions{})
err = pods.Delete(podDefinition.PodName, &opts)
if err != nil {
if k8errors.IsNotFound(err) {
if deleting {
Expand Down

0 comments on commit a46a400

Please sign in to comment.