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-delete-ksu-wtf
22 namespace: osm-workflows
28 - name: fleet_destination_folder
29 - name: git_fleet_cred_secret
31 - name: git_sw_catalogs_url
32 - name: sw_catalogs_destination_folder
33 - name: git_sw_catalogs_cred_secret
34 # Specific parameters - KSU id
47 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
48 secondsAfterSuccess: 6000 # Time to live after workflow is successful
49 secondsAfterFailure: 9000 # Time to live after workflow fails
51 entrypoint: delete-ksu
60 - name: fleet_destination_folder
61 - name: git_fleet_cred_secret
63 - name: git_sw_catalogs_url
64 - name: sw_catalogs_destination_folder
65 - name: git_sw_catalogs_cred_secret
66 # Specific parameters - KSU id
76 # ------ Preparations for transaction
77 - - name: generate-fleet-volume-repo
79 name: k8s-resources-wft
80 template: generate-volume
85 - name: generate-sw-catalogs-volume-repo
87 name: k8s-resources-wft
88 template: generate-volume
102 value: "{{inputs.parameters.git_fleet_url}}"
103 - name: destination_folder
104 value: "{{inputs.parameters.fleet_destination_folder}}"
105 - name: git_cred_secret
106 value: "{{inputs.parameters.git_fleet_cred_secret}}"
107 - name: git_volume_name
108 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
109 - name: clone-sw-catalogs
116 value: "/sw-catalogs"
118 value: "{{inputs.parameters.git_sw_catalogs_url}}"
119 - name: destination_folder
120 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
121 - name: git_cred_secret
122 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
123 - name: git_volume_name
124 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
125 # ------ end of preparations for transaction
127 # ------ Transformations
130 name: ksu-management-wft
134 # References to required external resources
135 - name: fleet_volume_name
136 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
137 - name: sw_catalogs_volume_name
138 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
139 # Specific parameters - KSU id
141 value: "{{inputs.parameters.ksu_name}}"
143 value: "{{inputs.parameters.profile_name}}"
145 value: "{{inputs.parameters.profile_type}}"
147 value: "{{inputs.parameters.project_name}}"
150 value: "{{inputs.parameters.debug}}"
151 # ------ end of transformations
153 # ------ Commit transaction
154 - - name: push-to-fleet
157 template: git-commit-merge-push
163 value: "{{inputs.parameters.fleet_destination_folder}}"
164 - name: git_cred_secret
165 value: "{{inputs.parameters.git_fleet_cred_secret}}"
166 - name: git_volume_name
167 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
168 - name: commit_message
169 value: "Delete KSU {{inputs.parameters.ksu_name}} from {{inputs.parameters.profile_name}} profile of {{inputs.parameters.profile_type}} type @ {{inputs.parameters.project_name}} project"
172 - name: contrib_branch
175 value: "{{inputs.parameters.dry_run}}"
176 # ------ end of commit transaction