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

Commit

Permalink
Extract default bucket in Ansible format
Browse files Browse the repository at this point in the history
  • Loading branch information
me committed Jan 1, 2018
1 parent 55dc093 commit c7b5920
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cli/pipeline/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/kubernetes"
"log"
"regexp"
"time"
)

Expand Down Expand Up @@ -79,6 +80,12 @@ func runPipeline(path string, flags *runCmdFlagsStruct) {
if flags.BucketName != "" {
pipeline.Bucket = flags.BucketName
}
// For compatibility with Ansible executor
r, _ := regexp.Compile("default\\('(.+)'\\)")
matches := r.FindStringSubmatch(pipeline.Bucket)
if matches != nil && matches[1] != "" {
pipeline.Bucket = matches[1]
}

for _, step := range pipeline.Steps {
if flags.StepName != "" && step.Step != flags.StepName {
Expand Down Expand Up @@ -165,6 +172,9 @@ func deleteAndWait(c *kubernetes.Clientset, podDefinition *PodDefinition) error
err = pods.Delete(podDefinition.PodName, &metav1.DeleteOptions{})
if err != nil {
if k8errors.IsNotFound(err) {
if deleting {
log.Printf("[paddle] deleted pod %s", podDefinition.PodName)
}
return true, nil
} else {
return true, err
Expand Down

0 comments on commit c7b5920

Please sign in to comment.