-
-
Notifications
You must be signed in to change notification settings - Fork 79
Description
Describe the bug
There are several issues running the latest release on an existing or new templated project
The first is the scoped services that no longer work with Hosted services.
ie. Leader Election and LocalTunnerl.
Without explicitly turning off leader election, the code will not run due to the following:
Cannot consume scoped service 'DotnetKubernetesClient.IKubernetesClient' from singleton 'Microsoft.Extensions.Hosting.IHostedService'.
another issue is that IResourceCache is not required for EventQueue which is not part of the controller, however, there is no service registration for Resourcecache and the
services.AddScoped<typeof(ResourceCache<>>)
doesn't do it.
The error is
'Unable to resolve service for type 'KubeOps.Operator.Caching.IResourceCache
1[Operator3.Entities.V1DemoEntity]' while attempting to activate 'KubeOps.Operator.Controller.EventQueue1[Operator3.Entities.V1DemoEntity]'.'
To Reproduce
create a new project, reference .net6 language version 10 and the package version 6.4.0. Hit play