Skip to content

Commit e6741b4

Browse files
committed
Updates to reflect newer APIs
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent 444dbd7 commit e6741b4

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

pkg/epp/datalayer/endpoint.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ package datalayer
1919
import (
2020
"fmt"
2121
"sync/atomic"
22-
23-
corev1 "k8s.io/api/core/v1"
2422
)
2523

2624
// EndpointPodState allows management of the Pod related attributes.
2725
type EndpointPodState interface {
2826
GetPod() *PodInfo
29-
UpdatePod(*corev1.Pod)
27+
UpdatePod(*PodInfo)
3028
}
3129

3230
// EndpointMetricsState allows management of the Metrics related attributes.
@@ -67,8 +65,8 @@ func (srv *ModelServer) GetPod() *PodInfo {
6765
return srv.pod.Load()
6866
}
6967

70-
func (srv *ModelServer) UpdatePod(pod *corev1.Pod) {
71-
srv.pod.Store(ToPodInfo(pod))
68+
func (srv *ModelServer) UpdatePod(pod *PodInfo) {
69+
srv.pod.Store(pod)
7270
}
7371

7472
func (srv *ModelServer) GetMetrics() *Metrics {

pkg/epp/datalayer/factory.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"sync"
2222
"time"
2323

24-
corev1 "k8s.io/api/core/v1"
2524
"k8s.io/apimachinery/pkg/types"
2625
"sigs.k8s.io/controller-runtime/pkg/log"
2726

@@ -45,7 +44,7 @@ type PoolInfo interface {
4544
// providing methods to allocate and retire endpoints. This can potentially be used for
4645
// pooled memory or other management chores in the implementation.
4746
type EndpointFactory interface {
48-
NewEndpoint(parent context.Context, inpod *corev1.Pod, poolinfo PoolInfo) Endpoint
47+
NewEndpoint(parent context.Context, inpod *PodInfo, poolinfo PoolInfo) Endpoint
4948
ReleaseEndpoint(ep Endpoint)
5049
}
5150

@@ -70,8 +69,8 @@ func NewEndpointFactory(sources []DataSource, refreshMetricsInterval time.Durati
7069
// NewEndpoint implements EndpointFactory.NewEndpoint.
7170
// Creates a new endpoint and starts its associated collector with its own ticker.
7271
// Guards against multiple concurrent calls for the same endpoint.
73-
func (lc *EndpointLifecycle) NewEndpoint(parent context.Context, inpod *corev1.Pod, _ PoolInfo) Endpoint {
74-
key := types.NamespacedName{Namespace: inpod.Namespace, Name: inpod.Name}
72+
func (lc *EndpointLifecycle) NewEndpoint(parent context.Context, inpod *PodInfo, _ PoolInfo) Endpoint {
73+
key := types.NamespacedName{Namespace: inpod.GetNamespacedName().Namespace, Name: inpod.GetNamespacedName().Name}
7574
logger := log.FromContext(parent).WithValues("pod", key)
7675

7776
if _, ok := lc.collectors.Load(key); ok {

0 commit comments

Comments
 (0)