fix(core): Improve label generation and merging for applications and services
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Notifications\Application\DeploymentFailed;
|
||||
use App\Notifications\Application\DeploymentSuccess;
|
||||
use App\Traits\ExecuteRemoteCommand;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldBeEncrypted;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
@@ -604,6 +604,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
|
||||
is_stripprefix_enabled: $application->isStripprefixEnabled(),
|
||||
redirect_direction: $application->redirect
|
||||
);
|
||||
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
|
||||
$proxyLabels = fqdnLabelsForCaddy(
|
||||
network: $application->destination->network,
|
||||
uuid: $appUuid,
|
||||
@@ -659,6 +660,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
|
||||
is_gzip_enabled: $application->isGzipEnabled(),
|
||||
is_stripprefix_enabled: $application->isStripprefixEnabled()
|
||||
);
|
||||
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
|
||||
$proxyLabels = fqdnLabelsForCaddy(
|
||||
network: $application->destination->network,
|
||||
uuid: $appUuid,
|
||||
@@ -671,6 +673,9 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview
|
||||
$labels = $labels->merge(convertToKeyValueCollection($proxyLabels));
|
||||
}
|
||||
}
|
||||
$labels = $labels->map(function ($value, $key) {
|
||||
return "$key=$value";
|
||||
})->values();
|
||||
|
||||
return $labels->all();
|
||||
}
|
||||
|
@@ -2045,6 +2045,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
service_name: $serviceName,
|
||||
image: data_get($service, 'image')
|
||||
);
|
||||
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
|
||||
$proxyLabels = fqdnLabelsForCaddy(
|
||||
network: $resource->destination->network,
|
||||
uuid: $resource->uuid,
|
||||
@@ -2818,6 +2819,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
|
||||
is_gzip_enabled: $resource->isGzipEnabled(),
|
||||
is_stripprefix_enabled: $resource->isStripprefixEnabled(),
|
||||
);
|
||||
$serviceLabels = $serviceLabels->merge(convertToKeyValueCollection($proxyLabels));
|
||||
$proxyLabels =
|
||||
fqdnLabelsForCaddy(
|
||||
network: $resource->destination->network,
|
||||
|
Reference in New Issue
Block a user