aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/namespace.go
blob: 6eab138670549ae7b8f6007d89d604a682d015ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package kubernetes

// filteredNamespaceExists checks if namespace exists in this cluster
// according to any `namespace_labels` plugin configuration specified.
// Returns true even for namespaces not exposed by plugin configuration,
// see namespaceExposed.
func (k *Kubernetes) filteredNamespaceExists(namespace string) bool {
	ns, err := k.APIConn.GetNamespaceByName(namespace)
	if err != nil {
		return false
	}
	return ns.ObjectMeta.Name == namespace
}

// configuredNamespace returns true when the namespace is exposed through the plugin
// `namespaces` configuration.
func (k *Kubernetes) configuredNamespace(namespace string) bool {
	_, ok := k.Namespaces[namespace]
	if len(k.Namespaces) > 0 && !ok {
		return false
	}
	return true
}

func (k *Kubernetes) namespaceExposed(namespace string) bool {
	return k.configuredNamespace(namespace) && k.filteredNamespaceExists(namespace)
}
essurected-branch'>jarred/new-bund-ressurected-branch Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/bench/snippets/jsx-entity-decoding.jsx (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-22types for `bun:jsc`Gravatar Jarred Sumner 2-1/+37
2022-06-22Slightly customize the `events` polyfill so it uses ESMGravatar Jarred Sumner 1-1/+522
2022-06-22Fix memory bugs in escapeHTML & arrayBufferToStringGravatar Jarred Sumner 1-65/+61