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

Dependancy upgrades #1314

Merged
merged 30 commits into from
May 22, 2024
Merged

Dependancy upgrades #1314

merged 30 commits into from
May 22, 2024

Conversation

Miles-Garnsey
Copy link
Member

@Miles-Garnsey Miles-Garnsey commented May 13, 2024

What this PR does:

Upgrades controller-runtime

Which issue(s) this PR fixes:

Expanding this due to the presence of more bugs than we originally realised.

Fixes #1313 #1317 #1316

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CHANGELOG.md updated (not required for documentation PRs)
  • CLA Signed: DataStax CLA

@Miles-Garnsey Miles-Garnsey requested a review from a team as a code owner May 13, 2024 09:09
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 76.66667% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 58.53%. Comparing base (1864ddb) to head (edcfbf7).
Report is 27 commits behind head on main.

Current head edcfbf7 differs from pull request most recent head d813636

Please upload reports for the commit d813636 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1314      +/-   ##
==========================================
+ Coverage   57.43%   58.53%   +1.09%     
==========================================
  Files         103      122      +19     
  Lines       10808    11837    +1029     
==========================================
+ Hits         6208     6929     +721     
- Misses       4063     4301     +238     
- Partials      537      607      +70     
Files Coverage Δ
controllers/config/clientconfig_controller.go 86.86% <100.00%> (+3.64%) ⬆️
controllers/control/k8ssandratask_controller.go 65.62% <100.00%> (+1.62%) ⬆️
...ntrollers/k8ssandra/k8ssandracluster_controller.go 77.58% <100.00%> (+2.58%) ⬆️
pkg/medusa/reconcile.go 69.87% <100.00%> (+8.92%) ⬆️
pkg/test/test_objects.go 100.00% <100.00%> (ø)
pkg/test/testenv.go 58.27% <100.00%> (ø)
...trollers/medusa/medusabackupschedule_controller.go 9.90% <0.00%> (-61.10%) ⬇️
...is/medusa/v1alpha1/medusabackupschedule_webhook.go 87.50% <66.66%> (ø)
controllers/reaper/reaper_controller.go 52.68% <0.00%> (ø)
controllers/replication/secret_controller.go 67.73% <62.50%> (+2.71%) ⬆️
... and 2 more

... and 22 files with indirect coverage changes

@Miles-Garnsey
Copy link
Member Author

Miles-Garnsey commented May 20, 2024

Finally figured out the issues plaguing the e2e tests. I think I'm hitting this: kubernetes-sigs/controller-runtime#2628

EDIT: maybe not. There's an error on the K8ssandraCluster object unable to list: test-1 because of unknown namespace for the cache when I run (for example) make E2E_TEST="TestOperator/ClusterScoped/MultiDcMultiCluster" TEST_ARGS="-test.timeout 99999s" kind-multi-e2e-test. This is pretty deeply unhelpful, because there are no errors in the logs, and so I have no idea which call to .List() is actually failing, or - more importantly - which client doesn't have a namespace set.

This ticket says that leaving DefaultNamespaces unset on the manager.options.NewCache field should allow the operator to watch all namespaces. And my code here is identical to what is in cass-operator here.

So I'm thinking this must be some problem with one of the other clients, maybe on the data planes. @burmanm if you have any ideas I'd be grateful to hear them.

@Miles-Garnsey
Copy link
Member Author

I've narrowed this down a bit more, I think I'm seeing this error from here and here at least.

What appears to happen is that when .List() is called, it strikes this line because the namespace specified in the ListOption does not exist within the list of namespaces being cached by this client. This is pretty wild, since I can't see any reason why this should actually be failing given that this cache should be watching all namespaces (based on the way the remote clients get constructed here).

So it looks to me as though the List() function in client-go might actually be broken, since a caching client which watches all namespaces doesn't seem to be able to List() resources across a single namespace due to it never being in the cache. We'd have to work around this by constructing our own List function that Lists() from all namespaces then filters based on the one we actually wanted.

Example of the type of error I'm seeing:

2024-05-20T05:46:56.079Z	ERROR	Failed to get seed pods	{"controller": "k8ssandracluster", "controllerGroup": "k8ssandra.io", "controllerKind": "K8ssandraCluster", "K8ssandraCluster": {"name":"test","namespace":"test-0"}, "namespace": "test-0", "name": "test", "reconcileID": "9002b761-90a2-4e37-bb7f-3c55a97e3ce1", "K8ssandraCluster": {"name":"test","namespace":"test-0"}, "K8sContext": "kind-k8ssandra-0", "DC": {"name":"dc1","namespace":"test-1"}, "error": "unable to list: test-1 because of unknown namespace for the cache"}
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).findSeeds
	/workspace/controllers/k8ssandra/seeds.go:45
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).reconcileDatacenters
	/workspace/controllers/k8ssandra/datacenters.go:55
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).reconcile
	/workspace/controllers/k8ssandra/k8ssandracluster_controller.go:145
github.com/k8ssandra/k8ssandra-operator/controllers/k8ssandra.(*K8ssandraClusterReconciler).Reconcile
	/workspace/controllers/k8ssandra/k8ssandracluster_controller.go:93
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

@Miles-Garnsey Miles-Garnsey force-pushed the update/dependancy-upgrades branch from be7de10 to 686e8fc Compare May 21, 2024 04:48
@Miles-Garnsey Miles-Garnsey force-pushed the update/dependancy-upgrades branch from dfc0d52 to edcfbf7 Compare May 22, 2024 01:39
…ler runtime instead of the informerCache we want.
@Miles-Garnsey Miles-Garnsey force-pushed the update/dependancy-upgrades branch from edcfbf7 to 4b4c73e Compare May 22, 2024 03:07
Copy link

Quality Gate Passed Quality Gate passed

Issues
28 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.9% Duplication on New Code

See analysis details on SonarCloud

@burmanm burmanm merged commit 66db83a into main May 22, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

K8ssandra-operator needs to be upgraded to the latest controller-runtime version
2 participants