From fecaf290885c1f3c509e1d5027fca0cc53d2b387 Mon Sep 17 00:00:00 2001 From: Vincent Shen Date: Mon, 27 Nov 2023 23:27:39 -0800 Subject: [PATCH] Fix warning message on rule check type changes Improve warning message on rule type change, explain to user what they might need to do on those rules --- pkg/controller/tailoredprofile/tailoredprofile_controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/tailoredprofile/tailoredprofile_controller.go b/pkg/controller/tailoredprofile/tailoredprofile_controller.go index d2fae2393..72a02b5a3 100644 --- a/pkg/controller/tailoredprofile/tailoredprofile_controller.go +++ b/pkg/controller/tailoredprofile/tailoredprofile_controller.go @@ -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