Skip to content

Latest release (6.4.0) does not work and will fail with default template #441

@ewassef

Description

@ewassef

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.IResourceCache1[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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreleased

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions