wip: fix for comma in labels

This commit is contained in:
Andras Bacsai
2023-12-11 23:34:18 +01:00
parent 20dc2b47fe
commit d8b97e06cf
5 changed files with 20 additions and 13 deletions

View File

@@ -874,11 +874,12 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$environment_variables = $this->generate_environment_variables($ports);
if (data_get($this->application, 'custom_labels')) {
$labels = collect(str($this->application->custom_labels)->explode(','));
ray(base64_decode($this->application->custom_labels));
$labels = collect(preg_split("/\r\n|\n|\r/", base64_decode($this->application->custom_labels)));
$labels = $labels->filter(function ($value, $key) {
return !Str::startsWith($value, 'coolify.');
});
$this->application->custom_labels = $labels->implode(',');
$this->application->custom_labels = base64_encode($labels);
$this->application->save();
} else {
$labels = collect(generateLabelsApplication($this->application, $this->preview));