@@ -208,16 +208,17 @@ function backup_component() {
208208 local component=$2
209209 local requested_component=$3
210210 local migration_id=$4
211+ local internal=$5
211212
212213 local stack
213- stack=$( get_stack_for_namespace_component " $namespace " " $component " )
214+ stack=$( get_stack_for_namespace_component " $namespace " " $component " " $internal " )
214215
215216 if [ " $component " == " $requested_component " ] || [ -z " $requested_component " ]; then
216217 if [ " $component " == " cometbft-$migration_id " ]; then
217218 backup_pvc " cometBFT" " $namespace " " global-domain-$migration_id -cometbft-cometbft-data" " $migration_id "
218219 else
219220 local db_name
220- db_name=$( create_component_instance " $component " " $migration_id " " $namespace " )
221+ db_name=$( create_component_instance " $component " " $migration_id " " $namespace " " $internal " )
221222 SPLICE_SV=$namespace SPLICE_MIGRATION_ID=$migration_id backup_postgres " $component " " $namespace " " $db_name -pg" " $migration_id " " $stack "
222223 fi
223224 else
@@ -230,15 +231,16 @@ function wait_for_backup() {
230231 local component=$2
231232 local requested_component=$3
232233 local migration_id=$4
234+ local internal=$5
233235
234236 local stack
235- stack=$( get_stack_for_namespace_component " $namespace " " $component " )
237+ stack=$( get_stack_for_namespace_component " $namespace " " $component " " $internal " )
236238
237239 if [ " $component " == " $requested_component " ] || [ -z " $requested_component " ]; then
238240 if [ " $component " == " cometbft-$migration_id " ]; then
239241 wait_for_pvc_backup " cometBFT" " $namespace " " global-domain-$migration_id -cometbft-cometbft-data"
240242 else
241- instance=$( create_component_instance " $component " " $migration_id " " $namespace " )
243+ instance=$( create_component_instance " $component " " $migration_id " " $namespace " " $internal " )
242244 wait_for_postgres_backup " $component " " $namespace " " $instance -pg" " $migration_id " " $stack "
243245 fi
244246 else
@@ -247,44 +249,45 @@ function wait_for_backup() {
247249}
248250
249251function usage() {
250- echo " Usage: $0 <sv|validator> <namespace> <migration id> [<component_name>]"
252+ echo " Usage: $0 <sv|validator> <namespace> <migration id> <internal (true|false)> [<component_name>]"
251253}
252254
253255function main() {
254- if [ " $# " -lt 3 ]; then
256+ if [ " $# " -lt 4 ]; then
255257 usage
256258 exit 1
257259 fi
258260
259261 local namespace=$2
260262 local migration_id=$3
261- local requested_component=" ${4:- } "
263+ local internal=$4 # "true" for internal stack, "false" for external stack
264+ local requested_component=" ${5:- } "
262265
263266 # TODO(#9361): support multiple domains / non-default-ID'd ones
264267 if [ " $1 " == " validator" ]; then
265268 _info " Backing up validator $namespace "
266- backup_component " $namespace " " validator" " $requested_component " " $migration_id "
267- wait_for_backup " $namespace " " validator" " $requested_component " " $migration_id "
269+ backup_component " $namespace " " validator" " $requested_component " " $migration_id " " $internal "
270+ wait_for_backup " $namespace " " validator" " $requested_component " " $migration_id " " $internal "
268271 # CN apps must be strictly before participant, so we sync on apps before starting the participant backup
269- backup_component " $namespace " " participant" " $requested_component " " $migration_id "
270- wait_for_backup " $namespace " " participant" " $requested_component " " $migration_id "
272+ backup_component " $namespace " " participant" " $requested_component " " $migration_id " " $internal "
273+ wait_for_backup " $namespace " " participant" " $requested_component " " $migration_id " " $internal "
271274 elif [ " $1 " == " sv" ]; then
272275 _info " Backing up SV node $namespace "
273276
274- backup_component " $namespace " " cn-apps" " $requested_component " " $migration_id "
275- backup_component " $namespace " " mediator" " $requested_component " " $migration_id "
276- backup_component " $namespace " " sequencer" " $requested_component " " $migration_id "
277- backup_component " $namespace " " cometbft-$migration_id " " $requested_component " " $migration_id "
277+ backup_component " $namespace " " cn-apps" " $requested_component " " $migration_id " " $internal "
278+ backup_component " $namespace " " mediator" " $requested_component " " $migration_id " " $internal "
279+ backup_component " $namespace " " sequencer" " $requested_component " " $migration_id " " $internal "
280+ backup_component " $namespace " " cometbft-$migration_id " " $requested_component " " $migration_id " " $internal "
278281
279- wait_for_backup " $namespace " " cn-apps" " $requested_component " " $migration_id "
282+ wait_for_backup " $namespace " " cn-apps" " $requested_component " " $migration_id " " $internal "
280283
281284 # CN apps must be strictly before participant, so we sync on apps before starting the participant backup
282- backup_component " $namespace " " participant" " $requested_component " " $migration_id "
285+ backup_component " $namespace " " participant" " $requested_component " " $migration_id " " $internal "
283286
284- wait_for_backup " $namespace " " participant" " $requested_component " " $migration_id "
285- wait_for_backup " $namespace " " mediator" " $requested_component " " $migration_id "
286- wait_for_backup " $namespace " " sequencer" " $requested_component " " $migration_id "
287- wait_for_backup " $namespace " " cometbft-$migration_id " " $requested_component " " $migration_id "
287+ wait_for_backup " $namespace " " participant" " $requested_component " " $migration_id " " $internal "
288+ wait_for_backup " $namespace " " mediator" " $requested_component " " $migration_id " " $internal "
289+ wait_for_backup " $namespace " " sequencer" " $requested_component " " $migration_id " " $internal "
290+ wait_for_backup " $namespace " " cometbft-$migration_id " " $requested_component " " $migration_id " " $internal "
288291 else
289292 usage
290293 exit 1
0 commit comments