Skip to content

Commit c8c4c5a

Browse files
committed
incus: ensure user is added to incus-admin
Signed-off-by: Abiola Ibrahim <[email protected]>
1 parent 5454782 commit c8c4c5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: environment/container/incus/incus.go

+12
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ func (c *incusRuntime) Start(ctx context.Context) error {
9494
})
9595

9696
a.Add(func() error {
97+
// attempt to set remote
98+
if err := c.setRemote(conf.AutoActivate()); err == nil {
99+
return nil
100+
}
101+
102+
// workaround missing user in incus-admin by restarting
103+
ctx := context.WithValue(ctx, cli.CtxKeyQuiet, true)
104+
if err := c.guest.Restart(ctx); err != nil {
105+
return err
106+
}
107+
108+
// attempt once again to set remote
97109
return c.setRemote(conf.AutoActivate())
98110
})
99111

0 commit comments

Comments
 (0)