Repository navigation
Conversation
|
| // duplicate registration raises into an error - here it is the operator's binary, not init, that | ||
| // would be crashing. | ||
| func registerAll[T any](name string, config ConfigProvider[T]) (err error) { | ||
| defer func() { |
There was a problem hiding this comment.
Why do we have a recover here?
| // TODO: pass in constructors here for our runnable/embeddable dependencies? | ||
| // Something else here | ||
| return run(cmd.Context(), lggr, cmd.Root().Name(), cfg, c) | ||
| cfg := embedRegistrations.configs[""].value.(*embedConfig) |
There was a problem hiding this comment.
Not sure what this is
| mux := http.NewServeMux() | ||
|
|
||
| httpCfg := cfg.http | ||
| httpCfg.Port += uint16(instance.ID) |
There was a problem hiding this comment.
This should default to 0 and we'll just grab an open port
|
|
||
| func (f *fakeBroadcaster) Subscribe(context.Context) (<-chan core.SettingsUpdate, error) { | ||
| // Subscribe hands out a stream that, like a real one, ends when the subscription's ctx does. | ||
| func (f *fakeBroadcaster) Subscribe(ctx context.Context) (<-chan core.SettingsUpdate, error) { |
There was a problem hiding this comment.
There's a lot of extra complexity here -- why?
| @@ -0,0 +1,19 @@ | |||
| // Command docgen is a capability binary run only for its docs command: it generates the | |||
There was a problem hiding this comment.
Not needed? Generating doc comments for struct provides nothing.
| // registerSettings registers the run's own settings, as any dependency registers its config, for | ||
| // RunErr to bind and start to resolve. capabilities differs between the commands: embed's has no | ||
| // proxy to dial and defaults the DON, and capabilityConfig is built from it. | ||
| func registerSettings() { |
There was a problem hiding this comment.
rename settings -> config -- settings refers to cre settings specifically
| // embeddedCapabilityConfig is capabilityConfig as an embed run registers it, replacing run's under | ||
| // the same namespace. It keeps the DON ID and drops the proxy URL: there is no node behind an | ||
| // embedded run to dial, so only what this binary hosts resolves. | ||
| type embeddedCapabilityConfig struct { |
There was a problem hiding this comment.
?? it's this hard-coded to the same value every time? Do we need it?
| telemetry TelemetryConfig | ||
| tracing TracingConfig | ||
| chipIngress ChipIngressConfig | ||
| pyroscope PyroscopeConfig |
There was a problem hiding this comment.
Why was this removed?
| root.AddCommand(&cobra.Command{ | ||
| // serve starts total instances from r and blocks until ctx is done. Only run hands the process | ||
| // to a go-plugin host: a host supervises one plugin, and an embed run is not one. | ||
| serve := func(cmd *cobra.Command, r *registrations, total int, pluginHost bool) error { |
There was a problem hiding this comment.
pluginHost doesn’t need to be a boolean, can just check underPluginHost it's harmless and fast


No description provided.