stylecop fix followup, enforce SA1503 (#432)

* enforce SA1503

* fix spacing

* fix SA1413

* fix spacing

* fix SA1013
This commit is contained in:
Boshi Lian
2020-04-23 11:40:06 -07:00
committed by GitHub
parent 324a3e72fd
commit cfc4306528
75 changed files with 1072 additions and 786 deletions

View File

@@ -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),
};
}
}