INNER CODE UNIT · Go

isIgnoredNamespace

airwallex/k8s-pod-restart-info-collector · helpers.go:31

func isIgnoredNamespace(namespace string) bool {
	ignoredNamespacesEnv := os.Getenv("IGNORED_NAMESPACES")
	if ignoredNamespacesEnv == "" {
		return false
	}
	ignoredNamespaces := strings.Split(ignoredNamespacesEnv, ",")
	for _, ignoredNamespace := range ignoredNamespaces {
		match, _ := regexp.MatchString(ignoredNamespace, namespace)
		if match {
			klog.Infof("Ignore: namespace %s is in the ignored namespace list\n", namespace)
			return true
		}
	}
	return false
}

func isIgnoredPod(name string) bool {
	ignoredPodNamePrefixesEnv := os.Getenv("IGNORED_POD_NAME_PREFIXES")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…