Skip to content

Commit

Permalink
Allow blank Group on cluster resource [white|black]list (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
onematchfox authored Apr 21, 2023
1 parent 274c425 commit 50f550a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 8 additions & 0 deletions argocd/resource_argocd_project_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ resource "argocd_project" "simple" {
group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
}
cluster_resource_whitelist {
group = ""
kind = "Namespace"
}
cluster_resource_blacklist {
group = ""
kind = "ResourceQuota"
}
cluster_resource_blacklist {
group = "*"
kind = "*"
Expand Down
3 changes: 0 additions & 3 deletions argocd/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ func validateRoleName(value interface{}, key string) (ws []string, es []error) {

func validateGroupName(value interface{}, key string) (ws []string, es []error) {
v := value.(string)
if strings.TrimSpace(v) == "" {
es = append(es, fmt.Errorf("%s: group '%s' is empty", key, v))
}

invalidChars := regexp.MustCompile("[,\n\r\t]")
if invalidChars.MatchString(v) {
Expand Down

0 comments on commit 50f550a

Please sign in to comment.