Skip to content

Commit

Permalink
fix: Verify that all required config file entries exist
Browse files Browse the repository at this point in the history
Fixes #874
  • Loading branch information
Göran Sander committed Dec 2, 2023
1 parent df72893 commit 38c42b0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/lib/assert/assert_config_file.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ const configFileStructureAssert = async (config, logger) => {
configFileCorrect = false;
}

if (!config.has('Butler.anonTelemetry')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.anonTelemetry"');
configFileCorrect = false;
}

if (!config.has('Butler.heartbeat.enable')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.heartbeat.enable"');
configFileCorrect = false;
Expand Down Expand Up @@ -564,6 +569,11 @@ const configFileStructureAssert = async (config, logger) => {
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.instanceTag')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.instanceTag"');
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.retentionPolicy.name')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.retentionPolicy.name"');
configFileCorrect = false;
Expand All @@ -574,6 +584,31 @@ const configFileStructureAssert = async (config, logger) => {
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.reloadTaskFailure.enable')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.reloadTaskFailure.enable"');
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.reloadTaskFailure.tailScriptLogLines')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.reloadTaskFailure.tailScriptLogLines"');
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.reloadTaskFailure.tag.static')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.reloadTaskFailure.tag.static"');
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.reloadTaskFailure.tag.dynamic.useAppTags')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.reloadTaskFailure.tag.dynamic.useAppTags"');
configFileCorrect = false;
}

if (!config.has('Butler.influxDb.reloadTaskFailure.tag.dynamic.useTaskTags')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.influxDb.reloadTaskFailure.tag.dynamic.useTaskTags"');
configFileCorrect = false;
}

if (!config.has('Butler.scriptLog.storeOnDisk.reloadTaskFailure.enable')) {
logger.error('ASSERT CONFIG: Missing config file entry "Butler.scriptLog.storeOnDisk.reloadTaskFailure.enable"');
configFileCorrect = false;
Expand Down

0 comments on commit 38c42b0

Please sign in to comment.