introduce CreateWatchHandle for use with HttpClientFactory (#379)
This commit is contained in:
@@ -32,7 +32,8 @@ namespace httpClientFactory
|
||||
serviceProvider.GetRequiredService<KubernetesClientConfiguration>(),
|
||||
httpClient);
|
||||
})
|
||||
.ConfigurePrimaryHttpMessageHandler(config.CreateDefaultHttpClientHandler);
|
||||
.ConfigurePrimaryHttpMessageHandler(config.CreateDefaultHttpClientHandler)
|
||||
.AddHttpMessageHandler(KubernetesClientConfiguration.CreateWatchHandler);
|
||||
|
||||
// Add the class that uses the client
|
||||
services.AddHostedService<PodListHostedService>();
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace k8s
|
||||
{
|
||||
if(this.SkipTlsVerify)
|
||||
{
|
||||
httpClientHandler.ServerCertificateCustomValidationCallback =
|
||||
httpClientHandler.ServerCertificateCustomValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) => true;
|
||||
}
|
||||
else
|
||||
@@ -47,5 +47,7 @@ namespace k8s
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static DelegatingHandler CreateWatchHandler() => new WatcherDelegatingHandler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user