mirror of https://github.com/k3s-io/k3s
Increase the AppArmor pod stop timeout to match the start timeout
parent
8ba1be314e
commit
a29ad353a6
|
@ -1216,10 +1216,10 @@ func waitTimeoutForPodRunningInNamespace(c *client.Client, podName, namespace, r
|
||||||
// Waits default amount of time (podNoLongerRunningTimeout) for the specified pod to stop running.
|
// Waits default amount of time (podNoLongerRunningTimeout) for the specified pod to stop running.
|
||||||
// Returns an error if timeout occurs first.
|
// Returns an error if timeout occurs first.
|
||||||
func WaitForPodNoLongerRunningInNamespace(c *client.Client, podName, namespace, resourceVersion string) error {
|
func WaitForPodNoLongerRunningInNamespace(c *client.Client, podName, namespace, resourceVersion string) error {
|
||||||
return waitTimeoutForPodNoLongerRunningInNamespace(c, podName, namespace, resourceVersion, podNoLongerRunningTimeout)
|
return WaitTimeoutForPodNoLongerRunningInNamespace(c, podName, namespace, resourceVersion, podNoLongerRunningTimeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
func waitTimeoutForPodNoLongerRunningInNamespace(c *client.Client, podName, namespace, resourceVersion string, timeout time.Duration) error {
|
func WaitTimeoutForPodNoLongerRunningInNamespace(c *client.Client, podName, namespace, resourceVersion string, timeout time.Duration) error {
|
||||||
w, err := c.Pods(namespace).Watch(api.SingleObject(api.ObjectMeta{Name: podName, ResourceVersion: resourceVersion}))
|
w, err := c.Pods(namespace).Watch(api.SingleObject(api.ObjectMeta{Name: podName, ResourceVersion: resourceVersion}))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -146,7 +146,9 @@ func loadTestProfiles() error {
|
||||||
|
|
||||||
func runAppArmorTest(f *framework.Framework, profile string) api.PodStatus {
|
func runAppArmorTest(f *framework.Framework, profile string) api.PodStatus {
|
||||||
pod := createPodWithAppArmor(f, profile)
|
pod := createPodWithAppArmor(f, profile)
|
||||||
framework.ExpectNoError(f.WaitForPodNoLongerRunning(pod.Name))
|
// The pod needs to start before it stops, so wait for the longer start timeout.
|
||||||
|
framework.ExpectNoError(framework.WaitTimeoutForPodNoLongerRunningInNamespace(
|
||||||
|
f.Client, pod.Name, f.Namespace.Name, "", framework.PodStartTimeout))
|
||||||
p, err := f.PodClient().Get(pod.Name)
|
p, err := f.PodClient().Get(pod.Name)
|
||||||
framework.ExpectNoError(err)
|
framework.ExpectNoError(err)
|
||||||
return p.Status
|
return p.Status
|
||||||
|
|
Loading…
Reference in New Issue