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 #48 from deliveroo/CPR-788/modify-pod-cleaner
Browse files Browse the repository at this point in the history
CPR-788: Modifying pod cleaner and pod template
  • Loading branch information
Barabasi Csongor authored Jul 1, 2020
2 parents 48cc28b + 406a597 commit f669d0a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.0
0.23.0
2 changes: 1 addition & 1 deletion cli/cleanup/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func runPodsCleanup() {
deletePod(pods, pod)
case "Failed":
diff := time.Now().UTC().Sub(pod.CreationTimestamp.UTC())
if (diff.Hours() / 24) >= 1 {
if diff.Hours() >= 4 {
deletePod(pods, pod)
}
default:
Expand Down
5 changes: 1 addition & 4 deletions cli/pipeline/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ package pipeline
import (
"bytes"
"fmt"
"strconv"
"strings"
"text/template"
"time"
)

type PodSecret struct {
Expand Down Expand Up @@ -193,8 +191,7 @@ func NewPodDefinition(pipelineDefinition *PipelineDefinition, pipelineDefinition
stepName := sanitizeName(pipelineDefinitionStep.Step)
branchName := sanitizeName(pipelineDefinitionStep.Branch)
stepVersion := sanitizeName(pipelineDefinitionStep.Version)
timestamp := strconv.Itoa(int(time.Now().UTC().Unix()))
podName := fmt.Sprintf("%s-%s-%s-%s-%s", sanitizeName(pipelineDefinition.Pipeline), sanitizeName(pipelineDefinitionStep.Version), stepName, branchName, timestamp[len(timestamp)-4:])
podName := fmt.Sprintf("%s-%s-%s-%s", sanitizeName(pipelineDefinition.Pipeline), sanitizeName(pipelineDefinitionStep.Version), stepName, branchName)

return &PodDefinition{
PodName: podName,
Expand Down

0 comments on commit f669d0a

Please sign in to comment.