Skip to content

Commit 97e8f2f

Browse files
committed
Renamed PodInfo EndpointMetadata
Signed-off-by: Shmuel Kallner <[email protected]>
1 parent bef80ca commit 97e8f2f

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

pkg/epp/datalayer/podinfo.go renamed to pkg/epp/datalayer/endpoint_metadata.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ type Addressable interface {
3030
GetNamespacedName() types.NamespacedName
3131
}
3232

33-
// PodInfo represents the relevant Kubernetes Pod state of an inference server.
34-
type PodInfo struct {
33+
// EndpointMetadata represents the relevant Kubernetes Pod state of an inference server.
34+
type EndpointMetadata struct {
3535
NamespacedName types.NamespacedName
3636
PodName string
3737
Address string
@@ -40,16 +40,16 @@ type PodInfo struct {
4040
Labels map[string]string
4141
}
4242

43-
// String returns a string representation of the pod.
44-
func (p *PodInfo) String() string {
45-
if p == nil {
43+
// String returns a string representation of the endpoint.
44+
func (e *EndpointMetadata) String() string {
45+
if e == nil {
4646
return ""
4747
}
48-
return fmt.Sprintf("%+v", *p)
48+
return fmt.Sprintf("%+v", *e)
4949
}
5050

5151
// Clone returns a full copy of the object.
52-
func (p *PodInfo) Clone() *PodInfo {
52+
func (p *EndpointMetadata) Clone() *EndpointMetadata {
5353
if p == nil {
5454
return nil
5555
}
@@ -58,7 +58,7 @@ func (p *PodInfo) Clone() *PodInfo {
5858
for key, value := range p.Labels {
5959
clonedLabels[key] = value
6060
}
61-
return &PodInfo{
61+
return &EndpointMetadata{
6262
NamespacedName: types.NamespacedName{
6363
Name: p.NamespacedName.Name,
6464
Namespace: p.NamespacedName.Namespace,
@@ -71,22 +71,22 @@ func (p *PodInfo) Clone() *PodInfo {
7171
}
7272
}
7373

74-
// GetNamespacedName gets the namespace name of the Pod.
75-
func (p *PodInfo) GetNamespacedName() types.NamespacedName {
76-
return p.NamespacedName
74+
// GetNamespacedName gets the namespace name of the Endpoint.
75+
func (e *EndpointMetadata) GetNamespacedName() types.NamespacedName {
76+
return e.NamespacedName
7777
}
7878

79-
// GetIPAddress returns the Pod's IP address.
80-
func (p *PodInfo) GetIPAddress() string {
81-
return p.Address
79+
// GetIPAddress returns the Endpoint's IP address.
80+
func (e *EndpointMetadata) GetIPAddress() string {
81+
return e.Address
8282
}
8383

84-
// GetPort returns the Pod's inference port.
85-
func (p *PodInfo) GetPort() string {
86-
return p.Port
84+
// GetPort returns the Endpoint's inference port.
85+
func (e *EndpointMetadata) GetPort() string {
86+
return e.Port
8787
}
8888

89-
// GetMetricsHost returns the pod's metrics host (ip:port)
90-
func (p *PodInfo) GetMetricsHost() string {
91-
return p.MetricsHost
89+
// GetMetricsHost returns the Endpoint's metrics host (ip:port)
90+
func (e *EndpointMetadata) GetMetricsHost() string {
91+
return e.MetricsHost
9292
}

pkg/epp/datalayer/podinfo_test.go renamed to pkg/epp/datalayer/endpoint_metadata_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ var (
4848
PodIP: podip,
4949
},
5050
}
51-
expected = &PodInfo{
51+
expected = &EndpointMetadata{
5252
NamespacedName: types.NamespacedName{Name: name, Namespace: namespace},
5353
Address: podip,
5454
Labels: labels,
5555
}
5656
)
5757

58-
func TestPodInfoClone(t *testing.T) {
58+
func TestEndpointMetadataClone(t *testing.T) {
5959
clone := expected.Clone()
6060
assert.NotSame(t, expected, clone)
6161
if diff := cmp.Diff(expected, clone); diff != "" {
@@ -67,7 +67,7 @@ func TestPodInfoClone(t *testing.T) {
6767
}
6868

6969
func TestPodInfoString(t *testing.T) {
70-
podinfo := PodInfo{
70+
endpointMetadata := EndpointMetadata{
7171
NamespacedName: types.NamespacedName{
7272
Name: pod.Name,
7373
Namespace: pod.Namespace,
@@ -79,7 +79,7 @@ func TestPodInfoString(t *testing.T) {
7979
Labels: labels,
8080
}
8181

82-
s := podinfo.String()
82+
s := endpointMetadata.String()
8383
assert.Contains(t, s, name)
8484
assert.Contains(t, s, namespace)
8585
assert.Contains(t, s, podip)

0 commit comments

Comments
 (0)