server: add OSS stubs supporting validation of source namespaces in service-intentions config entries (#9527)

This commit is contained in:
R.B. Boyer 2021-01-25 11:27:38 -06:00 committed by GitHub
parent 9f4c52612c
commit e3f5a77ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

3
.changelog/9527.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
server: **(Enterprise Only)** Validate source namespaces in service-intentions config entries.
```

View File

@ -567,6 +567,10 @@ func (e *ServiceIntentionsConfigEntry) validate(legacyWrite bool) error {
return fmt.Errorf("Sources[%d].%v", i, err)
}
if err := validateSourceIntentionEnterpriseMeta(&src.EnterpriseMeta); err != nil {
return fmt.Errorf("Sources[%d].%v", i, err)
}
// Length of opaque values
if len(src.Description) > metaValueMaxLength {
return fmt.Errorf(

View File

@ -0,0 +1,7 @@
// +build !consulent
package structs
func validateSourceIntentionEnterpriseMeta(_ *EnterpriseMeta) error {
return nil
}