mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Fix docker-links-style env vars for services
This includes 3 changes: 1) Use the Service.Protocol field, rather than hardcoding TCP. 2) Use Service.Port rather than ContainerPort - ContainerPort can be a string and has absolutely no meaning to consumers. 3) Beef up tests for these env vars.
This commit is contained in:
@@ -107,19 +107,19 @@ func TestMakeManifestServices(t *testing.T) {
|
||||
Value: "tcp://machine:8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP",
|
||||
Name: "TEST_PORT_8080_TCP",
|
||||
Value: "tcp://machine:8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_PROTO",
|
||||
Name: "TEST_PORT_8080_TCP_PROTO",
|
||||
Value: "tcp",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_PORT",
|
||||
Name: "TEST_PORT_8080_TCP_PORT",
|
||||
Value: "8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_ADDR",
|
||||
Name: "TEST_PORT_8080_TCP_ADDR",
|
||||
Value: "machine",
|
||||
},
|
||||
{
|
||||
@@ -197,19 +197,19 @@ func TestMakeManifestServicesExistingEnvVar(t *testing.T) {
|
||||
Value: "tcp://machine:8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP",
|
||||
Name: "TEST_PORT_8080_TCP",
|
||||
Value: "tcp://machine:8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_PROTO",
|
||||
Name: "TEST_PORT_8080_TCP_PROTO",
|
||||
Value: "tcp",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_PORT",
|
||||
Name: "TEST_PORT_8080_TCP_PORT",
|
||||
Value: "8080",
|
||||
},
|
||||
{
|
||||
Name: "TEST_PORT_900_TCP_ADDR",
|
||||
Name: "TEST_PORT_8080_TCP_ADDR",
|
||||
Value: "machine",
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user