Skip to content

Commit

Permalink
fix(telemetric): collect SettingNameSnapshotDataIntegrityCronJob sett…
Browse files Browse the repository at this point in the history
…ing as boolean

ref: 6410

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
(cherry picked from commit c4924b4)
  • Loading branch information
c3y1huang authored and PhanLe1010 committed Aug 2, 2023
1 parent 1153859 commit c69f7bf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/setting_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,7 @@ func (info *ClusterInfo) collectSettings() error {
types.SettingNameSystemManagedComponentsNodeSelector: true,
types.SettingNameRegistrySecret: true,
types.SettingNamePriorityClass: true,
types.SettingNameSnapshotDataIntegrityCronJob: true,
types.SettingNameStorageNetwork: true,
}

Expand Down Expand Up @@ -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,
Expand All @@ -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]:
Expand Down

0 comments on commit c69f7bf

Please sign in to comment.