@@ -497,6 +497,7 @@ private function upload_to_s3(): void
497
497
498
498
$ this ->ensureHelperImageAvailable ();
499
499
500
+ $ fullImageName = $ this ->getFullImageName ();
500
501
$ commands [] = "docker run -d --network {$ network } --name backup-of- {$ this ->backup ->uuid } --rm -v $ this ->backup_location : $ this ->backup_location :ro {$ fullImageName }" ;
501
502
$ commands [] = "docker exec backup-of- {$ this ->backup ->uuid } mc config host add temporary {$ endpoint } $ key $ secret " ;
502
503
$ commands [] = "docker exec backup-of- {$ this ->backup ->uuid } mc cp $ this ->backup_location temporary/ $ bucket {$ this ->backup_dir }/ " ;
@@ -513,17 +514,12 @@ private function upload_to_s3(): void
513
514
514
515
private function ensureHelperImageAvailable (): void
515
516
{
516
- $ settings = InstanceSettings::get ();
517
- $ helperImage = config ('coolify.helper_image ' );
518
- $ latestVersion = $ settings ->helper_version ;
519
- $ fullImageName = "{$ helperImage }: {$ latestVersion }" ;
517
+ $ fullImageName = $ this ->getFullImageName ();
520
518
521
519
$ imageExists = $ this ->checkImageExists ($ fullImageName );
522
520
523
521
if (!$ imageExists ) {
524
522
$ this ->pullHelperImage ($ fullImageName );
525
- } else {
526
- return ;
527
523
}
528
524
}
529
525
@@ -543,4 +539,12 @@ private function pullHelperImage(string $fullImageName): void
543
539
throw new \RuntimeException ($ errorMessage );
544
540
}
545
541
}
542
+
543
+ private function getFullImageName (): string
544
+ {
545
+ $ settings = InstanceSettings::get ();
546
+ $ helperImage = config ('coolify.helper_image ' );
547
+ $ latestVersion = $ settings ->helper_version ;
548
+ return "{$ helperImage }: {$ latestVersion }" ;
549
+ }
546
550
}
0 commit comments