Skip to content

Commit 025980c

Browse files
[patch] add launchRollbackPipeline function
1 parent dd23cca commit 025980c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/mas/devops/tekton.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def installOpenShiftPipelines(dynClient: DynamicClient, customStorageClassName:
109109

110110
def updateTektonDefinitions(namespace: str, yamlFile: str) -> None:
111111
"""
112-
Install/update the MAS tekton pipeline and task definitions
112+
Install/update/ rollback the MAS tekton pipeline and task definitions
113113
114114
Unfortunately there's no API equivalent of what the kubectl CLI gives
115115
us with the ability to just apply a file containing a mix of resource types
@@ -411,3 +411,14 @@ def launchUpdatePipeline(dynClient: DynamicClient, params: dict) -> str:
411411

412412
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-pipelines/tekton.dev~v1beta1~PipelineRun/mas-update-{timestamp}"
413413
return pipelineURL
414+
415+
def launchRollbackPipeline(dynClient: DynamicClient, params: dict) -> str:
416+
"""
417+
Create a PipelineRun to update the Maximo Operator Catalog
418+
"""
419+
instanceId = params["mas_instance_id"]
420+
namespace = f"mas-{instanceId}-pipelines"
421+
timestamp = launchPipelineRun(dynClient, namespace, "pipelinerun-rollback", params)
422+
423+
pipelineURL = f"{getConsoleURL(dynClient)}/k8s/ns/mas-pipelines/tekton.dev~v1beta1~PipelineRun/mas-rollback-{timestamp}"
424+
return pipelineURL

0 commit comments

Comments
 (0)