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-11817: e2e: control and data planes clients #1004

Merged
merged 3 commits into from
May 16, 2024

Conversation

Tal-or
Copy link
Contributor

@Tal-or Tal-or commented Mar 25, 2024

On Hypershift we should be able to access both the management and hosted clusters.
For that, we should now have two clients, each communicates with a different cluster.

ControlPlaneClient - defines the API client to run CRUD operations on the control plane that will be used for testing.

DataPlaneClient - defines the API client to run CRUD operations on the data plane that will be used for testing.

On non-hypershift both client would point the same the cluster under the hood.

We also added Ginkgo assertions that prevent the user from using the wrong clients for the wrong objects.
For example using the DataPlaneClient for querying the PerformanceProfile object is completley fine on non-hypershift cluster, but will fail badly on hypershift (since PerformanceProfile objects, are not presented on the hosted clusters.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 25, 2024

@Tal-or: This pull request references CNF-11817 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.16.0" version, but no target version was set.

In response to this:

On Hypershift we should be able to access both the management and hosted clusters.
For that, we should now have two clients, each communicates with a different cluster.

ControlPlaneClient - defines the API client to run CRUD operations on the control plane that will be used for testing.

DataPlaneClient - defines the API client to run CRUD operations on the data plane that will be used for testing.

On non-hypershift both client would point the same the cluster under the hood.

We also added Ginkgo assertions that prevent the user from using the wrong clients for the wrong objects.
For example using the DataPlaneClient for querying the PerformanceProfile object is completley fine on non-hypershift cluster, but will fail badly on hypershift (since PerformanceProfile objects, are not presented on the hosted clusters.

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 25, 2024
@openshift-ci openshift-ci bot requested review from ffromani and MarSik March 25, 2024 14:06
@Tal-or
Copy link
Contributor Author

Tal-or commented Mar 25, 2024

/test e2e-gcp-pao

Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

initial review, so far so good

@Tal-or Tal-or force-pushed the hypershift_client branch from d566809 to 0dafc42 Compare April 1, 2024 06:35
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2024
@Tal-or Tal-or force-pushed the hypershift_client branch 2 times, most recently from 236f141 to 99f2f66 Compare April 1, 2024 06:49
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2024
@Tal-or Tal-or force-pushed the hypershift_client branch 4 times, most recently from be6cd25 to 77a146b Compare April 9, 2024 16:54
@Tal-or
Copy link
Contributor Author

Tal-or commented Apr 11, 2024

/retest

1 similar comment
@Tal-or
Copy link
Contributor Author

Tal-or commented Apr 11, 2024

/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 Apr 13, 2024
@Tal-or Tal-or force-pushed the hypershift_client branch from 77a146b to f238a4d Compare April 14, 2024 06:43
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2024
@Tal-or Tal-or force-pushed the hypershift_client branch from f238a4d to 0ec07de Compare April 14, 2024 07:16
On hypershift, there is a full separation between the control and data plane.
This means there's a separate client for each.

This commit implements the control plane client.
In order to preserve compatibility between HCP and OCP,
the client encodes/decodes the objects in/from a `ConfigMap` automatically.

This allows the user to perform similar CRUD operations without having the need
to distinguish between HCP and OCP platforms.

Signed-off-by: Talor Itzhak <[email protected]>
@Tal-or Tal-or force-pushed the hypershift_client branch from 0ec07de to 687af4f Compare May 15, 2024 13:30
Tal-or added 2 commits May 15, 2024 16:36
On Hypershift we should be able to access both the management and hosted clusters.
For that, we should now have two clients, each communicates with a different cluster.

ControlPlaneClient - defines the API client to run CRUD operations on the control plane that will be used for testing.

DataPlaneClient - defines the API client to run CRUD operations on the data plane that will be used for testing.

On non-hypershift both client would point to the same the cluster.

Also added Ginkgo assertions that prevent the user from using the `DataPlaneClient` client for the wrong object.
For example using the `DataPlaneClient` for querying the `PerformanceProfile` object
is completley fine on non-hypershift cluster, but will fail badly on hypershift (since `PerformanceProfile`
objects, are not presented on the hosted clusters.

Signed-off-by: Talor Itzhak <[email protected]>
Added functions for building the clients for hypershift while running on CI environment

Signed-off-by: Talor Itzhak <[email protected]>
Copy link
Contributor

openshift-ci bot commented May 15, 2024

@Tal-or: all tests passed!

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.

Copy link
Contributor

@MarSik MarSik left a comment

Choose a reason for hiding this comment

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

The initial unused implementation looks good to me.

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

openshift-ci bot commented May 16, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MarSik, Tal-or

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 May 16, 2024
@yanirq
Copy link
Contributor

yanirq commented May 16, 2024

/label acknowledge-critical-fixes-only

This is required infrastructure preparation to be included in 4.16 . currently not wired to existing functionality

@openshift-ci openshift-ci bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label May 16, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit f37f16f into openshift:master May 16, 2024
16 checks passed
@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build cluster-node-tuning-operator-container-v4.17.0-202405161113.p0.gf37f16f.assembly.stream.el9 for distgit cluster-node-tuning-operator.
All builds following this will include this PR.

@Tal-or Tal-or deleted the hypershift_client branch May 16, 2024 13:47
Copy link
Contributor

@ffromani ffromani left a comment

Choose a reason for hiding this comment

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

overall LGTM as well

return err
}
var objAsYAML string
// can't have both
Copy link
Contributor

Choose a reason for hiding this comment

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

but we don't check this, and also we don't check we have either.
Well, the decoder does implicitely I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a room for improvement indeed. I'll add it in a follow PR. Anyhow this code is not wired yet

Copy link
Contributor

Choose a reason for hiding this comment

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

sure, no big deal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. 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