Move instances into a separate component

This commit is contained in:
Tom Wiesing 2022-09-14 18:07:12 +02:00
parent 233a51d4cd
commit a8da3f70eb
No known key found for this signature in database
46 changed files with 553 additions and 551 deletions

View file

@ -46,12 +46,12 @@ func (r reserve) Run(context wisski_distillery.Context) error {
// check that it doesn't already exist
logging.LogMessage(context.IOStream, "Reserving new WissKI instance %s", slug)
if exists, err := dis.HasInstance(slug); err != nil || exists {
if exists, err := dis.Instances().Has(slug); err != nil || exists {
return errProvisionAlreadyExists.WithMessageF(slug)
}
// make it in-memory
instance, err := dis.NewInstance(slug)
instance, err := dis.Instances().Create(slug)
if err != nil {
return errProvisionGeneric.WithMessageF(slug, err)
}