Skip to content

Commit d5fee55

Browse files
authored
Merge pull request #1406 from mrrobot47/fix/migration-of-proxy-container
Fix migration of nginx-proxy container
2 parents 93c4763 + e8655a2 commit d5fee55

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

img-versions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"easyengine/cron": "v4.0.0",
33
"easyengine/mailhog": "v4.0.0",
44
"easyengine/mariadb": "v4.0.0",
5-
"easyengine/nginx-proxy": "v4.0.1",
5+
"easyengine/nginx-proxy": "v4.0.2",
66
"easyengine/nginx": "v4.0.0",
77
"easyengine/php": "v4.0.2",
88
"easyengine/php5.6": "v4.0.0",

php/EE/Migration/GlobalContainers.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public static function down_global_containers( $updated_images ) {
7676
foreach ( $updated_images as $image_name ) {
7777
$global_container_name = $all_global_images[ $image_name ];
7878
$global_service_name = ltrim( $global_container_name, 'services_' );
79-
$global_service_name = rtrim( $global_service_name, '_1' );
80-
EE::debug( "Removing $global_container_name" );
79+
$remove_suffix = explode( '_1', $global_service_name );
80+
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
81+
EE::debug( "Removing $global_container_name" );
8182

8283
if ( false !== \EE_DOCKER::container_status( $global_container_name ) ) {
8384
if ( ! EE::exec( "docker-compose stop $global_service_name && docker-compose rm -f $global_service_name" ) ) {
@@ -94,8 +95,11 @@ public static function down_global_containers( $updated_images ) {
9495
* @throws \Exception
9596
*/
9697
public static function global_service_up( $service_name ) {
98+
$global_service_name = ltrim( $service_name, 'services_' );
99+
$remove_suffix = explode( '_1', $global_service_name );
100+
$global_service_name = empty( $remove_suffix[0] ) ? $global_service_name : $remove_suffix[0];
97101
EE::debug( 'Start ' . $service_name . ' container up' );
98-
if ( 'global-nginx-proxy' === $service_name ) {
102+
if ( 'global-nginx-proxy' === $global_service_name ) {
99103
\EE\Service\Utils\nginx_proxy_check();
100104
} else {
101105
\EE\Service\Utils\init_global_container( $service_name );

0 commit comments

Comments
 (0)