mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Make disk eviction test run correctly on all images.
This commit is contained in:
@@ -67,7 +67,7 @@ var _ = framework.KubeDescribe("Kubelet Eviction Manager [Serial] [Disruptive]",
|
||||
})
|
||||
|
||||
BeforeEach(func() {
|
||||
if !evictionOptionIsSet() {
|
||||
if !isImageSupported() || !evictionOptionIsSet() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -97,6 +97,10 @@ var _ = framework.KubeDescribe("Kubelet Eviction Manager [Serial] [Disruptive]",
|
||||
})
|
||||
|
||||
It("should evict the pod using the most disk space [Slow]", func() {
|
||||
if !isImageSupported() {
|
||||
framework.Logf("test skipped because the image is not supported by the test")
|
||||
return
|
||||
}
|
||||
if !evictionOptionIsSet() {
|
||||
framework.Logf("test skipped because eviction option is not set")
|
||||
return
|
||||
@@ -217,3 +221,9 @@ func recordContainerId(containersToCleanUp map[string]bool, containerStatuses []
|
||||
func evictionOptionIsSet() bool {
|
||||
return len(framework.TestContext.EvictionHard) > 0
|
||||
}
|
||||
|
||||
func isImageSupported() bool {
|
||||
// TODO: Only images with image fs is selected for testing for now. When the kubelet settings can be dynamically updated,
|
||||
// instead of skipping images the eviction thresholds should be adjusted based on the images.
|
||||
return strings.Contains(framework.TestContext.NodeName, "-gci-dev-")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user