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

Add apiserver-proxy for KubeVirt UI Plugin #2401

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

orenc1
Copy link
Collaborator

@orenc1 orenc1 commented Jun 25, 2023

An apiserver proxy pod is being introduced to improve API queries performance for virtual machines resources done by the UI client.

VirtualMachines table is getting data from the apiserver proxy:

image

What this PR does / why we need it:

Reviewer Checklist

Reviewers are supposed to review the PR for every aspect below one by one. To check an item means the PR is either "OK" or "Not Applicable" in terms of that item. All items are supposed to be checked before merging a PR.

  • PR Message
  • Commit Messages
  • How to test
  • Unit Tests
  • Functional Tests
  • User Documentation
  • Developer Documentation
  • Upgrade Scenario
  • Uninstallation Scenario
  • Backward Compatibility
  • Troubleshooting Friendly

Jira Ticket:

https://issues.redhat.com/browse/CNV-30060

Release note:

Add apiserver-proxy for KubeVirt UI Plugin

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jun 25, 2023
@kubevirt-bot kubevirt-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L labels Jun 25, 2023
@orenc1 orenc1 changed the title Add apiserver-proxy for KubeVirt UI Plugin [WIP] Add apiserver-proxy for KubeVirt UI Plugin Jun 25, 2023
@kubevirt-bot kubevirt-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 25, 2023
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2023
@hco-bot
Copy link
Collaborator

hco-bot commented Jun 25, 2023

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-sno-azure

In response to this:

hco-e2e-operator-sdk-sno-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-sno-azure

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 25, 2023

hco-e2e-operator-sdk-gcp, hco-e2e-operator-sdk-aws lanes succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-azure

In response to this:

hco-e2e-operator-sdk-gcp, hco-e2e-operator-sdk-aws lanes succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 25, 2023

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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/test-infra repository.

@coveralls
Copy link
Collaborator

coveralls commented Jun 26, 2023

Pull Request Test Coverage Report for Build 5402102077

  • 99 of 101 (98.02%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 86.092%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/util/cluster.go 0 2 0.0%
Totals Coverage Status
Change from base Build 5399009068: 0.2%
Covered Lines: 5008
Relevant Lines: 5817

💛 - Coveralls

@orenc1 orenc1 changed the title [WIP] Add apiserver-proxy for KubeVirt UI Plugin Add apiserver-proxy for KubeVirt UI Plugin Jun 26, 2023
@kubevirt-bot kubevirt-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2023
@hco-bot
Copy link
Collaborator

hco-bot commented Jun 26, 2023

okd-hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-operator-sdk-aws

In response to this:

okd-hco-e2e-operator-sdk-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-aws

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 26, 2023

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-operator-sdk-gcp

In response to this:

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 26, 2023

hco-e2e-operator-sdk-azure lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-gcp
hco-e2e-operator-sdk-azure lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-aws
okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-aws, ci/prow/hco-e2e-operator-sdk-gcp, ci/prow/okd-hco-e2e-operator-sdk-gcp

In response to this:

hco-e2e-operator-sdk-azure lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-gcp
hco-e2e-operator-sdk-azure lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-aws
okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 27, 2023

hco-e2e-upgrade-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-azure

In response to this:

hco-e2e-upgrade-index-sno-aws lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-azure

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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/test-infra repository.

Copy link
Collaborator

@nunnatsa nunnatsa left a comment

Choose a reason for hiding this comment

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

Overall looks good.

My main comment is about the DescribeTable tests, where the code keep asking about thing it can get from the outside - this is the whole idea of the parameterized tests. To make it easier, let's get rid of the error return values from some creation functions, that will never return an error.

kvUIProxyServingCertPath, hcoutil.UIProxyServerPort, hcoutil.AppComponentUIProxy)
}

