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

🌱 cover cluster reimport after running e2e #484

Merged

Conversation

salasberryfin
Copy link
Contributor

@salasberryfin salasberryfin commented Apr 18, 2024

What this PR does / why we need it:

This change adds a re-import check after running the existing import_gitops suite. The validation sits behind a condition passed as input TestClusterReimport which is proposed to only be enabled on CAPD tests to limit the effect on running time, which is already considerably long. This is also the reason why the new re-import validation is added to an existing test suite and not as a new one.

Both controller types are supported for now (v1 and v3 clusters) until we move completely to only v3.

To simplify and reduce code duplication, the validation on the Rancher cluster resource is now part of a validateRancherCluster function which is called during the "normal" test and then again after re-import.

The process of re-import is as follows:

  • Rancher cluster is removed, which causes the CAPI cluster to be annotated: imported=true.
  • Validate that the cluster is no longer imported and annotation is properly set.
  • Retrieve CAPI cluster annotations and remove imported=true.
  • Validate annotation is removed and wait for Rancher cluster to appear.
  • Re-run the existing tests on Rancher cluster (agent deployed, cluster ready, etc.).

Which issue(s) this PR fixes:
Fixes #266

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@salasberryfin salasberryfin added kind/enhancement Categorizes issue or PR as related to a new feature. area/testing Indicates an issue related to test labels Apr 18, 2024
@salasberryfin salasberryfin requested a review from a team as a code owner April 18, 2024 08:26
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
Signed-off-by: Carlos Salas <carlos.salas@suse.com>
@salasberryfin salasberryfin changed the title WIP: 🌱 cover cluster reimport after running e2e 🌱 cover cluster reimport after running e2e Apr 18, 2024
Copy link
Member

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for taking care of this

Copy link
Contributor

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

Thanks for adding this, LGTM

@Danil-Grigorev Danil-Grigorev merged commit 4248acf into rancher:main Apr 19, 2024
27 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Indicates an issue related to test kind/chore kind/enhancement Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an e2e scenario covering re-import of rancher manifests
3 participants