mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 23:03:40 +00:00
Add e2e test case for downward API exposing pod UID
This commit is contained in:
parent
0f5f82fa44
commit
f9a6445ea9
@ -187,6 +187,29 @@ var _ = framework.KubeDescribe("Downward API", func() {
|
||||
|
||||
testDownwardAPIUsingPod(f, pod, env, expectations)
|
||||
})
|
||||
|
||||
It("should provide pod UID as env vars [Conformance]", func() {
|
||||
framework.SkipUnlessServerVersionGTE(hostIPVersion, f.ClientSet.Discovery())
|
||||
podUID := uuid.NewUUID()
|
||||
podName := "downward-api-" + string(podUID)
|
||||
env := []v1.EnvVar{
|
||||
{
|
||||
Name: "POD_UID",
|
||||
ValueFrom: &v1.EnvVarSource{
|
||||
FieldRef: &v1.ObjectFieldSelector{
|
||||
APIVersion: "v1",
|
||||
FieldPath: "metadata.uid",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
expectations := []string{
|
||||
fmt.Sprintf("POD_UID=%v", podUID),
|
||||
}
|
||||
|
||||
testDownwardAPI(f, podName, env, expectations)
|
||||
})
|
||||
})
|
||||
|
||||
func testDownwardAPI(f *framework.Framework, podName string, env []v1.EnvVar, expectations []string) {
|
||||
|
Loading…
Reference in New Issue
Block a user