Skip to content

Commit b5159c9

Browse files
committed
cert tests: skip TLS certificate tests on ROSA clusters
Add IsRosaCluster() function to test/extended/util/framework.go and use it to skip TLS certificate tests on ROSA clusters, similar to how we skip for MicroShift and Hypershift. ROSA clusters do not auto-collect TLS certificates the same way as standard OpenShift clusters.
1 parent 158fe32 commit b5159c9

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

test/extended/operators/certs.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
105105
if ok, _ := exutil.IsHypershift(ctx, configClient); ok {
106106
g.Skip("hypershift does not auto-collect TLS.")
107107
}
108+
if ok, _ := exutil.IsRosaCluster(oc); ok {
109+
g.Skip("ROSA does not auto-collect TLS.")
110+
}
108111
var err error
109112
onDiskPKIContent := &certgraphapi.PKIList{}
110113

test/extended/util/framework.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,16 @@ func IsMicroShiftCluster(kubeClient k8sclient.Interface) (bool, error) {
23282328
return true, nil
23292329
}
23302330

2331+
// IsRosaCluster returns "true" if a cluster is ROSA,
2332+
// "false" otherwise.
2333+
func IsRosaCluster(oc *CLI) (bool, error) {
2334+
product, err := oc.WithoutNamespace().AsAdmin().Run("get").Args("clusterclaims/product.open-cluster-management.io", "-o=jsonpath={.spec.value}").Output()
2335+
if err != nil {
2336+
return false, nil
2337+
}
2338+
return strings.Compare(product, "ROSA") == 0, nil
2339+
}
2340+
23312341
func IsTwoNodeFencing(ctx context.Context, configClient clientconfigv1.Interface) bool {
23322342
infrastructure, err := configClient.ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
23332343
if err != nil {

0 commit comments

Comments
 (0)