-
Notifications
You must be signed in to change notification settings - Fork 4.8k
MULTIARCH-5391: Add new featuregate test to check if desired.Architecture is set as intended #29808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 1 commit into
openshift:main
from
Prashanth684:4552-cvo-test
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| reviewers: | ||
| - cluster-version-operator-test-case-reviewers | ||
| - Prashanth684 | ||
| approvers: | ||
| - cluster-version-operator-test-case-approvers | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() { | ||
|
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()) | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
test/extended/util/annotate/generated/zz_generated.annotations.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 howtest/extendedis organized, but it seems like we should keep these CVO-functionality tests collected in the same directory?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
clusterversiondirectory than be specific to a test.