2020-01-24 15:04:58 +00:00
|
|
|
// +build !consulent
|
|
|
|
|
|
|
|
package structs
|
|
|
|
|
2020-06-25 19:58:29 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/hashicorp/go-multierror"
|
|
|
|
)
|
|
|
|
|
2020-01-24 15:04:58 +00:00
|
|
|
func (e *ProxyConfigEntry) validateEnterpriseMeta() error {
|
|
|
|
return nil
|
|
|
|
}
|
2020-06-25 19:58:29 +00:00
|
|
|
|
|
|
|
func validateUnusedKeys(unused []string) error {
|
|
|
|
var err error
|
|
|
|
|
|
|
|
for _, k := range unused {
|
|
|
|
switch {
|
|
|
|
case k == "CreateIndex" || k == "ModifyIndex":
|
2021-05-04 21:27:56 +00:00
|
|
|
case k == "kind" || k == "Kind":
|
|
|
|
// The kind field is used to determine the target, but doesn't need
|
|
|
|
// to exist on the target.
|
2020-06-25 19:58:29 +00:00
|
|
|
case strings.HasSuffix(strings.ToLower(k), "namespace"):
|
|
|
|
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))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return err
|
|
|
|
}
|