1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 apiVersion: argoproj.io/v1alpha1
19 kind: WorkflowTemplate
21 name: full-purge-delete-cluster-wft
22 namespace: osm-workflows
30 - name: fleet_destination_folder
31 - name: git_fleet_cred_secret
34 - name: cluster_kustomization_name
37 - name: temp_kubeconfig_secret_name
38 - name: mgmt_cluster_name
50 # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
51 # secondsAfterSuccess: 50 # Time to live after workflow is successful
52 # secondsAfterFailure: 50 # Time to live after workflow fails
54 entrypoint: delete-cluster
59 - name: delete-cluster
64 - name: fleet_destination_folder
65 - name: git_fleet_cred_secret
68 - name: cluster_kustomization_name
70 - name: temp_kubeconfig_secret_name
71 - name: mgmt_cluster_name
79 # ------ Preparations for transaction
80 - - name: generate-fleet-volume-repo
82 name: k8s-resources-wft
83 template: generate-volume
97 value: "{{inputs.parameters.git_fleet_url}}"
98 - name: destination_folder
99 value: "{{inputs.parameters.fleet_destination_folder}}"
100 - name: git_cred_secret
101 value: "{{inputs.parameters.git_fleet_cred_secret}}"
102 - name: git_volume_name
103 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
104 # ------ end of preparations for transaction
106 # ------ Transformations
107 - - name: purge-delete-cluster
109 name: cluster-management-wft
110 template: purge-delete-cluster
113 # Volumes with cloned repos
114 - name: fleet_volume_name
115 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
116 - name: fleet_mount_path
118 # Specific parameters
119 - name: cluster_kustomization_name
120 value: "{{inputs.parameters.cluster_kustomization_name}}"
122 value: "{{inputs.parameters.project_name}}"
123 - name: mgmt_cluster_name
124 value: "{{inputs.parameters.mgmt_cluster_name}}"
126 value: "{{inputs.parameters.purge}}"
127 - name: temp_kubeconfig_secret_name
128 value: "{{inputs.parameters.temp_kubeconfig_secret_name}}"
129 # ------ end of transformations
131 # ------ Commit transaction
132 - - name: push-to-fleet
135 template: git-commit-merge-push
141 value: "{{inputs.parameters.fleet_destination_folder}}"
142 - name: git_cred_secret
143 value: "{{inputs.parameters.git_fleet_cred_secret}}"
144 - name: git_volume_name
145 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
146 - name: commit_message
147 value: "Delete cluster {{inputs.parameters.cluster_kustomization_name}}"
150 - name: contrib_branch
153 value: "{{inputs.parameters.dry_run}}"
154 # ------ end of commit transaction