From c69f7bf60db6c37e757521403ed4faa04326bee7 Mon Sep 17 00:00:00 2001 From: Chin-Ya Huang Date: Fri, 28 Jul 2023 13:30:42 +0800 Subject: [PATCH] fix(telemetric): collect SettingNameSnapshotDataIntegrityCronJob setting as boolean ref: 6410 Signed-off-by: Chin-Ya Huang (cherry picked from commit c4924b495d79ec8430cdc4022c811090306cebc3) --- controller/setting_controller.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/controller/setting_controller.go b/controller/setting_controller.go index a06cc8d5c8..11e1bd6211 100644 --- a/controller/setting_controller.go +++ b/controller/setting_controller.go @@ -1318,6 +1318,7 @@ func (info *ClusterInfo) collectSettings() error { types.SettingNameSystemManagedComponentsNodeSelector: true, types.SettingNameRegistrySecret: true, types.SettingNamePriorityClass: true, + types.SettingNameSnapshotDataIntegrityCronJob: true, types.SettingNameStorageNetwork: true, } @@ -1360,7 +1361,6 @@ func (info *ClusterInfo) collectSettings() error { types.SettingNameRestoreConcurrentLimit: true, types.SettingNameRestoreVolumeRecurringJobs: true, types.SettingNameSnapshotDataIntegrity: true, - types.SettingNameSnapshotDataIntegrityCronJob: true, types.SettingNameSnapshotDataIntegrityImmediateCheckAfterSnapshotCreation: true, types.SettingNameStorageMinimalAvailablePercentage: true, types.SettingNameStorageOverProvisioningPercentage: true, @@ -1387,7 +1387,12 @@ func (info *ClusterInfo) collectSettings() error { // Setting that should be collected as boolean (true if configured, false if not) case includeAsBoolean[settingName]: - settingMap[setting.Name] = setting.Value != "" + definition, ok := types.GetSettingDefinition(types.SettingName(setting.Name)) + if !ok { + logrus.WithError(err).Warnf("Failed to get Setting %v definition", setting.Name) + continue + } + settingMap[setting.Name] = setting.Value != definition.Default // Setting value case include[settingName]: