diff --git a/cmd/mesh-controller/modules.go b/cmd/mesh-controller/modules.go index 95d6c04..ffb6770 100644 --- a/cmd/mesh-controller/modules.go +++ b/cmd/mesh-controller/modules.go @@ -253,6 +253,13 @@ func moduleCommand(ctx context.Context, args []string) error { if !ok { return fmt.Errorf("this mesh knows no module %q; `module add` it first", module) } + // The account is delivered as the module's own secret named broker; a module that declares + // none has nothing to read it with, and an account nothing reads is an orphan on the bus + // (novox/hq 04-ISSUES/078). Said before the account is made, not after. + if _, reads := m.OwnSecrets["broker"]; !reads { + return fmt.Errorf("%s declares no own secret named broker, so there is nowhere to deliver "+ + "an account; a module that speaks on the bus declares \"own-secrets\": {\"broker\": }", module) + } management, err := broker.ManagementFromEnvironment() if err != nil {