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

✨ e2e Test: Ensure OwnerRefs are consistently reconciled #7606

Merged
merged 1 commit into from Jan 20, 2023

Conversation

killianmuldoon
Copy link
Contributor

Add a new e2e test and set of helper functions to test that ownerReferences are correctly reconciled by Cluster API.

This test is designed to capture how Cluster API creates ownerReferences with a newly created Topology based Cluster using KCP + KubeadmBooststrap + Docker infrastructure.

It also tests how ownerReferences are reconciled after they've been removed and re-reconciled.

Fixes #7575

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 23, 2022
@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 23, 2022
@killianmuldoon killianmuldoon changed the title ✨ e2e Test: Ensure OwnerRefs are consistently reconciled ✨ [WIP] e2e Test: Ensure OwnerRefs are consistently reconciled Nov 23, 2022
@killianmuldoon
Copy link
Contributor Author

/hold

This currently contains all of the commits required to make the test pass. Let's merge it once it's green against main.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 23, 2022
@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 25, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Nov 28, 2022
@killianmuldoon killianmuldoon force-pushed the ownerRef-test branch 2 times, most recently from 2ccc869 to 4e7458a Compare November 28, 2022 11:46
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 28, 2022
@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@killianmuldoon
Copy link
Contributor Author

/retest

@killianmuldoon
Copy link
Contributor Author

/remove-hold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 18, 2023
@fabriziopandini
Copy link
Member

great work!
only one last note about being really specific about the target use case of GetOwnerGraph, otherwise lgtm

Copy link
Member

@sbueringer sbueringer left a comment

Choose a reason for hiding this comment

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

Very nice work!!

cmd/clusterctl/client/cluster/ownergraph.go Outdated Show resolved Hide resolved
cmd/clusterctl/client/cluster/ownergraph.go Show resolved Hide resolved
}
Eventually(func() error {
graph, err := clusterctlcluster.GetOwnerGraph(namespace, kubeconfigPath)
Expect(err).To(BeNil())
Copy link
Member

Choose a reason for hiding this comment

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

I assume we intentionally want to fail here if we get an error once? (and not retry with eventually)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah - actually this is running retries within the func so this is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like the test is flaky if Eventually isn't included because of different order / speed of the reconcilers.

test/framework/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/framework/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/framework/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/framework/ownerreference_helpers.go Show resolved Hide resolved
test/framework/ownerreference_helpers.go Outdated Show resolved Hide resolved
@killianmuldoon killianmuldoon force-pushed the ownerRef-test branch 2 times, most recently from c676f9d to 319e024 Compare January 20, 2023 13:57
@sbueringer
Copy link
Member

Thx!

/lgtm
/pull-cluster-api-e2e-full-main
(a final one after the last changes)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: ced47f3dcd788c9c2f47c340d62eb20348adbbca

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2023
@sbueringer
Copy link
Member

sbueringer commented Jan 20, 2023

@killianmuldoon Maybe dropping the eventually caused the errors?

@killianmuldoon
Copy link
Contributor Author

Yup - #7606 (comment)

Re-running with Eventually added back in now.

@killianmuldoon
Copy link
Contributor Author

/test pull-cluster-api-e2e-full-main

@killianmuldoon
Copy link
Contributor Author

@sbueringer all green 🙂

@sbueringer
Copy link
Member

Perfect! Thx

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 20, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 118bf208054057fab42efb592da5b435277899f7

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

/lgtm
/approve

Yay! 🥳

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, sbueringer

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:
  • OWNERS [fabriziopandini,sbueringer]

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 merged commit 42063b7 into kubernetes-sigs:main Jan 20, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jan 20, 2023
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure owner references are correctly re-reconciled
4 participants