MCPcopy
hub / github.com/dapr/dapr / GetNamespaceOrDefault

Function GetNamespaceOrDefault

utils/utils.go:137–143  ·  view source on GitHub ↗

GetNamespaceOrDefault returns the namespace for Dapr, or the default namespace if it is not set.

(defaultNamespace string)

Source from the content-addressed store, hash-verified

135
136// GetNamespaceOrDefault returns the namespace for Dapr, or the default namespace if it is not set.
137func GetNamespaceOrDefault(defaultNamespace string) string {
138 namespace := os.Getenv("NAMESPACE")
139 if namespace == "" {
140 namespace = defaultNamespace
141 }
142 return namespace
143}
144
145func ParseServiceAddr(val string) []string {
146 p := strings.Split(val, ",")

Callers 1

Calls

no outgoing calls

Tested by 1