Skip to content

Commit 96e8181

Browse files
committed
Clarify hostport
Signed-off-by: Pavol Loffay <[email protected]>
1 parent 0f78c30 commit 96e8181

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

apis/v1alpha1/convert.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,12 @@ func tov1beta1Ports(in []PortsSpec) []v1beta1.PortsSpec {
151151
for _, p := range in {
152152
ports = append(ports, v1beta1.PortsSpec{
153153
ServicePort: v1.ServicePort{
154-
Name: p.Name,
155-
Protocol: p.Protocol,
156-
AppProtocol: p.AppProtocol,
157-
Port: p.Port,
158-
TargetPort: p.TargetPort,
159-
NodePort: p.NodePort,
154+
Name: p.ServicePort.Name,
155+
Protocol: p.ServicePort.Protocol,
156+
AppProtocol: p.ServicePort.AppProtocol,
157+
Port: p.ServicePort.Port,
158+
TargetPort: p.ServicePort.TargetPort,
159+
NodePort: p.ServicePort.NodePort,
160160
},
161161
HostPort: p.HostPort,
162162
})
@@ -276,12 +276,12 @@ func tov1alpha1Ports(in []v1beta1.PortsSpec) []PortsSpec {
276276
for _, p := range in {
277277
ports = append(ports, PortsSpec{
278278
ServicePort: v1.ServicePort{
279-
Name: p.Name,
280-
Protocol: p.Protocol,
281-
AppProtocol: p.AppProtocol,
282-
Port: p.Port,
283-
TargetPort: p.TargetPort,
284-
NodePort: p.NodePort,
279+
Name: p.ServicePort.Name,
280+
Protocol: p.ServicePort.Protocol,
281+
AppProtocol: p.ServicePort.AppProtocol,
282+
Port: p.ServicePort.Port,
283+
TargetPort: p.ServicePort.TargetPort,
284+
NodePort: p.ServicePort.NodePort,
285285
},
286286
HostPort: p.HostPort,
287287
})

apis/v1alpha1/convert_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func Test_tov1beta1AndBack(t *testing.T) {
181181
ServicePort: v1.ServicePort{
182182
Name: "otlp",
183183
},
184-
HostPort: 0,
184+
HostPort: 4317,
185185
}},
186186
Env: []v1.EnvVar{
187187
{

0 commit comments

Comments
 (0)