]> granicus.if.org Git - icinga2/commitdiff
Cluster sync: Don't load/sync the .authoritative config file marker
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 6 Jun 2019 15:45:43 +0000 (17:45 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 12:46:11 +0000 (14:46 +0200)
This would influence everything else, and it isn't needed anywhere
but the master instance (zones.d -> var-zones).

lib/remote/apilistener-filesync.cpp

index 531748737c93a1f88ba25f435848f574cdcc6191..6279be5cc45d8a3260b0845488cc7168e0ad779b 100644 (file)
@@ -684,6 +684,10 @@ ConfigDirInformation ApiListener::LoadConfigDir(const String& dir)
  */
 void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String& path, const String& file)
 {
+       /* Avoid loading the authoritative marker for syncs. */
+       if (Utility::BaseName(file) == ".authoritative")
+               return;
+
        CONTEXT("Creating config update for file '" + file + "'");
 
        Log(LogNotice, "ApiListener")
@@ -710,7 +714,10 @@ void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String&
 
        update->Set(relativePath, content);
 
-       /* Calculate a checksum for each file (and a global one later). */
+       /* Calculate a checksum for each file (and a global one later).
+        *
+        * IMPORTANT: Ignore the .authoritative file, this will not be synced.
+        * */
        config.Checksums->Set(relativePath, GetChecksum(content));
 }