Cannot resolve scoped service 'KubeOps.Operator.Controller.IEventQueue`1[MyOperator.Entities.V1DemoEntity]' from root provider
See original GitHub issueDescribe the bug Not able to debug the sample operator in .Net 6.0. Getting the below exception.
To Reproduce
- Created the sample project via template
- Project is targeting KubeOps 6.5.3 and .Net 6.0
- Did dotnet run install
- Did dotnet run and got the below error
Startup Leader Elector for operator "myoperator". Unhandled exception. System.InvalidOperationException: Cannot resolve scoped service 'KubeOps.Operator.Controller.IEventQueue
1[MyOperator.Entities.V1DemoEntity]’ from root provider.
at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteValidator.ValidateResolution(Type serviceType, IServiceScope scope, IServiceScope rootScope)
at Microsoft.Extensions.DependencyInjection.ServiceProvider.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider)
at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)
at KubeOps.Operator.Builder.OperatorBuilder.<>c__DisplayClass18_0.<AddOperatorBase>b__3(ControllerRegistration r)
at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext() at System.Collections.Generic.List
1.InsertRange(Int32 index, IEnumerable1 collection) at System.Collections.Generic.List
1.AddRange(IEnumerable1 collection) at KubeOps.Operator.Controller.ResourceControllerManager.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at KubeOps.Operator.Commands.RunOperator.OnExecuteAsync() at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.InvokeAsync(MethodInfo method, Object instance, Object[] arguments) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() --- End of stack trace from previous location --- at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:20 (12 by maintainers)
Top GitHub Comments
The latest functioning version seems to be 6.3.1
Same here, not fixed with latest version on nuget as of june 15