Shuffle config Verify/Defaults a bit around (#2459)

This commit is contained in:
Till 2022-05-13 09:33:55 +02:00 committed by GitHub
parent fc670f03a2
commit 870f9b0c3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 60 additions and 47 deletions

View file

@ -36,9 +36,10 @@ func (c *JetStream) Defaults(generate bool) {
}
func (c *JetStream) Verify(configErrs *ConfigErrors, isMonolith bool) {
if isMonolith { // polylith required configs below
return
}
// If we are running in a polylith deployment then we need at least
// one NATS JetStream server to talk to.
if !isMonolith {
checkNotZero(configErrs, "global.jetstream.addresses", int64(len(c.Addresses)))
}
checkNotZero(configErrs, "global.jetstream.addresses", int64(len(c.Addresses)))
}