mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Merge pull request #90707 from jherrera123/fix-issue-88132
Make flexvolume e2e tests runnable again.
This commit is contained in:
commit
c5be566b14
@ -42,9 +42,6 @@ import (
|
|||||||
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
|
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestContext should be used by all tests to access common context data.
|
|
||||||
var TestContext framework.TestContextType
|
|
||||||
|
|
||||||
// New local storage types to support local storage capacity isolation
|
// New local storage types to support local storage capacity isolation
|
||||||
var localStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"
|
var localStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"
|
||||||
|
|
||||||
@ -154,29 +151,29 @@ func SkipIfMissingResource(dynamicClient dynamic.Interface, gvr schema.GroupVers
|
|||||||
|
|
||||||
// SkipUnlessNodeCountIsAtLeast skips if the number of nodes is less than the minNodeCount.
|
// SkipUnlessNodeCountIsAtLeast skips if the number of nodes is less than the minNodeCount.
|
||||||
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
|
||||||
if TestContext.CloudConfig.NumNodes < minNodeCount {
|
if framework.TestContext.CloudConfig.NumNodes < minNodeCount {
|
||||||
skipInternalf(1, "Requires at least %d nodes (not %d)", minNodeCount, TestContext.CloudConfig.NumNodes)
|
skipInternalf(1, "Requires at least %d nodes (not %d)", minNodeCount, framework.TestContext.CloudConfig.NumNodes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SkipUnlessNodeCountIsAtMost skips if the number of nodes is greater than the maxNodeCount.
|
// SkipUnlessNodeCountIsAtMost skips if the number of nodes is greater than the maxNodeCount.
|
||||||
func SkipUnlessNodeCountIsAtMost(maxNodeCount int) {
|
func SkipUnlessNodeCountIsAtMost(maxNodeCount int) {
|
||||||
if TestContext.CloudConfig.NumNodes > maxNodeCount {
|
if framework.TestContext.CloudConfig.NumNodes > maxNodeCount {
|
||||||
skipInternalf(1, "Requires at most %d nodes (not %d)", maxNodeCount, TestContext.CloudConfig.NumNodes)
|
skipInternalf(1, "Requires at most %d nodes (not %d)", maxNodeCount, framework.TestContext.CloudConfig.NumNodes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SkipIfProviderIs skips if the provider is included in the unsupportedProviders.
|
// SkipIfProviderIs skips if the provider is included in the unsupportedProviders.
|
||||||
func SkipIfProviderIs(unsupportedProviders ...string) {
|
func SkipIfProviderIs(unsupportedProviders ...string) {
|
||||||
if framework.ProviderIs(unsupportedProviders...) {
|
if framework.ProviderIs(unsupportedProviders...) {
|
||||||
skipInternalf(1, "Not supported for providers %v (found %s)", unsupportedProviders, TestContext.Provider)
|
skipInternalf(1, "Not supported for providers %v (found %s)", unsupportedProviders, framework.TestContext.Provider)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SkipUnlessProviderIs skips if the provider is not included in the supportedProviders.
|
// SkipUnlessProviderIs skips if the provider is not included in the supportedProviders.
|
||||||
func SkipUnlessProviderIs(supportedProviders ...string) {
|
func SkipUnlessProviderIs(supportedProviders ...string) {
|
||||||
if !framework.ProviderIs(supportedProviders...) {
|
if !framework.ProviderIs(supportedProviders...) {
|
||||||
skipInternalf(1, "Only supported for providers %v (not %s)", supportedProviders, TestContext.Provider)
|
skipInternalf(1, "Only supported for providers %v (not %s)", supportedProviders, framework.TestContext.Provider)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,21 +202,21 @@ func SkipIfMultizone(c clientset.Interface) {
|
|||||||
// SkipUnlessMasterOSDistroIs skips if the master OS distro is not included in the supportedMasterOsDistros.
|
// SkipUnlessMasterOSDistroIs skips if the master OS distro is not included in the supportedMasterOsDistros.
|
||||||
func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string) {
|
func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string) {
|
||||||
if !framework.MasterOSDistroIs(supportedMasterOsDistros...) {
|
if !framework.MasterOSDistroIs(supportedMasterOsDistros...) {
|
||||||
skipInternalf(1, "Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, TestContext.MasterOSDistro)
|
skipInternalf(1, "Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, framework.TestContext.MasterOSDistro)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SkipUnlessNodeOSDistroIs skips if the node OS distro is not included in the supportedNodeOsDistros.
|
// SkipUnlessNodeOSDistroIs skips if the node OS distro is not included in the supportedNodeOsDistros.
|
||||||
func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) {
|
func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) {
|
||||||
if !framework.NodeOSDistroIs(supportedNodeOsDistros...) {
|
if !framework.NodeOSDistroIs(supportedNodeOsDistros...) {
|
||||||
skipInternalf(1, "Only supported for node OS distro %v (not %s)", supportedNodeOsDistros, TestContext.NodeOSDistro)
|
skipInternalf(1, "Only supported for node OS distro %v (not %s)", supportedNodeOsDistros, framework.TestContext.NodeOSDistro)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
|
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
|
||||||
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
|
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
|
||||||
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {
|
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {
|
||||||
skipInternalf(1, "Not supported for node OS distro %v (is %s)", unsupportedNodeOsDistros, TestContext.NodeOSDistro)
|
skipInternalf(1, "Not supported for node OS distro %v (is %s)", unsupportedNodeOsDistros, framework.TestContext.NodeOSDistro)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,8 +233,8 @@ func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersio
|
|||||||
|
|
||||||
// SkipUnlessSSHKeyPresent skips if no SSH key is found.
|
// SkipUnlessSSHKeyPresent skips if no SSH key is found.
|
||||||
func SkipUnlessSSHKeyPresent() {
|
func SkipUnlessSSHKeyPresent() {
|
||||||
if _, err := e2essh.GetSigner(TestContext.Provider); err != nil {
|
if _, err := e2essh.GetSigner(framework.TestContext.Provider); err != nil {
|
||||||
skipInternalf(1, "No SSH Key for provider %s: '%v'", TestContext.Provider, err)
|
skipInternalf(1, "No SSH Key for provider %s: '%v'", framework.TestContext.Provider, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -265,19 +262,19 @@ func SkipIfAppArmorNotSupported() {
|
|||||||
// RunIfContainerRuntimeIs runs if the container runtime is included in the runtimes.
|
// RunIfContainerRuntimeIs runs if the container runtime is included in the runtimes.
|
||||||
func RunIfContainerRuntimeIs(runtimes ...string) {
|
func RunIfContainerRuntimeIs(runtimes ...string) {
|
||||||
for _, containerRuntime := range runtimes {
|
for _, containerRuntime := range runtimes {
|
||||||
if containerRuntime == TestContext.ContainerRuntime {
|
if containerRuntime == framework.TestContext.ContainerRuntime {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skipInternalf(1, "Skipped because container runtime %q is not in %s", TestContext.ContainerRuntime, runtimes)
|
skipInternalf(1, "Skipped because container runtime %q is not in %s", framework.TestContext.ContainerRuntime, runtimes)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunIfSystemSpecNameIs runs if the system spec name is included in the names.
|
// RunIfSystemSpecNameIs runs if the system spec name is included in the names.
|
||||||
func RunIfSystemSpecNameIs(names ...string) {
|
func RunIfSystemSpecNameIs(names ...string) {
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
if name == TestContext.SystemSpecName {
|
if name == framework.TestContext.SystemSpecName {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
skipInternalf(1, "Skipped because system spec name %q is not in %v", TestContext.SystemSpecName, names)
|
skipInternalf(1, "Skipped because system spec name %q is not in %v", framework.TestContext.SystemSpecName, names)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user