Skip to content

Commit c5be566

Browse files
authored
Merge pull request kubernetes#90707 from jherrera123/fix-issue-88132
Make flexvolume e2e tests runnable again.
2 parents 9f76518 + aeb6544 commit c5be566

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

test/e2e/framework/skipper/skipper.go

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ import (
4242
e2essh "k8s.io/kubernetes/test/e2e/framework/ssh"
4343
)
4444

45-
// TestContext should be used by all tests to access common context data.
46-
var TestContext framework.TestContextType
47-
4845
// New local storage types to support local storage capacity isolation
4946
var localStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"
5047

@@ -154,29 +151,29 @@ func SkipIfMissingResource(dynamicClient dynamic.Interface, gvr schema.GroupVers
154151

155152
// SkipUnlessNodeCountIsAtLeast skips if the number of nodes is less than the minNodeCount.
156153
func SkipUnlessNodeCountIsAtLeast(minNodeCount int) {
157-
if TestContext.CloudConfig.NumNodes < minNodeCount {
158-
skipInternalf(1, "Requires at least %d nodes (not %d)", minNodeCount, TestContext.CloudConfig.NumNodes)
154+
if framework.TestContext.CloudConfig.NumNodes < minNodeCount {
155+
skipInternalf(1, "Requires at least %d nodes (not %d)", minNodeCount, framework.TestContext.CloudConfig.NumNodes)
159156
}
160157
}
161158

162159
// SkipUnlessNodeCountIsAtMost skips if the number of nodes is greater than the maxNodeCount.
163160
func SkipUnlessNodeCountIsAtMost(maxNodeCount int) {
164-
if TestContext.CloudConfig.NumNodes > maxNodeCount {
165-
skipInternalf(1, "Requires at most %d nodes (not %d)", maxNodeCount, TestContext.CloudConfig.NumNodes)
161+
if framework.TestContext.CloudConfig.NumNodes > maxNodeCount {
162+
skipInternalf(1, "Requires at most %d nodes (not %d)", maxNodeCount, framework.TestContext.CloudConfig.NumNodes)
166163
}
167164
}
168165

169166
// SkipIfProviderIs skips if the provider is included in the unsupportedProviders.
170167
func SkipIfProviderIs(unsupportedProviders ...string) {
171168
if framework.ProviderIs(unsupportedProviders...) {
172-
skipInternalf(1, "Not supported for providers %v (found %s)", unsupportedProviders, TestContext.Provider)
169+
skipInternalf(1, "Not supported for providers %v (found %s)", unsupportedProviders, framework.TestContext.Provider)
173170
}
174171
}
175172

176173
// SkipUnlessProviderIs skips if the provider is not included in the supportedProviders.
177174
func SkipUnlessProviderIs(supportedProviders ...string) {
178175
if !framework.ProviderIs(supportedProviders...) {
179-
skipInternalf(1, "Only supported for providers %v (not %s)", supportedProviders, TestContext.Provider)
176+
skipInternalf(1, "Only supported for providers %v (not %s)", supportedProviders, framework.TestContext.Provider)
180177
}
181178
}
182179

@@ -205,21 +202,21 @@ func SkipIfMultizone(c clientset.Interface) {
205202
// SkipUnlessMasterOSDistroIs skips if the master OS distro is not included in the supportedMasterOsDistros.
206203
func SkipUnlessMasterOSDistroIs(supportedMasterOsDistros ...string) {
207204
if !framework.MasterOSDistroIs(supportedMasterOsDistros...) {
208-
skipInternalf(1, "Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, TestContext.MasterOSDistro)
205+
skipInternalf(1, "Only supported for master OS distro %v (not %s)", supportedMasterOsDistros, framework.TestContext.MasterOSDistro)
209206
}
210207
}
211208

212209
// SkipUnlessNodeOSDistroIs skips if the node OS distro is not included in the supportedNodeOsDistros.
213210
func SkipUnlessNodeOSDistroIs(supportedNodeOsDistros ...string) {
214211
if !framework.NodeOSDistroIs(supportedNodeOsDistros...) {
215-
skipInternalf(1, "Only supported for node OS distro %v (not %s)", supportedNodeOsDistros, TestContext.NodeOSDistro)
212+
skipInternalf(1, "Only supported for node OS distro %v (not %s)", supportedNodeOsDistros, framework.TestContext.NodeOSDistro)
216213
}
217214
}
218215

219216
// SkipIfNodeOSDistroIs skips if the node OS distro is included in the unsupportedNodeOsDistros.
220217
func SkipIfNodeOSDistroIs(unsupportedNodeOsDistros ...string) {
221218
if framework.NodeOSDistroIs(unsupportedNodeOsDistros...) {
222-
skipInternalf(1, "Not supported for node OS distro %v (is %s)", unsupportedNodeOsDistros, TestContext.NodeOSDistro)
219+
skipInternalf(1, "Not supported for node OS distro %v (is %s)", unsupportedNodeOsDistros, framework.TestContext.NodeOSDistro)
223220
}
224221
}
225222

@@ -236,8 +233,8 @@ func SkipUnlessServerVersionGTE(v *utilversion.Version, c discovery.ServerVersio
236233

237234
// SkipUnlessSSHKeyPresent skips if no SSH key is found.
238235
func SkipUnlessSSHKeyPresent() {
239-
if _, err := e2essh.GetSigner(TestContext.Provider); err != nil {
240-
skipInternalf(1, "No SSH Key for provider %s: '%v'", TestContext.Provider, err)
236+
if _, err := e2essh.GetSigner(framework.TestContext.Provider); err != nil {
237+
skipInternalf(1, "No SSH Key for provider %s: '%v'", framework.TestContext.Provider, err)
241238
}
242239
}
243240

@@ -265,19 +262,19 @@ func SkipIfAppArmorNotSupported() {
265262
// RunIfContainerRuntimeIs runs if the container runtime is included in the runtimes.
266263
func RunIfContainerRuntimeIs(runtimes ...string) {
267264
for _, containerRuntime := range runtimes {
268-
if containerRuntime == TestContext.ContainerRuntime {
265+
if containerRuntime == framework.TestContext.ContainerRuntime {
269266
return
270267
}
271268
}
272-
skipInternalf(1, "Skipped because container runtime %q is not in %s", TestContext.ContainerRuntime, runtimes)
269+
skipInternalf(1, "Skipped because container runtime %q is not in %s", framework.TestContext.ContainerRuntime, runtimes)
273270
}
274271

275272
// RunIfSystemSpecNameIs runs if the system spec name is included in the names.
276273
func RunIfSystemSpecNameIs(names ...string) {
277274
for _, name := range names {
278-
if name == TestContext.SystemSpecName {
275+
if name == framework.TestContext.SystemSpecName {
279276
return
280277
}
281278
}
282-
skipInternalf(1, "Skipped because system spec name %q is not in %v", TestContext.SystemSpecName, names)
279+
skipInternalf(1, "Skipped because system spec name %q is not in %v", framework.TestContext.SystemSpecName, names)
283280
}

0 commit comments

Comments
 (0)