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

[release-v0.17] fix: console proxy and tests: Stabilize functional tests #530

Merged

Conversation

akrejcir
Copy link
Collaborator

This is a backport of: #527

What this PR does / why we need it:
This PR contains 2 changes to make functional tests less flaky:

Functions RevertToOriginalSspCr() now wait until SSP is deployed before returning.
This is useful, because reverting SSP may change TLS policy, which causes the pod to crash, and it may be some time before it is running again. If in the meantime, another test tries to update the SSP, it will fail, because the webhook cannot be reached.

When the annotation ssp.kubevirt.io/vm-console-proxy-enabled is removed from SSP CR, the operator waits for resources to be removed before setting the status.phase to Deployed.

Release note:

None

Functions RevertToOriginalSspCr() now wait until SSP
is deployed before returning.

This is useful, because reverting SSP may change TLS
policy, which causes the pod to crash, and it may
be some time before it is running again.
If in the meantime, another test tries to update the SSP,
it will fail, because the webhook cannot be reached.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
When the annotation "ssp.kubevirt.io/vm-console-proxy-enabled"
is removed from SSP, the operator removes resources for
vm-console-proxy, but previously it did not wait until they were removed.

With this chnange, the SSP will not be in "Deployed" state
until the resources are removed.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
It may take a moment until the vm-console-proxy is reachable
using the Route. This commit wraps the request in an Eventually() loop.

Signed-off-by: Andrej Krejcir <akrejcir@redhat.com>
@kubevirt-bot kubevirt-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 27, 2023
@akrejcir
Copy link
Collaborator Author

/cc @ksimon1 @0xFelix

@akrejcir
Copy link
Collaborator Author

CI will not run until this is merged: openshift/release#36425

@sonarcloud
Copy link

sonarcloud bot commented Mar 27, 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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 28, 2023
@lyarwood
Copy link
Member

/approve

@lyarwood
Copy link
Member

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2023
@akrejcir
Copy link
Collaborator Author

The CI has passed.
/hold cancel

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 29, 2023
@akrejcir
Copy link
Collaborator Author

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akrejcir, lyarwood

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 Mar 29, 2023
@kubevirt-bot kubevirt-bot merged commit 238a5b8 into kubevirt:release-v0.17 Mar 29, 2023
@akrejcir akrejcir deleted the test-wait-after-revert-v0.17 branch March 29, 2023 13:18
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-none Denotes a PR that doesn't merit a release note. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants