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

Commit

Permalink
Try killing the pod before creating a new one
Browse files Browse the repository at this point in the history
This avoids the situation where we have a pod that is stuck
  • Loading branch information
alexstoick committed Nov 5, 2018
1 parent 2f8200a commit d4b8e07
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 d4b8e07

Please sign in to comment.