Skip to content

Commit b3135b2

Browse files
wangke19openshift-cherrypick-robot
authored andcommitted
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 6ecd806 commit b3135b2

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
@@ -2337,6 +2337,16 @@ func IsMicroShiftCluster(kubeClient k8sclient.Interface) (bool, error) {
23372337
return true, nil
23382338
}
23392339

2340+
// IsRosaCluster returns "true" if a cluster is ROSA,
2341+
// "false" otherwise.
2342+
func IsRosaCluster(oc *CLI) (bool, error) {
2343+
product, err := oc.WithoutNamespace().AsAdmin().Run("get").Args("clusterclaims/product.open-cluster-management.io", "-o=jsonpath={.spec.value}").Output()
2344+
if err != nil {
2345+
return false, nil
2346+
}
2347+
return strings.Compare(product, "ROSA") == 0, nil
2348+
}
2349+
23402350
func IsTwoNodeFencing(ctx context.Context, configClient clientconfigv1.Interface) bool {
23412351
infrastructure, err := configClient.ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
23422352
if err != nil {

0 commit comments

Comments
 (0)