Skip to content
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

CNF-16063: E2E: Add hypershift support to container runtime config tests #1229

Merged

Conversation

SargunNarula
Copy link
Contributor

@SargunNarula SargunNarula commented Nov 27, 2024

The container runtime configuration test was omitted during the HyperShift adjustments, as it was initially deemed unsuitable for HyperShift. This change introduces support for it.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 27, 2024
Copy link
Contributor

openshift-ci bot commented Nov 27, 2024

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@SargunNarula SargunNarula marked this pull request as ready for review November 27, 2024 19:51
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 27, 2024
@openshift-ci openshift-ci bot requested review from MarSik and yanirq November 27, 2024 19:52
@SargunNarula SargunNarula force-pushed the hypershift_update_tests branch from 2174fae to d60c1fe Compare November 27, 2024 20:01
@SargunNarula
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 3, 2024
@SargunNarula SargunNarula force-pushed the hypershift_update_tests branch from d60c1fe to 5d7fe67 Compare December 4, 2024 09:59
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2024
Copy link
Contributor

@rbaturov rbaturov left a comment

Choose a reason for hiding this comment

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

Thank you for this work Sargun!
I realize that my removal of the container runtime type in this switch case has impacted the e2e, and it resulted with creating manually configmaps for ctrcfg.
Since we are no longer want to interact with ctrcfg from the controller perspective my deletion was correct. However, since we use the func GetObjectConfigMapDataKey for testing purposes aswell we might want to retain that line.
@Tal-or WDYT?

@rbaturov
Copy link
Contributor

rbaturov commented Dec 4, 2024

/test e2e-pao-updating-profile-hypershift

Let's not forget to test the work here

@rbaturov
Copy link
Contributor

rbaturov commented Dec 4, 2024

/retest-required

The e2e-gcp-pao-updating-profile has reached the 5h timeout, we should consider to extend the time.

@SargunNarula SargunNarula force-pushed the hypershift_update_tests branch from 5d7fe67 to 8fc68f5 Compare December 6, 2024 13:26
@SargunNarula
Copy link
Contributor Author

/test e2e-pao-updating-profile-hypershift

@SargunNarula
Copy link
Contributor Author

/retest

@SargunNarula SargunNarula force-pushed the hypershift_update_tests branch from 8fc68f5 to 9e7da4d Compare December 10, 2024 11:35
@SargunNarula
Copy link
Contributor Author

/test e2e-pao-updating-profile-hypershift

@SargunNarula
Copy link
Contributor Author

/retest

