Files
argo-cd/util/security/application_namespaces.go
github-actions[bot] 4d9835927d Bump major version to 3 (#21410)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: crenshaw-dev <350466+crenshaw-dev@users.noreply.github.com>
2025-01-10 16:14:00 -05:00

16 lines
417 B
Go

package security
import (
"fmt"
"github.com/argoproj/argo-cd/v3/util/glob"
)
func IsNamespaceEnabled(namespace string, serverNamespace string, enabledNamespaces []string) bool {
return namespace == serverNamespace || glob.MatchStringInList(enabledNamespaces, namespace, glob.REGEXP)
}
func NamespaceNotPermittedError(namespace string) error {
return fmt.Errorf("namespace '%s' is not permitted", namespace)
}