apigroupfilter: check whether the discovery client can actually talk to a server before bulding api group filter
@@ -163,6 +163,13 @@ func (opt *Options) Run(suite *TestSuite, junitSuiteName string) error {
} else {
return err
}
+ } else {
+ if _, err := discoveryClient.ServerVersion(); err != nil {
+ if opt.DryRun {
+ fmt.Fprintf(opt.ErrOut, "Unable to get server version through discovery client, skipping apigroup check in the dry-run mode: %v\n", err)
+ } else {
+ return err
+ }
} else {
apiGroupFilter, err := newApiGroupFilter(discoveryClient)
if err != nil {
@@ -174,6 +181,7 @@ func (opt *Options) Run(suite *TestSuite, junitSuiteName string) error {
// apigroups. Other installations might be serving only a subset of the api groups.
apiGroupFilter.markSkippedWhenAPIGroupNotServed(tests)
}
+ }
// This ensures that tests in the identified paths do not run in parallel, because
// the test suite reuses shared resources without considering whether another test
