e2e tests for status.hostIP in downward api

This commit is contained in:
andrewsykim 2017-03-13 20:13:32 -04:00
parent 91c027d6cc
commit 824d0b11cb
2 changed files with 15 additions and 0 deletions

View File

@ -502,6 +502,15 @@ func TestMakeEnvironmentVariables(t *testing.T) {
},
},
},
{
Name: "HOST_IP",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{
APIVersion: api.Registry.GroupOrDie(v1.GroupName).GroupVersion.String(),
FieldPath: "status.hostIP",
},
},
},
},
},
masterServiceNs: "nothing",
@ -512,6 +521,7 @@ func TestMakeEnvironmentVariables(t *testing.T) {
{Name: "POD_NODE_NAME", Value: "node-name"},
{Name: "POD_SERVICE_ACCOUNT_NAME", Value: "special"},
{Name: "POD_IP", Value: "1.2.3.4"},
{Name: "HOST_IP", Value: "5.6.7.8"},
},
},
{
@ -1142,6 +1152,9 @@ func TestMakeEnvironmentVariables(t *testing.T) {
ServiceAccountName: "special",
NodeName: "node-name",
},
Status: v1.PodStatus{
HostIP: "5.6.7.8",
},
}
podIP := "1.2.3.4"

View File

@ -73,6 +73,8 @@ var _ = framework.KubeDescribe("Downward API", func() {
FieldPath: "status.podIP",
},
},
},
{
Name: "HOST_IP",
ValueFrom: &v1.EnvVarSource{
FieldRef: &v1.ObjectFieldSelector{