Skip to content

Commit

Permalink
Merge pull request #7120 from Icinga/bugfix/cluster-ignore-non-config…
Browse files Browse the repository at this point in the history
…ured-zones

Ignore synced config zones where no config item exists
  • Loading branch information
Michael Friedrich authored Apr 16, 2019
2 parents e0d9814 + 44d0c90 commit ab9b4b7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/cli/daemonutility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ static void IncludeZoneDirRecursive(const String& path, const String& package, b
{
String zoneName = Utility::BaseName(path);

/* We don't have an activated zone object yet. We may forcefully guess from configitems
* to not include this specific synced zones directory.
*/
if(!ConfigItem::GetByTypeAndName(Type::GetByName("Zone"), zoneName)) {
Log(LogWarning, "config")
<< "Ignoring directory '" << path << "' for unknown zone '" << zoneName << "'.";
return;
}

/* register this zone path for cluster config sync */
ConfigCompiler::RegisterZoneDir("_etc", path, zoneName);

Expand All @@ -48,6 +57,15 @@ static void IncludeNonLocalZone(const String& zonePath, const String& package, b

String zoneName = Utility::BaseName(zonePath);

/* We don't have an activated zone object yet. We may forcefully guess from configitems
* to not include this specific synced zones directory.
*/
if(!ConfigItem::GetByTypeAndName(Type::GetByName("Zone"), zoneName)) {
Log(LogWarning, "config")
<< "Ignoring directory '" << zonePath << "' for unknown zone '" << zoneName << "'.";
return;
}

/* Check whether this node already has an authoritative config version
* from zones.d in etc or api package directory, or a local marker file)
*/
Expand Down

0 comments on commit ab9b4b7

Please sign in to comment.