Update namespaces subject-verb agreement

This commit is contained in:
freddygv 2020-06-23 10:57:30 -06:00
parent 044d027ff8
commit c791fbc79c
6 changed files with 10 additions and 10 deletions

View File

@ -12,10 +12,10 @@ import (
func (s *HTTPServer) parseEntMeta(req *http.Request, entMeta *structs.EnterpriseMeta) error {
if headerNS := req.Header.Get("X-Consul-Namespace"); headerNS != "" {
return BadRequestError{Reason: "Invalid header: \"X-Consul-Namespace\" - Namespaces is a Consul Enterprise feature"}
return BadRequestError{Reason: "Invalid header: \"X-Consul-Namespace\" - Namespaces are a Consul Enterprise feature"}
}
if queryNS := req.URL.Query().Get("ns"); queryNS != "" {
return BadRequestError{Reason: "Invalid query parameter: \"ns\" - Namespaces is a Consul Enterprise feature"}
return BadRequestError{Reason: "Invalid query parameter: \"ns\" - Namespaces are a Consul Enterprise feature"}
}
return nil
}
@ -36,7 +36,7 @@ func (s *HTTPServer) rewordUnknownEnterpriseFieldError(err error) error {
switch quotedField {
case `"Namespace"`:
return fmt.Errorf("%v - Namespaces is a Consul Enterprise feature", err)
return fmt.Errorf("%v - Namespaces are a Consul Enterprise feature", err)
}
}
@ -47,7 +47,7 @@ func (s *HTTPServer) addEnterpriseHTMLTemplateVars(vars map[string]interface{})
func parseACLAuthMethodEnterpriseMeta(req *http.Request, _ *structs.ACLAuthMethodEnterpriseMeta) error {
if methodNS := req.URL.Query().Get("authmethod-ns"); methodNS != "" {
return BadRequestError{Reason: "Invalid query parameter: \"authmethod-ns\" - Namespaces is a Consul Enterprise feature"}
return BadRequestError{Reason: "Invalid query parameter: \"authmethod-ns\" - Namespaces are a Consul Enterprise feature"}
}
return nil

View File

@ -309,7 +309,7 @@ func DecodeConfigEntry(raw map[string]interface{}) (ConfigEntry, error) {
switch {
case k == "CreateIndex" || k == "ModifyIndex":
case strings.HasSuffix(strings.ToLower(k), "namespace"):
err = multierror.Append(err, fmt.Errorf("invalid config key %q, namespaces is a consul enterprise feature", k))
err = multierror.Append(err, fmt.Errorf("invalid config key %q, namespaces are a consul enterprise feature", k))
default:
err = multierror.Append(err, fmt.Errorf("invalid config key %q", k))
}

View File

@ -98,7 +98,7 @@ func TestDecodeConfigEntry(t *testing.T) {
Name = "terminating-gateway"
Namespace = "foo"
`,
expectErr: `invalid config key "namespace", namespaces is a consul enterprise feature`,
expectErr: `invalid config key "namespace", namespaces are a consul enterprise feature`,
},
{
name: "namespaces invalid deep",
@ -137,7 +137,7 @@ func TestDecodeConfigEntry(t *testing.T) {
},
]
`,
expectErr: `invalid config key "listeners[0].services[0].namespace", namespaces is a consul enterprise feature`,
expectErr: `invalid config key "listeners[0].services[0].namespace", namespaces are a consul enterprise feature`,
},
{
name: "service-defaults",

View File

@ -50,7 +50,7 @@ type ACLToken struct {
Rules string `json:",omitempty"`
// Namespace is the namespace the ACLToken is associated with.
// Namespaces is a Consul Enterprise feature.
// Namespaces are a Consul Enterprise feature.
Namespace string `json:",omitempty"`
}

View File

@ -79,7 +79,7 @@ func (f *HTTPFlags) NamespaceFlags() *flag.FlagSet {
fs.Var(&f.namespace, "namespace",
"Specifies the namespace to query. If not provided, the namespace will be inferred "+
"from the request's ACL token, or will default to the `default` namespace. "+
"Namespaces is a Consul Enterprise feature.")
"Namespaces are a Consul Enterprise feature.")
return fs
}

View File

@ -1 +1 @@
- `-namespace=<string>` - Specifies the namespace to query. If not provided, the namespace will be inferred from the request's ACL token, or will default to the `default` namespace. Namespaces is a Consul Enterprise feature added in v1.7.0.
- `-namespace=<string>` - Specifies the namespace to query. If not provided, the namespace will be inferred from the request's ACL token, or will default to the `default` namespace. Namespaces are a Consul Enterprise feature added in v1.7.0.