Skip to content

Commit 0be6bf5

Browse files
author
Sanjay Prabhakar
committed
added timestamp to backup & restore pipelinerun name
1 parent c729f65 commit 0be6bf5

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/mas/devops/tekton.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,9 @@ def launchBackupPipeline(dynClient: DynamicClient, params: dict) -> str:
862862
instanceId = params["mas_instance_id"]
863863
backupVersion = params["backup_version"]
864864
namespace = f"mas-{instanceId}-pipelines"
865-
launchPipelineRun(dynClient, namespace, "pipelinerun-backup", params)
865+
timestamp = launchPipelineRun(dynClient, namespace, "pipelinerun-backup", params)
866866

867-
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-{instanceId}-pipelines/tekton.dev~v1beta1~PipelineRun/{instanceId}-backup-{backupVersion}"
867+
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-{instanceId}-pipelines/tekton.dev~v1beta1~PipelineRun/{instanceId}-backup-{backupVersion}-{timestamp}"
868868
return pipelineURL
869869

870870

@@ -885,9 +885,9 @@ def launchRestorePipeline(dynClient: DynamicClient, params: dict) -> str:
885885
instanceId = params["mas_instance_id"]
886886
restoreVersion = params["restore_version"]
887887
namespace = f"mas-{instanceId}-pipelines"
888-
launchPipelineRun(dynClient, namespace, "pipelinerun-restore", params)
888+
timestamp = launchPipelineRun(dynClient, namespace, "pipelinerun-restore", params)
889889

890-
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-{instanceId}-pipelines/tekton.dev~v1beta1~PipelineRun/{instanceId}-restore-{restoreVersion}"
890+
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-{instanceId}-pipelines/tekton.dev~v1beta1~PipelineRun/{instanceId}-restore-{restoreVersion}-{timestamp}"
891891
return pipelineURL
892892

893893

src/mas/devops/templates/pipelinerun-backup.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: tekton.dev/v1beta1
33
kind: PipelineRun
44
metadata:
5-
name: "{{ mas_instance_id }}-backup-{{ backup_version }}"
5+
name: "{{ mas_instance_id }}-backup-{{ backup_version }}-{{ timestamp }}"
66
labels:
77
tekton.dev/pipeline: mas-backup
88
spec:

src/mas/devops/templates/pipelinerun-restore.yml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: tekton.dev/v1beta1
33
kind: PipelineRun
44
metadata:
5-
name: "{{ mas_instance_id }}-restore-{{ restore_version }}"
5+
name: "{{ mas_instance_id }}-restore-{{ restore_version }}-{{ timestamp }}"
66
labels:
77
tekton.dev/pipeline: mas-restore
88
spec:

0 commit comments

Comments
 (0)