From c4d7ed314aabae73a2a16a349bcec3100beca5d9 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Fri, 13 Feb 2026 10:48:17 +0100 Subject: [PATCH] Move Redis Schema Version to internal/version.go After moving the database schema version number to the internal/version.go file, the Redis schema version was moved there as well. Now there is only one place left in the codebase to define versions. This reflects the release issue template, listing the internal/version.go to be checked. --- cmd/icingadb/main.go | 9 ++++----- internal/version.go | 5 +++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/icingadb/main.go b/cmd/icingadb/main.go index 1cfc64a6..f17fc4a2 100644 --- a/cmd/icingadb/main.go +++ b/cmd/icingadb/main.go @@ -29,9 +29,8 @@ import ( ) const ( - ExitSuccess = 0 - ExitFailure = 1 - expectedRedisSchemaVersion = "6" + ExitSuccess = 0 + ExitFailure = 1 ) func main() { @@ -421,13 +420,13 @@ func checkRedisSchema(logger *logging.Logger, rc *redis.Client, pos string) (new } message := streams[0].Messages[0] - if version := message.Values["version"]; version != expectedRedisSchemaVersion { + if version := message.Values["version"]; version != internal.RedisSchemaVersion { // Since these error messages are trivial and mostly caused by users, we don't need // to print a stack trace here. However, since errors.Errorf() does this automatically, // we need to use fmt instead. return "", fmt.Errorf( "unexpected Redis schema version: %q (expected %q), please make sure you are running compatible"+ - " versions of Icinga 2 and Icinga DB", version, expectedRedisSchemaVersion, + " versions of Icinga 2 and Icinga DB", version, internal.RedisSchemaVersion, ) } diff --git a/internal/version.go b/internal/version.go index 3094be44..2bdda2f6 100644 --- a/internal/version.go +++ b/internal/version.go @@ -33,3 +33,8 @@ var PgSqlSchemaVersions = map[uint16]string{ 4: "1.2.1", 5: "1.4.0", } + +// RedisSchemaVersion is the expected Redis schema version. +// +// This version must match between Icinga 2 and Icinga DB. +var RedisSchemaVersion = "6"