mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Skip test when depending on feature
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
@@ -46,7 +46,10 @@ import (
|
||||
// New local storage types to support local storage capacity isolation
|
||||
var localStorageCapacityIsolation featuregate.Feature = "LocalStorageCapacityIsolation"
|
||||
|
||||
var downwardAPIHugePages featuregate.Feature = "DownwardAPIHugePages"
|
||||
var (
|
||||
downwardAPIHugePages featuregate.Feature = "DownwardAPIHugePages"
|
||||
execProbeTimeout featuregate.Feature = "ExecProbeTimeout"
|
||||
)
|
||||
|
||||
func skipInternalf(caller int, format string, args ...interface{}) {
|
||||
msg := fmt.Sprintf(format, args...)
|
||||
@@ -145,6 +148,12 @@ func SkipUnlessDownwardAPIHugePagesEnabled() {
|
||||
}
|
||||
}
|
||||
|
||||
func SkipUnlessExecProbeTimeoutEnabled() {
|
||||
if !utilfeature.DefaultFeatureGate.Enabled(execProbeTimeout) {
|
||||
skipInternalf(1, "Only supported when %v feature is enabled", execProbeTimeout)
|
||||
}
|
||||
}
|
||||
|
||||
// SkipIfMissingResource skips if the gvr resource is missing.
|
||||
func SkipIfMissingResource(dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace string) {
|
||||
resourceClient := dynamicClient.Resource(gvr).Namespace(namespace)
|
||||
|
||||
Reference in New Issue
Block a user