structs: prevent service-defaults upstream configs from using wildcard names or namespaces (#10475)

pull/10496/head
R.B. Boyer 3 years ago committed by hc-github-team-consul-core
parent 197cba8fa1
commit 2293ccfeca

@ -0,0 +1,3 @@
```release-note:improvement
structs: prevent service-defaults upstream configs from using wildcard names or namespaces
```

@ -789,6 +789,12 @@ func (cfg UpstreamConfig) validate(named bool) error {
if cfg.Name == "" {
return fmt.Errorf("Name is required")
}
if cfg.Name == WildcardSpecifier {
return fmt.Errorf("Wildcard name is not supported")
}
if cfg.EnterpriseMeta.NamespaceOrDefault() == WildcardSpecifier {
return fmt.Errorf("Wildcard namespace is not supported")
}
} else {
if cfg.Name != "" {
return fmt.Errorf("Name must be empty")

Loading…
Cancel
Save