Skip to content

Commit 4369024

Browse files
committed
fix
1 parent a0ec270 commit 4369024

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

internal/options/options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func AppOptions(opts ...fx.Option) []fx.Option {
1414
return append([]fx.Option{
1515
fx.Provide(provider.ProvideLogger),
16-
fx.Provide(fx.Annotate(hypervisor.ProvideLibvirtDialer, fx.ResultTags(`group:"libvirt.dialers"`))),
16+
fx.Provide(hypervisor.ProvideLibvirtDialer),
1717
fx.Provide(hypervisor.ProvideLibvirt),
1818
fx.Provide(config.ProvideConfig),
1919
fx.Provide(provider.ProvideGRPCServer),

internal/provider/hypervisor/libvirt.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ func ProvideLibvirt(lc fx.Lifecycle, params provideLibvirtParams) *Hypervisors {
6262
return &Hypervisors{Libvirts: virts, Logger: params.Log.With(zap.String("tier", "hypervisor"))}
6363
}
6464

65-
func ProvideLibvirtDialer(log *zap.Logger, config *config.Config) []*ZonedDialer {
65+
type provideLibvirtDialerOutput struct {
66+
fx.Out
67+
68+
Dialers []*ZonedDialer `group:"libvirt.dialers"`
69+
}
70+
71+
func ProvideLibvirtDialer(log *zap.Logger, config *config.Config) provideLibvirtDialerOutput {
6672
buildDialer := func(uri string) *ZonedDialer {
6773
endpoint, err := url.Parse(uri)
6874
if err != nil {
@@ -91,7 +97,7 @@ func ProvideLibvirtDialer(log *zap.Logger, config *config.Config) []*ZonedDialer
9197
dialers[idx+1] = buildDialer(zone.LibvirtEndpoint)
9298
dialers[idx+1].Zone = zone.Name
9399
}
94-
return dialers
100+
return provideLibvirtDialerOutput{Dialers: dialers}
95101
}
96102

97103
func (h *Hypervisors) Zone(zone string) (*libvirt.Libvirt, error) {

0 commit comments

Comments
 (0)