Add a form to provision a new instance

This commit is contained in:
Tom Wiesing 2023-02-27 11:10:28 +01:00
parent 80906d3791
commit 53f63d4efd
No known key found for this signature in database
25 changed files with 367 additions and 236 deletions

View file

@ -47,7 +47,7 @@ func (r reserve) Run(context wisski_distillery.Context) error {
// check that it doesn't already exist
logging.LogMessage(context.Stderr, context.Context, "Reserving new WissKI instance %s", slug)
if exists, err := dis.Instances().Has(context.Context, slug); err != nil || exists {
return errProvisionAlreadyExists.WithMessageF(slug)
return errReserveAlreadyExists.WithMessageF(slug)
}
// make it in-memory
@ -59,7 +59,7 @@ func (r reserve) Run(context wisski_distillery.Context) error {
// check that the base directory does not exist
logging.LogMessage(context.Stderr, context.Context, "Checking that base directory %s does not exist", instance.FilesystemBase)
if fsx.IsDirectory(dis.Environment, instance.FilesystemBase) {
return errProvisionAlreadyExists.WithMessageF(slug)
return errReserveAlreadyExists.WithMessageF(slug)
}
// setup docker stack