check for valid name in kafka-config (#2321)

This commit is contained in:
Jacob Brinlee 2023-03-16 09:16:31 -05:00 committed by GitHub
parent c10762220a
commit ada48be181
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,9 @@ func ValidateConfig(c Config) error {
if c.Fields[i].PrimaryKey {
found++
}
if c.Fields[i].Name == "" {
return errors.Errorf("a name attribute (which isn't equal to \"\") should exist for all fields")
}
}
if found != 1 {
return errors.Errorf("exactly one primary key field is required")