MCPcopy Create free account
hub / github.com/Noumena-Network/code / getKubernetesNamespaceSignal

Function getKubernetesNamespaceSignal

src/utils/protectedNamespace.js:23–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23function getKubernetesNamespaceSignal() {
24 if (!existsSync(KUBERNETES_NAMESPACE_PATH)) {
25 return { hasSignal: false, namespace: null }
26 }
27
28 try {
29 const namespace = readFileSync(KUBERNETES_NAMESPACE_PATH, 'utf8').trim()
30 return { hasSignal: true, namespace: namespace.length > 0 ? namespace : null }
31 } catch {
32 // Conservative: namespace mount exists but we could not read it.
33 return { hasSignal: true, namespace: null }
34 }
35}
36
37function getConfiguredNamespace() {
38 const namespace = process.env.COO_NAMESPACE

Callers 1

checkProtectedNamespaceFunction · 0.85

Calls 2

existsSyncFunction · 0.85
readFileSyncFunction · 0.70

Tested by

no test coverage detected