MCPcopy Create free account
hub / github.com/devspace-sh/devspace / inClusterNamespace

Function inClusterNamespace

pkg/devspace/kubectl/util/util.go:94–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92}
93
94func inClusterNamespace() (string, error) {
95 envNamespace := os.Getenv("KUBE_NAMESPACE")
96 if envNamespace != "" {
97 return envNamespace, nil
98 }
99
100 namespace, err := os.ReadFile("/var/run/secrets/kubernetes.io/serviceaccount/namespace")
101 if err != nil {
102 return "", err
103 }
104
105 return string(namespace), nil
106}
107
108func ConvertRestConfigToRawConfig(config *rest.Config, namespace string) (*clientcmdapi.Config, error) {
109 contextName := localContext

Callers 1

NewClientByContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected