mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
setHostnameAsFQDN is a GA feature that does not depend on environment
This commit is contained in:
parent
17da6a2345
commit
cf0a387774
@ -69,7 +69,7 @@ func testPod(podnamebase string) *v1.Pod {
|
|||||||
return pod
|
return pod
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = SIGDescribe("Hostname of Pod [Feature:SetHostnameAsFQDN][NodeFeature:SetHostnameAsFQDN]", func() {
|
var _ = SIGDescribe("Hostname of Pod [NodeConformance]", func() {
|
||||||
f := framework.NewDefaultFramework("hostfqdn")
|
f := framework.NewDefaultFramework("hostfqdn")
|
||||||
/*
|
/*
|
||||||
Release: v1.19
|
Release: v1.19
|
||||||
@ -88,7 +88,7 @@ var _ = SIGDescribe("Hostname of Pod [Feature:SetHostnameAsFQDN][NodeFeature:Set
|
|||||||
Release: v1.19
|
Release: v1.19
|
||||||
Testname: Create Pod without FQDN, setHostnameAsFQDN field set to true
|
Testname: Create Pod without FQDN, setHostnameAsFQDN field set to true
|
||||||
Description: A Pod that does not define the subdomain field in it spec, does not have FQDN.
|
Description: A Pod that does not define the subdomain field in it spec, does not have FQDN.
|
||||||
Hence, SetHostnameAsFQDN feature has no effect.
|
Hence, setHostnameAsFQDN field has no effect.
|
||||||
*/
|
*/
|
||||||
ginkgo.It("a pod without FQDN is not affected by SetHostnameAsFQDN field", func() {
|
ginkgo.It("a pod without FQDN is not affected by SetHostnameAsFQDN field", func() {
|
||||||
pod := testPod("hostfqdn")
|
pod := testPod("hostfqdn")
|
||||||
@ -201,7 +201,7 @@ func expectSandboxFailureEvent(f *framework.Framework, pod *v1.Pod, msg string)
|
|||||||
|
|
||||||
func checkPodIsPending(f *framework.Framework, podName, namespace string) error {
|
func checkPodIsPending(f *framework.Framework, podName, namespace string) error {
|
||||||
c := f.ClientSet
|
c := f.ClientSet
|
||||||
// we call this functoin after we saw event failing to create Pod, hence
|
// we call this function after we saw event failing to create Pod, hence
|
||||||
// pod has already been created and it should be in Pending status. Giving
|
// pod has already been created and it should be in Pending status. Giving
|
||||||
// 30 seconds to fetch the pod to avoid failing for transient issues getting
|
// 30 seconds to fetch the pod to avoid failing for transient issues getting
|
||||||
// pods.
|
// pods.
|
||||||
@ -215,8 +215,7 @@ func checkPodIsPending(f *framework.Framework, podName, namespace string) error
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// If pod gets to this status, either FQDN is shorter than 64bytes
|
// If pod gets to this status, it is likely that FQDN is shorter than 64bytes.
|
||||||
// or setHostnameAsFQDN feature is not enable/in use.
|
|
||||||
if pod.Status.Phase == v1.PodRunning || pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed {
|
if pod.Status.Phase == v1.PodRunning || pod.Status.Phase == v1.PodSucceeded || pod.Status.Phase == v1.PodFailed {
|
||||||
return true, fmt.Errorf("Expected pod %q in namespace %q to be in phase Pending, but got phase: %v", podName, namespace, pod.Status.Phase)
|
return true, fmt.Errorf("Expected pod %q in namespace %q to be in phase Pending, but got phase: %v", podName, namespace, pod.Status.Phase)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user