Skip to content

Commit

Permalink
Fix warning message on rule check type changes
Browse files Browse the repository at this point in the history
Improve warning message on rule type change, explain to user what they might need to do on those rules
  • Loading branch information
Vincent056 committed Nov 28, 2023
1 parent 97c70ee commit fecaf29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/tailoredprofile/tailoredprofile_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ func generateWarningMessage(ruleNeedToBeMigratedList []string) string {
var warningMessage string
if len(ruleNeedToBeMigratedList) > 0 {
if warningMessage != "" {
warningMessage = fmt.Sprintf("%sThe following rules are migrated and need to be migrated or removed from the TailoredProfile: %s\n", warningMessage, strings.Join(ruleNeedToBeMigratedList, ","))
warningMessage = fmt.Sprintf("%sThe following rules changed check type and need to be removed from the TailoredProfile. If these rules are important for you, add them to a TailoredProfile of matching check type: %s\n", warningMessage, strings.Join(ruleNeedToBeMigratedList, ","))
} else {
warningMessage = fmt.Sprintf("The following rules are migrated and need to be migrated or removed from the TailoredProfile: %s\n", strings.Join(ruleNeedToBeMigratedList, ","))
warningMessage = fmt.Sprintf("The following rules changed check type and need to be removed from the TailoredProfile. If these rules are important for you, add them to a TailoredProfile of matching check type: %s\n", strings.Join(ruleNeedToBeMigratedList, ","))
}
}
return warningMessage
Expand Down

0 comments on commit fecaf29

Please sign in to comment.