mongodb-atlas-kubernetes icon indicating copy to clipboard operation
mongodb-atlas-kubernetes copied to clipboard

CLOUDP-238465: remove ownership detection

Open s-urbaniak opened this issue 1 year ago • 5 comments

Given the current research we are confident that the current ownership detection code base won't survive in its shape and form.

This removes ownership detection for good from the current code base.

Note for reviewers: review commit by commit, this has been carefully sanitized to have the removal of ownership detection live in its own commit. For merging I also vote for not squashing but keeping the commit history from this PR.

Separating this as separate PRs will be very hard as the commits are partially not compilable.

All Submissions:

  • [ ] Have you signed our CLA?
  • [ ] Put closes #XXXX in your comment to auto-close the issue that your PR fixes (if there is one).
  • [ ] Update docs/release-notes/release-notes-template.md if your changes should be included in the release notes for the next release.

s-urbaniak avatar May 22 '24 15:05 s-urbaniak

https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/ae910bc2421caddfaf455acfc0fcd6ba0601be67

github-actions[bot] avatar May 22 '24 15:05 github-actions[bot]

The more code we remove/optimize, the more racy behaviour of our tests bubble up:


2024-05-22T18:10:17.4967008Z       <*errors.StatusError | 0xc00041d0e0>: 
2024-05-22T18:10:17.4968127Z       Operation cannot be fulfilled on atlasdeployments.atlas.mongodb.com "test-deployment-aws-k8s": the object has been modified; please apply your changes to the latest version and try again
2024-05-22T18:10:17.4968224Z       {
2024-05-22T18:10:17.4968369Z           ErrStatus: {
2024-05-22T18:10:17.4968634Z               TypeMeta: {Kind: "", APIVersion: ""},
2024-05-22T18:10:17.4968790Z               ListMeta: {
2024-05-22T18:10:17.4968969Z                   SelfLink: "",
2024-05-22T18:10:17.4969196Z                   ResourceVersion: "",
2024-05-22T18:10:17.4969375Z                   Continue: "",
2024-05-22T18:10:17.4969618Z                   RemainingItemCount: nil,
2024-05-22T18:10:17.4969737Z               },
2024-05-22T18:10:17.4969919Z               Status: "Failure",
2024-05-22T18:10:17.4971538Z               Message: "Operation cannot be fulfilled on atlasdeployments.atlas.mongodb.com \"test-deployment-aws-k8s\": the object has been modified; please apply your changes to the latest version and try again",
2024-05-22T18:10:17.4971732Z               Reason: "Conflict",
2024-05-22T18:10:17.4971877Z               Details: {
2024-05-22T18:10:17.4972214Z                   Name: "test-deployment-aws-k8s",
2024-05-22T18:10:17.4972481Z                   Group: "atlas.mongodb.com",
2024-05-22T18:10:17.4972728Z                   Kind: "atlasdeployments",
2024-05-22T18:10:17.4972891Z                   UID: "",
2024-05-22T18:10:17.4973065Z                   Causes: nil,
2024-05-22T18:10:17.4973292Z                   RetryAfterSeconds: 0,
2024-05-22T18:10:17.4973409Z               },
2024-05-22T18:10:17.4973558Z               Code: 409,
2024-05-22T18:10:17.4973662Z           },
2024-05-22T18:10:17.4973785Z       }[0m
2024-05-22T18:10:17.4974735Z   [38;5;9mIn [1m[It][0m[38;5;9m at: [1m/home/runner/work/mongodb-atlas-kubernetes/mongodb-atlas-kubernetes/test/int/deployment_test.go:210[0m [38;5;243m@ 05/22/24 18:08:24.802[0m

I experienced the same in https://github.com/mongodb/mongodb-atlas-kubernetes/pull/1595 so this also needs similar fixes 😞

s-urbaniak avatar May 22 '24 19:05 s-urbaniak

ok, looking at test/int/deployment_test.go, the whole code doesn't handle conflict resolution during Update()s so we need to fix it here as well.

s-urbaniak avatar May 22 '24 19:05 s-urbaniak

yeah, now the CI is green, I'd still like to add conflict resolution in the integration test here before we merge.

s-urbaniak avatar May 23 '24 06:05 s-urbaniak

as discussed with @josvazg: I will use this PR as a guinea pig for conflict resolution but will merge this PR only after another PR fixing updates in the first place.

s-urbaniak avatar May 23 '24 08:05 s-urbaniak

1/3 panics fixed, moving to the next one.

s-urbaniak avatar May 29 '24 07:05 s-urbaniak

Note: we want to merge this after https://github.com/mongodb/mongodb-atlas-kubernetes/pull/1622 in order not to amplify flakes.

s-urbaniak avatar May 30 '24 06:05 s-urbaniak