mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Revert "Multi-port Endpoints"
This commit is contained in:
@@ -73,7 +73,7 @@ func TestSetDefaulPodSpec(t *testing.T) {
|
||||
func TestSetDefaultContainer(t *testing.T) {
|
||||
bp := ¤t.BoundPod{}
|
||||
bp.Spec.Containers = []current.Container{{}}
|
||||
bp.Spec.Containers[0].Ports = []current.ContainerPort{{}}
|
||||
bp.Spec.Containers[0].Ports = []current.Port{{}}
|
||||
|
||||
obj2 := roundTrip(t, runtime.Object(bp))
|
||||
bp2 := obj2.(*current.BoundPod)
|
||||
@@ -104,25 +104,11 @@ func TestSetDefaultSecret(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSetDefaulEndpointsProtocol(t *testing.T) {
|
||||
in := ¤t.Endpoints{
|
||||
Endpoints: []current.Endpoint{
|
||||
{IP: "1.2.3.4", Ports: []current.EndpointPort{
|
||||
{Protocol: "TCP"},
|
||||
{Protocol: "UDP"},
|
||||
{Protocol: ""},
|
||||
}},
|
||||
},
|
||||
}
|
||||
in := ¤t.Endpoints{}
|
||||
obj := roundTrip(t, runtime.Object(in))
|
||||
out := obj.(*current.Endpoints)
|
||||
|
||||
if out.Endpoints[0].Ports[0].Protocol != current.ProtocolTCP {
|
||||
t.Errorf("Expected protocol[0] %s, got %s", current.ProtocolTCP, out.Endpoints[0].Ports[0].Protocol)
|
||||
}
|
||||
if out.Endpoints[0].Ports[1].Protocol != current.ProtocolUDP {
|
||||
t.Errorf("Expected protocol[1] %s, got %s", current.ProtocolTCP, out.Endpoints[0].Ports[1].Protocol)
|
||||
}
|
||||
if out.Endpoints[0].Ports[2].Protocol != current.ProtocolTCP {
|
||||
t.Errorf("Expected protocol[2] %s, got %s", current.ProtocolTCP, out.Endpoints[0].Ports[2].Protocol)
|
||||
if out.Protocol != current.ProtocolTCP {
|
||||
t.Errorf("Expected protocol %s, got %s", current.ProtocolTCP, out.Protocol)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user