Place the bus's users before the enrolment's wait begins

The installer placed them between making the enrolment's deadline and
using it, so a failure returned without cancelling it, and go vet refused
the package.
This commit is contained in:
jochen
2026-10-08 01:40:47 +02:00
parent e30d838395
commit 0e57186bf1
+5 -5
View File
@@ -111,6 +111,11 @@ func Enrol(ctx context.Context, o Options, sys system.System, control controlPla
if err != nil {
return out, err
}
// The enrolment account the token's secret is the password of exists in the mesh's records
// and nowhere on the bus yet (novox/hq 04-ISSUES/146): placed before the machine presents it.
if err := placeTheBusUsers(ctx, control, say); err != nil {
return out, err
}
joining, cancel := context.WithTimeout(ctx, o.Wait)
args := []string{"enrol", "--token", token, "--state", o.State}
if o.Tunnel != "" {
@@ -119,11 +124,6 @@ func Enrol(ctx context.Context, o Options, sys system.System, control controlPla
// its ports and range on and not another that came up since.
args = append(args, "--tunnel", o.Tunnel)
}
// The enrolment account the token's secret is the password of exists in the mesh's records
// and nowhere on the bus yet (novox/hq 04-ISSUES/146): placed before the machine presents it.
if err := placeTheBusUsers(ctx, control, say); err != nil {
return out, err
}
joined, err := control.run(joining, o.Host, args...)
cancel()
if err != nil {