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

🐛 Ensure that capd tests always clean up the kind cluster #2917

Merged
merged 1 commit into from
Apr 15, 2020

Conversation

benmoss
Copy link

@benmoss benmoss commented Apr 15, 2020

What this PR does / why we need it:
Ensure that we always delete the kind cluster created by the e2e suite. The problem is that InitManagementCluster doesn't return errors, it uses Gomega assertions, so if an error occurs after the cluster is created it will immediately return from the BeforeSuite before mgmt is assigned.

Because of the NewManagementClusterFn feature I was able to abuse variable scoping a little bit to work around this, but otherwise would have to change framework.InitManagementCluster and maybe add another method to the interface. It definitely isn't the cleanest solution right now.

This also aggregates the log errors so that if one errors it doesn't prevent the rest from still attempting. Worst case they all fail but we still get one error.

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

/assign @fabriziopandini

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 15, 2020
Having to abuse variable scoping a little bit, but otherwise would have
to change framework.InitManagementCluster and maybe add another method
to the interface.

This also aggregates the log errors so that if one errors it doesn't
prevent the rest from still attempting. Worst case they all fail but we
still get one error.
@vincepri
Copy link
Member

/milestone v0.3.4

@k8s-ci-robot k8s-ci-robot added this to the v0.3.4 milestone Apr 15, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/assign @fabriziopandini @sedefsavas

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmoss, vincepri

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2020
@fabriziopandini
Copy link
Member

lgtm form my side.
@benmoss FYI we are revisiting this code in order to support clusterctl init, self-hosted test, bring your own bootstrap cluster etc. etc.
I will take care to make sure a similar use case does not happen

@fabriziopandini
Copy link
Member

/test pull-cluster-api-capd-e2e
failure seems not related to this change (timeout)

@sedefsavas
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 15, 2020
@k8s-ci-robot k8s-ci-robot merged commit 01f5f2c into kubernetes-sigs:master Apr 15, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test-capd-e2e can leak kind clusters
5 participants