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