Skip to content
Merged
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
5 changes: 5 additions & 0 deletions test/extended/clusterversion/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
reviewers:
- cluster-version-operator-test-case-reviewers
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our existing consumer for this alias is in test/extended/util/openshift/clusterversionoperator. I'm not all that clear on how test/extended is organized, but it seems like we should keep these CVO-functionality tests collected in the same directory?

Copy link
Copy Markdown
Contributor Author

@Prashanth684 Prashanth684 May 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that file seems to be the utils file whereas this is where the test is actually defined, listing cvo folks as owners. The implementation here is similar, defining a new directory for this test case - but having it as a more generic clusterversion directory than be specific to a test.

- Prashanth684
approvers:
- cluster-version-operator-test-case-approvers
43 changes: 43 additions & 0 deletions test/extended/clusterversion/clusterversion.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package clusterversion

import (
"context"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
configv1 "github.com/openshift/api/config/v1"
configclient "github.com/openshift/client-go/config/clientset/versioned"
exutil "github.com/openshift/origin/test/extended/util"
)

// The desired architecture field was introduced as part of a feature that provides a toggle for an imagestream's importMode: https://github.com/openshift/api/pull/2024
var _ = g.Describe("[sig-cluster-lifecycle][OCPFeatureGate:ImageStreamImportMode] ClusterVersion API", func() {
Comment thread
Prashanth684 marked this conversation as resolved.
defer g.GinkgoRecover()
oc := exutil.NewCLIWithoutNamespace("")

g.It("desired architecture should be valid when architecture is set in release payload metadata [apigroup:config.openshift.io]", func() {
TestClusterVersionDesiredArchitecture(g.GinkgoT(), oc)
})

})

func TestClusterVersionDesiredArchitecture(t g.GinkgoTInterface, oc *exutil.CLI) {
ctx := context.Background()

archMetadata, _, err := oc.AsAdmin().Run("adm", "release", "info", `-ojsonpath={.metadata.metadata.release\.openshift\.io\/architecture}`).Outputs()
o.Expect(err).NotTo(o.HaveOccurred())

// Check desired.Architecture in the CV
configClient, err := configclient.NewForConfig(oc.AdminConfig())
o.Expect(err).NotTo(o.HaveOccurred())
clusterVersion, err := configClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())

if archMetadata == "multi" {
o.Expect(clusterVersion.Status.Desired.Architecture).To(o.Equal(configv1.ClusterVersionArchitectureMulti))
} else {
o.Expect(clusterVersion.Status.Desired.Architecture).To(o.BeEmpty())
}
}
1 change: 1 addition & 0 deletions test/extended/include.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
_ "github.com/openshift/origin/test/extended/cli"
_ "github.com/openshift/origin/test/extended/cloud_controller_manager"
_ "github.com/openshift/origin/test/extended/cluster"
_ "github.com/openshift/origin/test/extended/clusterversion"
_ "github.com/openshift/origin/test/extended/cmd"
_ "github.com/openshift/origin/test/extended/controller_manager"
_ "github.com/openshift/origin/test/extended/coreos"
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions zz_generated.manifests/test-reporting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ spec:
mock driver Static provisioning should honor pv retain reclaim policy'
- featureGate: ImageStreamImportMode
tests:
- testName: '[sig-cluster-lifecycle][OCPFeatureGate:ImageStreamImportMode] ClusterVersion
API desired architecture should be valid when architecture is set in release
payload metadata [apigroup:config.openshift.io]'
- testName: '[sig-imageregistry][OCPFeatureGate:ImageStreamImportMode][Serial]
ImageStream API import mode should be Legacy if the import mode specified
in image.config.openshift.io config is Legacy [apigroup:image.openshift.io]'
Expand Down