mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
icingadb-migrate: Verify env ID length
An env ID with the wrong length, either due to a copy-paste error or human error during testing, results in a SQL CHECK CONSTRAINT violation that is retried multiple times until it finally fails.
This commit is contained in:
parent
6102d9cb2e
commit
b7483eb6f8
1 changed files with 4 additions and 0 deletions
|
|
@ -71,6 +71,10 @@ func main() {
|
|||
_, _ = fmt.Fprintf(os.Stderr, "bad env ID: %s\n", err.Error())
|
||||
os.Exit(2)
|
||||
}
|
||||
if len(envId) != 20 {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "bad env ID: must be 20 bytes long, has %d bytes\n", len(envId))
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
defer func() { _ = log.Sync() }()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue