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 ownerReference resilience test #2209

Merged

Conversation

killianmuldoon
Copy link
Contributor

@killianmuldoon killianmuldoon commented Aug 10, 2023

Add ownerReference validation to CAPV for the following types in the Cluster and ClusterClass tests:

  • vSphereClusterKind
  • vSphereClusterTemplateKind
  • vSphereMachineKind
  • vSphereMachineTemplateKind
  • vSphereVMKind
  • vSphereClusterIdentity
  • vSphereDeploymentZone
  • vSphereFailureDomain

The validations - similar to those in CAPI - assert that ownerReferences are re-reconciled if removed and also check that ownerReference apiVersions are always updated to the latest version.

Part of #2075

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2023
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 10, 2023
@killianmuldoon killianmuldoon force-pushed the pr-ownerRef-stability branch 3 times, most recently from d288e6d to 17659f7 Compare August 15, 2023 18:25
@killianmuldoon killianmuldoon force-pushed the pr-ownerRef-stability branch 3 times, most recently from f5d4623 to 1facf1f Compare August 23, 2023 11:39
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2023
@killianmuldoon killianmuldoon force-pushed the pr-ownerRef-stability branch 3 times, most recently from e40cdd8 to 363cbd3 Compare August 23, 2023 11:42
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2023
@killianmuldoon killianmuldoon changed the title [WIP] 🌱 Add ownerReference resilience test 🌱 Add ownerReference resilience test Aug 23, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 23, 2023
@killianmuldoon
Copy link
Contributor Author

/retest

@killianmuldoon
Copy link
Contributor Author

This error isn't happening for me locally - but it looks like a bug on the CAPI side from a ClusterResourceSetBinding with multiple ownerReferences - good we caught that here. Will bring it up over at the CAPI repo.

/hold
Until this is fixed in core CAPI.

@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 Aug 23, 2023
@killianmuldoon killianmuldoon force-pushed the pr-ownerRef-stability branch 2 times, most recently from da986d5 to 87b17cc Compare August 23, 2023 14:19
@killianmuldoon
Copy link
Contributor Author

/retest

@killianmuldoon
Copy link
Contributor Author

/hold cancel

The ClusterResourceSet error was down to a race condition. I've update the code to ensure the CRS is reconciled before running the ownerReference check.

@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 Aug 23, 2023
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
test/helpers/ownerreference_helpers.go Outdated Show resolved Hide resolved
controllers/vspherecluster_reconciler.go Show resolved Hide resolved
@sbueringer
Copy link
Member

/lgtm

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

LGTM label has been added.

Git tree hash: 6714c6928afd71e4e1ecd7a96027146901b61061

@sbueringer
Copy link
Member

@killianmuldoon You probably want to squash

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

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

small nit

/lgtm

test/e2e/ownerreference_test.go Outdated Show resolved Hide resolved
chrischdi

This comment was marked as duplicate.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 13, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 13, 2023
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 13, 2023

@killianmuldoon: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-vsphere-e2e-main-oldpreset 7b338f6 link true /test pull-cluster-api-provider-vsphere-e2e-main-oldpreset

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

Signed-off-by: killianmuldoon <kmuldoon@vmware.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 13, 2023
@sbueringer
Copy link
Member

sbueringer commented Sep 13, 2023

Thank you very much!! Nice work

/lgtm
/approve

Now onto manual cherry-picking I guess :D (or maybe git can deal with this delta)

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

LGTM label has been added.

Git tree hash: ed69c492a5e4bb6ce403c50a1d8565a9f0e03124

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 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:

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 Sep 13, 2023
@chrischdi
Copy link
Member

Note: there is still a hold on this PR.

@killianmuldoon
Copy link
Contributor Author

/hold cancel

@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 Sep 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit 987e3fe into kubernetes-sigs:main Sep 13, 2023
18 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Sep 13, 2023
@k8s-infra-cherrypick-robot

@sbueringer: #2209 failed to apply on top of branch "release-1.8":

Applying: Add ownerReference resilience test
.git/rebase-apply/patch:632: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	Makefile
M	controllers/vspherecluster_reconciler.go
M	controllers/vsphereclusteridentity_controller.go
M	controllers/vspheredeploymentzone_controller.go
M	controllers/vspheredeploymentzone_controller_domain.go
M	controllers/vspheremachine_controller.go
M	pkg/identity/identity.go
M	test/e2e/README.md
M	test/e2e/capv_quick_start_test.go
M	test/e2e/config/vsphere-ci.yaml
M	test/e2e/config/vsphere-dev.yaml
M	test/integration/integration-dev.yaml
Falling back to patching base and 3-way merge...
Auto-merging test/integration/integration-dev.yaml
Removing test/e2e/ignition_test.go
Auto-merging test/e2e/config/vsphere-dev.yaml
Auto-merging test/e2e/config/vsphere-ci.yaml
CONFLICT (modify/delete): test/e2e/capv_quick_start_test.go deleted in Add ownerReference resilience test and modified in HEAD. Version HEAD of test/e2e/capv_quick_start_test.go left in tree.
Auto-merging test/e2e/README.md
Auto-merging pkg/identity/identity.go
Auto-merging controllers/vspheremachine_controller.go
CONFLICT (content): Merge conflict in controllers/vspheremachine_controller.go
Auto-merging controllers/vspheredeploymentzone_controller_domain.go
CONFLICT (content): Merge conflict in controllers/vspheredeploymentzone_controller_domain.go
Auto-merging controllers/vspheredeploymentzone_controller.go
CONFLICT (content): Merge conflict in controllers/vspheredeploymentzone_controller.go
Auto-merging controllers/vsphereclusteridentity_controller.go
Auto-merging controllers/vspherecluster_reconciler.go
CONFLICT (content): Merge conflict in controllers/vspherecluster_reconciler.go
Auto-merging Makefile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add ownerReference resilience test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.8

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.

@k8s-infra-cherrypick-robot

@sbueringer: #2209 failed to apply on top of branch "release-1.7":

Applying: Add ownerReference resilience test
.git/rebase-apply/patch:632: new blank line at EOF.
+
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	Makefile
M	controllers/vspherecluster_reconciler.go
M	controllers/vsphereclusteridentity_controller.go
M	controllers/vspheredeploymentzone_controller.go
M	controllers/vspheredeploymentzone_controller_domain.go
M	controllers/vspheremachine_controller.go
M	pkg/identity/identity.go
M	test/e2e/README.md
M	test/e2e/capv_quick_start_test.go
M	test/e2e/config/vsphere-ci.yaml
M	test/e2e/config/vsphere-dev.yaml
M	test/integration/integration-dev.yaml
Falling back to patching base and 3-way merge...
Auto-merging test/integration/integration-dev.yaml
CONFLICT (content): Merge conflict in test/integration/integration-dev.yaml
Removing test/e2e/ignition_test.go
Auto-merging test/e2e/config/vsphere-dev.yaml
CONFLICT (content): Merge conflict in test/e2e/config/vsphere-dev.yaml
Auto-merging test/e2e/config/vsphere-ci.yaml
CONFLICT (content): Merge conflict in test/e2e/config/vsphere-ci.yaml
CONFLICT (modify/delete): test/e2e/capv_quick_start_test.go deleted in Add ownerReference resilience test and modified in HEAD. Version HEAD of test/e2e/capv_quick_start_test.go left in tree.
Auto-merging test/e2e/README.md
Auto-merging pkg/identity/identity.go
Auto-merging controllers/vspheremachine_controller.go
CONFLICT (content): Merge conflict in controllers/vspheremachine_controller.go
Auto-merging controllers/vspheredeploymentzone_controller_domain.go
CONFLICT (content): Merge conflict in controllers/vspheredeploymentzone_controller_domain.go
Auto-merging controllers/vspheredeploymentzone_controller.go
CONFLICT (content): Merge conflict in controllers/vspheredeploymentzone_controller.go
Auto-merging controllers/vsphereclusteridentity_controller.go
Auto-merging controllers/vspherecluster_reconciler.go
CONFLICT (content): Merge conflict in controllers/vspherecluster_reconciler.go
Auto-merging Makefile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add ownerReference resilience test
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.7

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.

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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants