fix: labels

This commit is contained in:
Andras Bacsai
2023-12-12 16:45:46 +01:00
parent f68aace445
commit d3c9894479
2 changed files with 7 additions and 2 deletions

View File

@@ -883,6 +883,11 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted
$this->application->save();
}
if (mb_detect_encoding(base64_decode($this->application->custom_labels), 'ASCII', true) === false) {
ray('custom_labels contains non-ascii characters');
$this->application->custom_labels = base64_encode(str(implode(",", generateLabelsApplication($this->application, $this->preview)))->replace(',', "\n"));
$this->application->save();
}
$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.');