fix: random generated uuid will be full length (not 7 characters)

This commit is contained in:
Andras Bacsai
2024-07-25 13:31:01 +02:00
parent debd2a3433
commit 6a4aa492c0
31 changed files with 54 additions and 54 deletions

View File

@@ -200,7 +200,7 @@ function generate_random_name(?string $cuid = null): string
]
);
if (is_null($cuid)) {
$cuid = new Cuid2(7);
$cuid = new Cuid2();
}
return Str::kebab("{$generator->getName()}-$cuid");
@@ -236,7 +236,7 @@ function formatPrivateKey(string $privateKey)
function generate_application_name(string $git_repository, string $git_branch, ?string $cuid = null): string
{
if (is_null($cuid)) {
$cuid = new Cuid2(7);
$cuid = new Cuid2();
}
return Str::kebab("$git_repository:$git_branch-$cuid");
@@ -2015,7 +2015,7 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
$template = $resource->preview_url_template;
$host = $url->getHost();
$schema = $url->getScheme();
$random = new Cuid2(7);
$random = new Cuid2();
$preview_fqdn = str_replace('{{random}}', $random, $template);
$preview_fqdn = str_replace('{{domain}}', $host, $preview_fqdn);
$preview_fqdn = str_replace('{{pr_id}}', $pull_request_id, $preview_fqdn);