Skip to content

Commit 624992f

Browse files
committed
retrieve a typed data source
Signed-off-by: Etai Lev Ran <[email protected]>
1 parent d09a6c4 commit 624992f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

pkg/epp/datastore/datastore.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,8 @@ func (ds *datastore) PoolSet(ctx context.Context, reader client.Reader, pool *v1
118118
oldPool := ds.pool
119119
ds.pool = pool
120120
if oldPool == nil || pool.Spec.TargetPorts[0] != oldPool.Spec.TargetPorts[0] {
121-
if datalayer.Enabled(logger) {
122-
if source, found := datalayer.GetNamedSource(dlmetrics.DataSourceName); found {
123-
metricsSource := source.(*dlmetrics.DataSource)
124-
metricsSource.SetPort(int32(pool.Spec.TargetPorts[0].Number))
125-
}
121+
if source, found := datalayer.GetNamedSource[*dlmetrics.DataSource](dlmetrics.DataSourceName); found {
122+
source.SetPort(int32(pool.Spec.TargetPorts[0].Number))
126123
}
127124
}
128125
if oldPool == nil || !reflect.DeepEqual(pool.Spec.Selector, oldPool.Spec.Selector) {

0 commit comments

Comments
 (0)