Skip to content

Commit aee0d09

Browse files
fix: Kubernetes client registration after refactor (#443)
Fixes #441 Signed-off-by: Erin Allison <[email protected]> Co-authored-by: Christoph Bühler <[email protected]>
1 parent 474f0b7 commit aee0d09

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/KubeOps.Testing/KubernetesOperatorFactory.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ protected override void ConfigureWebHost(IWebHostBuilder builder)
100100
d => d.ServiceType == typeof(IHostedService) && d.ImplementationType == typeof(LeaderElector));
101101
services.Remove(elector);
102102

103-
services.RemoveAll<IKubernetesClient>();
104-
services.AddSingleton<IKubernetesClient, MockKubernetesClient>();
105-
106103
services.RemoveAll(typeof(IEventQueue<>));
107104
services.AddSingleton(typeof(IEventQueue<>), typeof(MockEventQueue<>));
108105
});

src/KubeOps/Operator/Builder/OperatorBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ internal IOperatorBuilder AddOperatorBase(OperatorSettings settings)
199199

200200
Services.AddTransient<EntitySerializer>();
201201

202-
Services.AddScoped<IKubernetesClient, KubernetesClient>();
202+
Services.AddSingleton<IKubernetesClient, KubernetesClient>();
203203
Services.AddScoped<IEventManager, EventManager>();
204204

205205
Services.AddScoped(typeof(IResourceCache<>), typeof(ResourceCache<>));

0 commit comments

Comments
 (0)