mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-07-11 01:29:32 +00:00
fix dist tests workflow summary
After kubeconfig was replaced with an in-cluster service account, k8sClient was returning null and thus no test summaries were being written to ConfigMaps. This change returns a default Kubeconfig for the k8sClient when one is not passed in an environment variable.
This commit is contained in:
parent
86d537779e
commit
00d4e7d0e0
@ -20,10 +20,18 @@ namespace DistTestCore
|
||||
|
||||
private static IKubernetes? CreateK8sClient()
|
||||
{
|
||||
var kubeconfig = Environment.GetEnvironmentVariable("KUBECONFIG");
|
||||
if (string.IsNullOrEmpty(kubeconfig)) return null;
|
||||
var config = KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeconfig);
|
||||
return new Kubernetes(config);
|
||||
try
|
||||
{
|
||||
var kubeconfig = Environment.GetEnvironmentVariable("KUBECONFIG");
|
||||
var config = string.IsNullOrEmpty(kubeconfig)
|
||||
? KubernetesClientConfiguration.BuildDefaultConfig()
|
||||
: KubernetesClientConfiguration.BuildConfigFromConfigFile(kubeconfig);
|
||||
return new Kubernetes(config);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Global()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user