Code cosmetics

This commit is contained in:
Andrei Pohilko
2022-12-06 15:31:18 +00:00
parent 2c1883c835
commit 2c25193adf
7 changed files with 31 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ package subproc
import (
"encoding/json"
v1 "k8s.io/apimachinery/pkg/apis/testapigroup/v1"
"os"
"regexp"
"sort"
"strings"
@@ -31,6 +32,12 @@ type KubeContext struct {
}
func (d *DataLayer) ListContexts() (res []KubeContext, err error) {
res = []KubeContext{}
if os.Getenv("HD_CLUSTER_MODE") != "" {
return res, nil
}
out, err := d.runCommandKubectl("config", "get-contexts")
if err != nil {
return nil, err