stylecop fix followup, enforce SA1503 (#432)
* enforce SA1503 * fix spacing * fix SA1413 * fix spacing * fix SA1013
This commit is contained in:
@@ -7,9 +7,11 @@ namespace k8s
|
||||
public partial class KubernetesClientConfiguration
|
||||
{
|
||||
private static string ServiceAccountPath =
|
||||
Path.Combine(new string[] {
|
||||
$"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount"
|
||||
Path.Combine(new string[]
|
||||
{
|
||||
$"{Path.DirectorySeparatorChar}var", "run", "secrets", "kubernetes.io", "serviceaccount",
|
||||
});
|
||||
|
||||
private const string ServiceAccountTokenKeyFileName = "token";
|
||||
private const string ServiceAccountRootCAKeyFileName = "ca.crt";
|
||||
|
||||
@@ -21,11 +23,13 @@ namespace k8s
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var tokenPath = Path.Combine(ServiceAccountPath, ServiceAccountTokenKeyFileName);
|
||||
if (!File.Exists(tokenPath))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var certPath = Path.Combine(ServiceAccountPath, ServiceAccountRootCAKeyFileName);
|
||||
return File.Exists(certPath);
|
||||
}
|
||||
@@ -47,7 +51,7 @@ namespace k8s
|
||||
{
|
||||
Host = new UriBuilder("https", host, Convert.ToInt32(port)).ToString(),
|
||||
AccessToken = token,
|
||||
SslCaCerts = CertUtils.LoadPemFileCert(rootCAFile)
|
||||
SslCaCerts = CertUtils.LoadPemFileCert(rootCAFile),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user