Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions test/extended/operators/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"

"github.com/openshift/library-go/pkg/certs/cert-inspection/certgraphanalysis"
"github.com/openshift/library-go/pkg/certs/cert-inspection/certgraphapi"
Expand Down Expand Up @@ -104,6 +105,9 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
if ok, _ := exutil.IsHypershift(ctx, configClient); ok {
g.Skip("hypershift does not auto-collect TLS.")
}
if ok, _ := exutil.IsRosaCluster(oc); ok {
g.Skip("ROSA does not auto-collect TLS.")
}
var err error
onDiskPKIContent := &certgraphapi.PKIList{}

Expand Down Expand Up @@ -166,7 +170,7 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
o.Expect(err).NotTo(o.HaveOccurred())
})

g.It("all tls artifacts must be registered", func() {
g.It("all tls artifacts must be registered", ote.Informing(), func() {

violationsPKIContent, err := certs.GetPKIInfoFromEmbeddedOwnership(ownership.PKIViolations)
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down Expand Up @@ -278,7 +282,7 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
}
})

g.It("all registered tls artifacts must have no metadata violation regressions", func() {
g.It("all registered tls artifacts must have no metadata violation regressions", ote.Informing(), func() {
violationRegressionOptions := ensure_no_violation_regression.NewEnsureNoViolationRegressionOptions(ownership.AllViolations, genericclioptions.NewTestIOStreamsDiscard())
messages, _, err := violationRegressionOptions.HaveViolationsRegressed([]*certgraphapi.PKIList{actualPKIContent})
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down
10 changes: 10 additions & 0 deletions test/extended/util/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -2328,6 +2328,16 @@ func IsMicroShiftCluster(kubeClient k8sclient.Interface) (bool, error) {
return true, nil
}

// IsRosaCluster returns "true" if a cluster is ROSA,
// "false" otherwise.
func IsRosaCluster(oc *CLI) (bool, error) {
product, err := oc.WithoutNamespace().AsAdmin().Run("get").Args("clusterclaims/product.open-cluster-management.io", "-o=jsonpath={.spec.value}").Output()
if err != nil {
return false, nil
}
return strings.Compare(product, "ROSA") == 0, nil
}

func IsTwoNodeFencing(ctx context.Context, configClient clientconfigv1.Interface) bool {
infrastructure, err := configClient.ConfigV1().Infrastructures().Get(ctx, "cluster", metav1.GetOptions{})
if err != nil {
Expand Down