@@ -442,7 +444,7 @@ var _ = Describe("[rfe_id:28761][performance] Updating parameters in performance

By("Creating new MachineConfigPool")
mcp = mcps.New(newRole, newNodeSelector)
err = testclient.ControlPlaneClient.Create(context.TODO(), mcp)
err = testclient.Client.Create(context.TODO(), mcp)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not use bare Client anymore. Is there a reason for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the context of "Updating the nodeSelector parameter and node labels," there are still several instances using Client. Previously, I updated some occurrences with the appropriate client, but @rbaturov advised that we should handle the cleanup in a separate PR, as this PR is focused specifically on containerRuntimeConfig tests.

ctrcfg, err = getContainerRuntimeConfigFrom(context.TODO(), profile, mcp)
Expect(err).ToNot(HaveOccurred(), "failed to get ContainerRuntimeConfig from profile %q mcp %q", profile.Name, mcp.Name)
if ctrcfg != nil {
Skip(fmt.Sprintf("ContainerRuntimeConfig %s exist in the cluster and not expected", ctrcfg.Name))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these checks are needed?
The tests are suppose to be running under our CI, and noone but the test is suppose to pollute the cluster state and create undesired ContainerRuntimeConfig object.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Tal-or Well this check was from the original test before even my refactor.
If we plan to use this e2e solely on CI and therefore no ctrcfg is expected, then I guess it is safe to remove this.
However, if this test is somehow executed on a cluster with container runtime config it might run into trouble since it is not designed to start this way. I would not remove this check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Our tests are intended to run on clean, persisted and consistent environment.
As I suggested to @SargunNarula we should not skip but log with error because having unexpected objects on the cluster, might hide even a bigger problem.

Copy link
Contributor

@rbaturov rbaturov Dec 17, 2024

Choose a reason for hiding this comment

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

Logging an error and running this test could potentially fail or not test the desired functionality. IOW, this test is incorrect if it runs on a system with ctrcfg pre-installed.
I think the best way to go forward here to ensure we do not have "unexpected objects on the cluster, might hide even a bigger problem." is to fail the test right away if a ctrcfg is found with a proper message

By(fmt.Sprintf("creating ContainerRuntimeConfig %q", ctrcfg.Name))
Expect(testclient.Client.Create(context.TODO(), ctrcfg)).ToNot(HaveOccurred(), "failed to create ctrcfg %#v", ctrcfg)
if hypershift.IsHypershiftCluster() {
ctrcfg_configmap, err = containerRuntimeConfigConfigMap(ContainerRuntimeConfigName, profile, mcp)
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need that.
You're already get the for free by in the Client.Create call

func (ci *ControlPlaneClientImpl) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error {

Copy link
Contributor

Choose a reason for hiding this comment

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

Well he now actually needs since I removed that support.
@Tal-or take a look at this comment.

@Tal-or
Copy link
Contributor

Tal-or commented Dec 17, 2024

Thank you for this work Sargun! I realize that my removal of the container runtime type in this switch case has impacted the e2e, and it resulted with creating manually configmaps for ctrcfg. Since we are no longer want to interact with ctrcfg from the controller perspective my deletion was correct. However, since we use the func GetObjectConfigMapDataKey for testing purposes aswell we might want to retain that line. @Tal-or WDYT?

If we're still testing the affect of ContainerRuntimeConfig on the controller, we should revert this change

@rbaturov
Copy link
Contributor

Thank you for this work Sargun! I realize that my removal of the container runtime type in this switch case has impacted the e2e, and it resulted with creating manually configmaps for ctrcfg. Since we are no longer want to interact with ctrcfg from the controller perspective my deletion was correct. However, since we use the func GetObjectConfigMapDataKey for testing purposes aswell we might want to retain that line. @Tal-or WDYT?

If we're still testing the affect of ContainerRuntimeConfig on the controller, we should revert this change

Let's do that. @SargunNarula just add this line that I removed back again

@SargunNarula
Copy link
Contributor Author

Thank you for this work Sargun! I realize that my removal of the container runtime type in this switch case has impacted the e2e, and it resulted with creating manually configmaps for ctrcfg. Since we are no longer want to interact with ctrcfg from the controller perspective my deletion was correct. However, since we use the func GetObjectConfigMapDataKey for testing purposes aswell we might want to retain that line. @Tal-or WDYT?

If we're still testing the affect of ContainerRuntimeConfig on the controller, we should revert this change

Let's do that. @SargunNarula just add this line that I removed back again

Alright, I will include that revert change in this PR itself.

Signed-off-by: Sargun Narula <[email protected]>

Revert: ContainerRuntimeConfig handling for test purposes

This reverts the removal of ContainerRuntimeConfig handling in the switch case, which inadvertently impacted e2e tests.
While the deletion was correct from the controller's perspective (as we no longer had to interact with ContainerRuntimeConfig),
the function `GetObjectConfigMapDataKey` is still used for testing purposes. To ensure e2e tests function correctly and
to continue testing the effects of ContainerRuntimeConfig, this change is being reverted.

Signed-off-by: Sargun Narula <[email protected]>
@SargunNarula SargunNarula force-pushed the hypershift_update_tests branch from 9e7da4d to 961e5b8 Compare December 17, 2024 14:10
@rbaturov
Copy link
Contributor

/test e2e-pao-updating-profile-hypershift

Lets not forget this test
It is not automatically triggered

@SargunNarula
Copy link
Contributor Author

/retest

@rbaturov
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 18, 2024
Copy link
Contributor

openshift-ci bot commented Dec 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MarSik, SargunNarula

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 18, 2024
@SargunNarula SargunNarula changed the title E2E: Add hypershift support to container runtime config tests CNF-16063: E2E: Add hypershift support to container runtime config tests Dec 18, 2024
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 18, 2024
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Dec 18, 2024

@SargunNarula: This pull request references CNF-16063 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.19.0" version, but no target version was set.

In response to this:

The container runtime configuration test was omitted during the HyperShift adjustments, as it was initially deemed unsuitable for HyperShift. This change introduces support for it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@SargunNarula
Copy link
Contributor Author

/refresh

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD c0171d3 and 2 for PR HEAD 961e5b8 in total

Copy link
Contributor

openshift-ci bot commented Dec 18, 2024

@SargunNarula: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 961e5b8 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 48153be and 1 for PR HEAD 961e5b8 in total

@openshift-merge-bot openshift-merge-bot bot merged commit 61c94c4 into openshift:master Dec 19, 2024
17 of 18 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: cluster-node-tuning-operator
This PR has been included in build cluster-node-tuning-operator-container-v4.19.0-202412191309.p0.g61c94c4.assembly.stream.el9.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants