Skip to content

Commit 48347d4

Browse files
committed
address remaining review comments
Signed-off-by: Etai Lev Ran <[email protected]>
1 parent f964c89 commit 48347d4

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

pkg/epp/datalayer/datasource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func RegisterSource(src DataSource) error {
9797
return defaultDataSources.Register(src)
9898
}
9999

100-
// GetNamedSourceTyped returns a typed data source from the default registry.
100+
// GetNamedSource returns a typed data source from the default registry.
101101
func GetNamedSource[T DataSource](name string) (T, bool) {
102102
v, ok := defaultDataSources.GetNamedSource(name)
103103
if !ok {

pkg/epp/datalayer/factory.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,13 @@ type EndpointLifecycle struct {
5858
}
5959

6060
// NewEndpointFactory returns a new endpoint for factory, managing collectors for
61-
// its endpoints.
62-
// Sources might not be known at creation time (e.g., loaded from configuration
63-
// file), so they're not passed at this point.
61+
// its endpoints. This function assumes that sources are not modified afterwards.
6462
func NewEndpointFactory(sources []DataSource, refreshMetricsInterval time.Duration) *EndpointLifecycle {
65-
lc := &EndpointLifecycle{
66-
sources: make([]DataSource, len(sources)),
63+
return &EndpointLifecycle{
64+
sources: sources,
6765
collectors: sync.Map{},
6866
refreshInterval: refreshMetricsInterval,
6967
}
70-
_ = copy(lc.sources, sources)
71-
72-
return lc
7368
}
7469

7570
// NewEndpoint implements EndpointFactory.NewEndpoint.

0 commit comments

Comments
 (0)