Skip to content

Commit 9dfe779

Browse files
committed
Skip featuregate detection on Microshift
1 parent 0744d0a commit 9dfe779

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 12 additions & 10 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,12 +864,12 @@ 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)
869871
}
870-
apiGroups := sets.NewString()
872+
apiGroups := sets.New[string]()
871873
for _, apiGroup := range groups.Groups {
872874
// ignore the empty group
873875
if apiGroup.Name == "" {
@@ -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)