func getKvUIDeployment(hc *hcov1beta1.HyperConverged, deploymentName string, image string,
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function never returns error. can we get rid of the error return value?

@@ -57,14 +71,53 @@ func newKvUIPluginCRHandler(_ log.Logger, Client client.Client, Scheme *runtime.
return []Operand{newConsolePluginHandler(Client, Scheme, kvUIConsolePluginCR)}, nil
}

func NewKvUIPluginDeplymnt(hc *hcov1beta1.HyperConverged) (*appsv1.Deployment, error) {
func NewKvUIPluginDeployment(hc *hcov1beta1.HyperConverged) (*appsv1.Deployment, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This function never returns error. can we get rid of the error return value?

controllers/operands/kubevirtConsolePlugin.go Show resolved Hide resolved
controllers/operands/kubevirtConsolePlugin.go Show resolved Hide resolved
Comment on lines 208 to 215
var err error
switch appComponent {
case hcoutil.AppComponentUIPlugin:
expectedResource, err = NewKvUIPluginDeployment(hco)
case hcoutil.AppComponentUIProxy:
expectedResource, err = NewKvUIProxyDeployment(hco)
}
Expect(err).ToNot(HaveOccurred())
Copy link
Collaborator

@nunnatsa nunnatsa Jun 28, 2023

Choose a reason for hiding this comment

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

Please consider to pass the deployment as a parameter. This will be possible if we'll get rid of all the return values above. The result will be cleaner code, without code branches.

Comment on lines 476 to 501
handler, err := newKvUIPluginDeploymentHandler(logger, cl, commontestutils.GetScheme(), hco)
var handler []Operand
switch appComponent {
case hcoutil.AppComponentUIPlugin:
handler, err = newKvUIPluginDeploymentHandler(logger, cl, commontestutils.GetScheme(), hco)
case hcoutil.AppComponentUIProxy:
handler, err = newKvUIProxyDeploymentHandler(logger, cl, commontestutils.GetScheme(), hco)
}
Expect(err).ToNot(HaveOccurred())
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Comment on lines 645 to 652
switch appComponent {
case hcoutil.AppComponentUIPlugin:
expectedResource = NewKvUIPluginSvc(hco)
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIPluginSvc))
case hcoutil.AppComponentUIProxy:
expectedResource = NewKvUIProxySvc(hco)
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIProxySvc))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Comment on lines 676 to 684
switch appComponent {
case hcoutil.AppComponentUIPlugin:
expectedResource = NewKvUIPluginSvc(hco)
cl = commontestutils.InitClient([]client.Object{hco, expectedResource})
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIPluginSvc))
case hcoutil.AppComponentUIProxy:
expectedResource = NewKvUIProxySvc(hco)
cl = commontestutils.InitClient([]client.Object{hco, expectedResource})
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIProxySvc))
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Comment on lines 712 to 718
switch appComponent {
case hcoutil.AppComponentUIPlugin:
expectedResource = NewKvUIPluginSvc(hco)
outdatedResource = NewKvUIPluginSvc(hco)
case hcoutil.AppComponentUIProxy:
expectedResource = NewKvUIProxySvc(hco)
outdatedResource = NewKvUIProxySvc(hco)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Comment on lines 726 to 733
switch appComponent {
case hcoutil.AppComponentUIPlugin:
expectedResource = NewKvUIPluginSvc(hco)
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIPluginSvc))
case hcoutil.AppComponentUIProxy:
expectedResource = NewKvUIProxySvc(hco)
handler = (*genericOperand)(newServiceHandler(cl, commontestutils.GetScheme(), NewKvUIProxySvc))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same

Signed-off-by: Oren Cohen <ocohen@redhat.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 28, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp
hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-operator-sdk-azure, ci/prow/okd-hco-e2e-operator-sdk-gcp

In response to this:

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp
hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/hco-e2e-operator-sdk-azure

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp
okd-hco-e2e-upgrade-index-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/okd-hco-e2e-operator-sdk-gcp, ci/prow/okd-hco-e2e-upgrade-index-aws

In response to this:

okd-hco-e2e-operator-sdk-aws lane succeeded.
/override ci/prow/okd-hco-e2e-operator-sdk-gcp
okd-hco-e2e-upgrade-index-gcp lane succeeded.
/override ci/prow/okd-hco-e2e-upgrade-index-aws

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-sno-aws, ci/prow/hco-e2e-upgrade-prev-index-sno-aws

In response to this:

hco-e2e-upgrade-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-sno-aws
hco-e2e-upgrade-prev-index-sno-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-prev-index-sno-aws

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/test-infra repository.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-upgrade-index-aws

In response to this:

hco-e2e-upgrade-index-azure lane succeeded.
/override ci/prow/hco-e2e-upgrade-index-aws

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/test-infra repository.

@openshift-ci
Copy link

openshift-ci bot commented Jun 28, 2023

@orenc1: The following tests 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/hco-e2e-upgrade-index-sno-aws 3bea4ef link false /test hco-e2e-upgrade-index-sno-aws
ci/prow/okd-hco-e2e-upgrade-index-aws 3bea4ef link true /test okd-hco-e2e-upgrade-index-aws
ci/prow/okd-hco-e2e-operator-sdk-gcp 3bea4ef link true /test okd-hco-e2e-operator-sdk-gcp
ci/prow/hco-e2e-upgrade-prev-index-sno-aws 3bea4ef link false /test hco-e2e-upgrade-prev-index-sno-aws
ci/prow/hco-e2e-upgrade-index-aws 3bea4ef link true /test hco-e2e-upgrade-index-aws
ci/prow/hco-e2e-kv-smoke-azure 3bea4ef link true /test hco-e2e-kv-smoke-azure

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/test-infra repository. I understand the commands that are listed here.

@hco-bot
Copy link
Collaborator

hco-bot commented Jun 28, 2023

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

@kubevirt-bot
Copy link
Contributor

@hco-bot: Overrode contexts on behalf of hco-bot: ci/prow/hco-e2e-kv-smoke-azure

In response to this:

hco-e2e-kv-smoke-gcp lane succeeded.
/override ci/prow/hco-e2e-kv-smoke-azure

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/test-infra repository.

@nunnatsa
Copy link
Collaborator

/lgtm
/approve
/retest

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 29, 2023
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nunnatsa

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2023
@nunnatsa
Copy link
Collaborator

/retest

@kubevirt-bot kubevirt-bot merged commit 7215665 into kubevirt:main Jun 29, 2023
3 checks passed
@orenc1 orenc1 deleted the ui_proxy_pod branch June 29, 2023 07:20
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants