Skip to content

Commit 0edadb9

Browse files
committed
Skip featuregate detection on Microshift
1 parent 0744d0a commit 0edadb9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,6 @@ func determineEnvironmentFlags(ctx context.Context, upgrade bool, dryRun bool) (
789789
return nil, err
790790
}
791791

792-
featureGates, err := determineEnabledFeatureGates(ctx, clientConfig)
793-
if err != nil {
794-
return nil, errors.WithMessage(err, "couldn't determine feature gates")
795-
}
796-
envFlagBuilder.AddFeatureGates(featureGates...)
797-
798792
discoveryClient, err := kubeconfig.NewDiscoveryGetter(restConfig).GetDiscoveryClient()
799793
if err != nil {
800794
return nil, err
@@ -803,7 +797,15 @@ func determineEnvironmentFlags(ctx context.Context, upgrade bool, dryRun bool) (
803797
if err != nil {
804798
return nil, errors.WithMessage(err, "couldn't determine api groups")
805799
}
806-
envFlagBuilder.AddAPIGroups(apiGroups...)
800+
envFlagBuilder.AddAPIGroups(apiGroups.UnsortedList()...)
801+
802+
if apiGroups.Has("config.openshift.io") {
803+
featureGates, err := determineEnabledFeatureGates(ctx, clientConfig)
804+
if err != nil {
805+
return nil, errors.WithMessage(err, "couldn't determine feature gates")
806+
}
807+
envFlagBuilder.AddFeatureGates(featureGates...)
808+
}
807809

808810
//Additional flags can only be determined if we are able to obtain the clusterState
809811
if clusterState != nil {
@@ -862,7 +864,7 @@ func determineExternalConnectivity(clusterConfig *clusterdiscovery.ClusterConfig
862864
return "Direct"
863865
}
864866

865-
func determineEnabledAPIGroups(discoveryClient discovery.AggregatedDiscoveryInterface) ([]string, error) {
867+
func determineEnabledAPIGroups(discoveryClient discovery.AggregatedDiscoveryInterface) (sets.Set[string], error) {
866868
groups, err := discoveryClient.ServerGroups()
867869
if err != nil {
868870
return nil, fmt.Errorf("unable to retrieve served resources: %v", err)
@@ -876,7 +878,7 @@ func determineEnabledAPIGroups(discoveryClient discovery.AggregatedDiscoveryInte
876878
apiGroups.Insert(apiGroup.Name)
877879
}
878880

879-
return apiGroups.List(), nil
881+
return apiGroups, nil
880882
}
881883

882884
func determineEnabledFeatureGates(ctx context.Context, configClient clientconfigv1.Interface) ([]string, error) {

0 commit comments

Comments
 (0)