Add managed registry provisioning, pruning, and readiness tracking
This commit is contained in:
@@ -30,7 +30,7 @@ class RegistryController extends Controller
|
||||
Organisation::findOrFail($request->route('organisation'));
|
||||
|
||||
return inertia('registries/Create', [
|
||||
'registryTypes' => array_values(RegistryType::toArray()),
|
||||
'registryTypes' => $this->userConfigurableRegistryTypes(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class RegistryController extends Controller
|
||||
|
||||
return inertia('registries/Edit', [
|
||||
'registry' => $registry,
|
||||
'registryTypes' => array_values(RegistryType::toArray()),
|
||||
'registryTypes' => $this->userConfigurableRegistryTypes(),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ class RegistryController extends Controller
|
||||
/** @var Registry $registry */
|
||||
$registry = $organisation->registries()->findOrFail($request->route('registry'));
|
||||
|
||||
abort_if($registry->type === RegistryType::MANAGED, 403);
|
||||
|
||||
$credentials = $registry->credentials ?? [];
|
||||
$username = $request->string('username')->toString();
|
||||
|
||||
@@ -117,10 +119,23 @@ class RegistryController extends Controller
|
||||
$organisation = Organisation::findOrFail($request->route('organisation'));
|
||||
$registry = $organisation->registries()->findOrFail($request->route('registry'));
|
||||
|
||||
abort_if($registry->type === RegistryType::MANAGED, 403);
|
||||
|
||||
$registry->delete();
|
||||
|
||||
return redirect()
|
||||
->route('organisations.show', ['organisation' => $organisation->id])
|
||||
->with('success', 'Registry deleted.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<int, string>
|
||||
*/
|
||||
private function userConfigurableRegistryTypes(): array
|
||||
{
|
||||
return collect(RegistryType::toArray())
|
||||
->reject(fn (string $type) => $type === RegistryType::MANAGED->value)
|
||||
->values()
|
||||
->all();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user