mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-03-31 13:58:51 +02:00
* feat(sourceNamespace): Regex Support Signed-off-by: Arthur <arthur@arthurvardevanyan.com> * feat(sourceNamespace): Separate exactMatch into patternMatch Signed-off-by: Arthur <arthur@arthurvardevanyan.com> --------- Signed-off-by: Arthur <arthur@arthurvardevanyan.com>
16 lines
417 B
Go
16 lines
417 B
Go
package security
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/argoproj/argo-cd/v2/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)
|
|
}
|