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-update-crossplane-providerconfig
22 namespace: osm-workflows
29 - name: fleet_destination_folder
30 - name: git_fleet_cred_secret
32 - name: git_sw_catalogs_url
33 - name: sw_catalogs_destination_folder
34 - name: git_sw_catalogs_cred_secret
37 - name: providerconfig_name
38 ## As of today, one among `azure`, `aws` or `gcp`
40 ## Final secret to reference from the `ProviderConfig`
41 - name: cred_secret_name
42 ## Temporary secret with secret contents for the workflow
43 ## - If `temp_cred_secret_name` is empty, assumes that the final secret already exists
44 - name: temp_cred_secret_name
46 - name: temp_cred_secret_key
48 - name: age_public_key_mgmt
49 - name: osm_project_name
51 ## Specific parameters - GCP only
52 - name: target_gcp_project
62 secondsAfterCompletion: 6000 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
63 secondsAfterSuccess: 6000 # Time to live after workflow is successful
64 secondsAfterFailure: 9000 # Time to live after workflow fails
66 entrypoint: update-crossplane-providerconfig
71 - name: update-crossplane-providerconfig
76 - name: fleet_destination_folder
77 - name: git_fleet_cred_secret
79 - name: git_sw_catalogs_url
80 - name: sw_catalogs_destination_folder
81 - name: git_sw_catalogs_cred_secret
83 - name: providerconfig_name
85 - name: cred_secret_name
86 - name: temp_cred_secret_name
87 - name: temp_cred_secret_key
88 - name: age_public_key_mgmt
89 - name: osm_project_name
90 - name: target_gcp_project
99 # ------ Preparations for transaction
100 - - name: generate-fleet-volume-repo
102 name: k8s-resources-wft
103 template: generate-volume
108 - name: generate-sw-catalogs-volume-repo
110 name: k8s-resources-wft
111 template: generate-volume
116 - - name: clone-fleet
125 value: "{{inputs.parameters.git_fleet_url}}"
126 - name: destination_folder
127 value: "{{inputs.parameters.fleet_destination_folder}}"
128 - name: git_cred_secret
129 value: "{{inputs.parameters.git_fleet_cred_secret}}"
130 - name: git_volume_name
131 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
132 - name: clone-sw-catalogs
139 value: "/sw-catalogs"
141 value: "{{inputs.parameters.git_sw_catalogs_url}}"
142 - name: destination_folder
143 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
144 - name: git_cred_secret
145 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
146 - name: git_volume_name
147 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
148 # ------ end of preparations for transaction
150 # ------ Transformations
151 - - name: update-crossplane-providerconfig
153 name: cloud-accounts-wft
154 template: update-crossplane-providerconfig
157 # References to required external resources
158 - name: fleet_volume_name
159 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
160 - name: sw_catalogs_volume_name
161 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
162 # Specific parameters
163 - name: providerconfig_name
164 value: "{{inputs.parameters.providerconfig_name}}"
165 - name: provider_type
166 value: "{{inputs.parameters.provider_type}}"
167 - name: cred_secret_name
168 value: "{{inputs.parameters.cred_secret_name}}"
169 - name: temp_cred_secret_name
170 value: "{{inputs.parameters.temp_cred_secret_name}}"
171 - name: temp_cred_secret_key
172 value: "{{inputs.parameters.temp_cred_secret_key}}"
173 - name: age_public_key_mgmt
174 value: "{{inputs.parameters.age_public_key_mgmt}}"
175 - name: osm_project_name
176 value: "{{inputs.parameters.osm_project_name}}"
177 - name: target_gcp_project
178 value: "{{inputs.parameters.target_gcp_project}}"
181 value: "{{inputs.parameters.debug}}"
182 # ------ end of transformations
184 # ------ Commit transaction
185 - - name: push-to-fleet
188 template: git-commit-merge-push
194 value: "{{inputs.parameters.fleet_destination_folder}}"
195 - name: git_cred_secret
196 value: "{{inputs.parameters.git_fleet_cred_secret}}"
197 - name: git_volume_name
198 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
199 - name: commit_message
200 value: "Update ProviderConfig {{inputs.parameters.providerconfig_name}} for {{inputs.parameters.provider_type}}"
203 - name: contrib_branch
206 value: "{{inputs.parameters.dry_run}}"
207 # ------ end of commit transaction