Skip to content

Commit

Permalink
incus: ensure user is added to incus-admin
Browse files Browse the repository at this point in the history
Signed-off-by: Abiola Ibrahim <git@abiosoft.com>
  • Loading branch information
abiosoft committed Jul 23, 2024
1 parent 5454782 commit c8c4c5a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions environment/container/incus/incus.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,18 @@ func (c *incusRuntime) Start(ctx context.Context) error {
})

a.Add(func() error {
// attempt to set remote
if err := c.setRemote(conf.AutoActivate()); err == nil {
return nil
}

// workaround missing user in incus-admin by restarting
ctx := context.WithValue(ctx, cli.CtxKeyQuiet, true)
if err := c.guest.Restart(ctx); err != nil {
return err
}

// attempt once again to set remote
return c.setRemote(conf.AutoActivate())
})

Expand Down

0 comments on commit c8c4c5a

Please sign in to comment.