registryType($registry) === RegistryType::MANAGED) { $namespace = trim((string) config('keystone.managed_registry.namespace', 'keystone'), '/'); $applicationId = $environment->application->uuid ?: 'app-'.$environment->application_id; $environmentId = $environment->uuid ?: 'env-'.$environment->id; $path = $namespace.'/'.$applicationId.'/'.$environmentId; return $path.':'.$tag; } return str($environment->application->name) ->slug() ->append(':'.$tag) ->value(); } public function registryReference(Registry $registry, string $imageTag): string { return rtrim($this->registryHost((string) $registry->url), '/').'/'.ltrim($imageTag, '/'); } private function registryHost(string $url): string { $host = preg_replace('#^https?://#', '', trim($url)); return $host === null ? trim($url) : $host; } private function registryType(?Registry $registry): ?RegistryType { if (! $registry instanceof Registry) { return null; } if ($registry->type instanceof RegistryType) { return $registry->type; } return RegistryType::tryFrom((string) $registry->type); } }