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

CPR-788: Modifying pod cleaner and pod template #48

Merged
merged 1 commit into from
Jul 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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