mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
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>
16 lines
417 B
Go
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)
|
|
}
|