forked from kubevirt/kubevirt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Block pausing of VMIs with LivenessProbe
Signed-off-by: Marc Sluiter <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,8 @@ import ( | |
"strings" | ||
"time" | ||
|
||
"k8s.io/apimachinery/pkg/util/intstr" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
|
||
|
@@ -90,6 +92,35 @@ var _ = Describe("[rfe_id:3064][crit:medium][vendor:[email protected]][level:com | |
tests.WaitForVMIConditionRemovedOrFalse(virtClient, vmi, v1.VirtualMachineInstancePaused, 30) | ||
}) | ||
}) | ||
|
||
Context("with a LivenessProbe configured", func() { | ||
When("paused via virtctl", func() { | ||
It("should not be paused", func() { | ||
By("Launching a VMI with LivenessProbe") | ||
vmi = tests.NewRandomVMIWithEphemeralDisk(tests.ContainerDiskFor(tests.ContainerDiskCirros)) | ||
// a random probe wich will not fail immediately | ||
vmi.Spec.LivenessProbe = &v1.Probe{ | ||
Handler: v1.Handler{ | ||
HTTPGet: &k8sv1.HTTPGetAction{ | ||
Path: "/something", | ||
Port: intstr.FromInt(8080), | ||
}, | ||
}, | ||
InitialDelaySeconds: 120, | ||
TimeoutSeconds: 120, | ||
PeriodSeconds: 120, | ||
SuccessThreshold: 1, | ||
FailureThreshold: 1, | ||
} | ||
tests.RunVMIAndExpectLaunch(vmi, 90) | ||
|
||
By("Pausing it") | ||
command := tests.NewRepeatableVirtctlCommand("pause", "vmi", "--namespace", tests.NamespaceTestDefault, vmi.Name) | ||
err := command() | ||
Expect(err.Error()).To(ContainSubstring("Pausing VMIs with LivenessProbe is currently not supported")) | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
Context("A valid VM", func() { | ||
|