Skip to content

Commit c6a6433

Browse files
Merge pull request #30779 from openshift-cherrypick-robot/cherry-pick-30585-to-release-4.21
[release-4.21] : OCPBUGS-76856:cert tests: mark TLS registry test as informing
2 parents 4d069e4 + b3135b2 commit c6a6433

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

test/extended/operators/certs.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626

2727
g "github.com/onsi/ginkgo/v2"
2828
o "github.com/onsi/gomega"
29+
ote "github.com/openshift-eng/openshift-tests-extension/pkg/ginkgo"
2930

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

@@ -175,7 +179,7 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
175179
o.Expect(err).NotTo(o.HaveOccurred())
176180
})
177181

178-
g.It("all tls artifacts must be registered", func() {
182+
g.It("all tls artifacts must be registered", ote.Informing(), func() {
179183
violationsPKIContent, err := certs.GetPKIInfoFromEmbeddedOwnership(ownership.PKIViolations)
180184
o.Expect(err).NotTo(o.HaveOccurred())
181185

@@ -276,23 +280,18 @@ var _ = g.Describe(fmt.Sprintf("[sig-arch][Late][Jira:%q]", "kube-apiserver"), g
276280
if len(newTLSRegistry.CertKeyPairs) > 0 || len(newTLSRegistry.CertificateAuthorityBundles) > 0 {
277281
registryString, err := json.MarshalIndent(newTLSRegistry, "", " ")
278282
if err != nil {
279-
// g.Fail("Failed to marshal registry %#v: %v", newTLSRegistry, err)
280283
testresult.Flakef("Failed to marshal registry %#v: %v", newTLSRegistry, err)
281284
}
282-
// TODO: uncomment when test no longer fails and enhancement is merged
283-
// g.Fail(fmt.Sprintf("Unregistered TLS certificates:\n%s", registryString))
284285
testresult.Flakef("Unregistered TLS certificates found:\n%s\nSee tls/ownership/README.md in origin repo", registryString)
285286
}
286287
})
287288

288-
g.It("all registered tls artifacts must have no metadata violation regressions", func() {
289+
g.It("all registered tls artifacts must have no metadata violation regressions", ote.Informing(), func() {
289290
violationRegressionOptions := ensure_no_violation_regression.NewEnsureNoViolationRegressionOptions(ownership.AllViolations, genericclioptions.NewTestIOStreamsDiscard())
290291
messages, _, err := violationRegressionOptions.HaveViolationsRegressed([]*certgraphapi.PKIList{actualPKIContent})
291292
o.Expect(err).NotTo(o.HaveOccurred())
292293

293294
if len(messages) > 0 {
294-
// TODO: uncomment when test no longer fails and enhancement is merged
295-
// g.Fail(strings.Join(messages, "\n"))
296295
testresult.Flakef("%s", strings.Join(messages, "\n"))
297296
}
298297
})

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)