File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . IO ;
3
- using System . Security . Cryptography . X509Certificates ;
4
3
using k8s . Exceptions ;
5
4
6
5
namespace k8s
7
6
{
8
7
public partial class KubernetesClientConfiguration
9
8
{
10
- private const string ServiceAccountTokenKey = "token" ;
11
- private const string ServiceAccountRootCAKey = "ca.crt" ;
9
+ private const string ServiceaccountPath = "/var/run/secrets/kubernetes.io/serviceaccount/" ;
10
+ private const string ServiceAccountTokenKeyFileName = "token" ;
11
+ private const string ServiceAccountRootCAKeyFileName = "ca.crt" ;
12
12
13
13
public static KubernetesClientConfiguration InClusterConfig ( )
14
14
{
@@ -21,8 +21,8 @@ public static KubernetesClientConfiguration InClusterConfig()
21
21
"unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined" ) ;
22
22
}
23
23
24
- var token = File . ReadAllText ( "/var/run/secrets/kubernetes.io/serviceaccount/" + ServiceAccountTokenKey ) ;
25
- var rootCAFile = "/var/run/secrets/kubernetes.io/serviceaccount/" + ServiceAccountRootCAKey ;
24
+ var token = File . ReadAllText ( Path . Combine ( ServiceaccountPath , ServiceAccountTokenKeyFileName ) ) ;
25
+ var rootCAFile = Path . Combine ( ServiceaccountPath , ServiceAccountRootCAKeyFileName ) ;
26
26
27
27
return new KubernetesClientConfiguration
28
28
{
You can’t perform that action at this time.
0 commit comments