From 787d6de696338356820e482545b5e5101824aba3 Mon Sep 17 00:00:00 2001 From: Sachin <57769917+slayer321@users.noreply.github.com> Date: Wed, 13 Oct 2021 11:00:04 -0700 Subject: [PATCH] unnecessary use of fmt.Sprintf (#2531) Signed-off-by: slayer321 --- pkg/engine/mutate/overlay.go | 2 +- pkg/engine/mutate/patchJson6902.go | 2 +- pkg/engine/mutate/patches.go | 2 +- test/e2e/validate/validate_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/engine/mutate/overlay.go b/pkg/engine/mutate/overlay.go index 92f781f447..461e2a772b 100644 --- a/pkg/engine/mutate/overlay.go +++ b/pkg/engine/mutate/overlay.go @@ -99,7 +99,7 @@ func ProcessOverlay(log logr.Logger, ruleName string, overlay interface{}, resou // rule application successfully resp.Status = response.RuleStatusPass - resp.Message = fmt.Sprintf("successfully processed overlay") + resp.Message = string("successfully processed overlay") resp.Patches = patches return resp, patchedResource diff --git a/pkg/engine/mutate/patchJson6902.go b/pkg/engine/mutate/patchJson6902.go index 5b62a1c9f7..82500f89dc 100644 --- a/pkg/engine/mutate/patchJson6902.go +++ b/pkg/engine/mutate/patchJson6902.go @@ -62,7 +62,7 @@ func ProcessPatchJSON6902(ruleName string, patchesJSON6902 []byte, resource unst } resp.Status = response.RuleStatusPass - resp.Message = fmt.Sprintf("successfully process JSON6902 patches") + resp.Message = string("successfully process JSON6902 patches") resp.Patches = patchesBytes return resp, patchedResource } diff --git a/pkg/engine/mutate/patches.go b/pkg/engine/mutate/patches.go index 231ae5c43c..f6c362e441 100644 --- a/pkg/engine/mutate/patches.go +++ b/pkg/engine/mutate/patches.go @@ -86,7 +86,7 @@ func ProcessPatches(log logr.Logger, ruleName string, mutation kyverno.Mutation, // JSON patches processed successfully resp.Status = response.RuleStatusPass - resp.Message = fmt.Sprintf("successfully process JSON patches") + resp.Message = string("successfully process JSON patches") resp.Patches = patches return resp, patchedResource } diff --git a/test/e2e/validate/validate_test.go b/test/e2e/validate/validate_test.go index d581d66304..6d5a1cc0cc 100644 --- a/test/e2e/validate/validate_test.go +++ b/test/e2e/validate/validate_test.go @@ -45,7 +45,7 @@ func Test_Validate_Flux_Sets(t *testing.T) { By(fmt.Sprintf("Test to validate objects: \"%s\"", test.TestName)) // Clean up Resources - By(fmt.Sprintf("Cleaning Cluster Policies")) + By(string("Cleaning Cluster Policies")) e2eClient.CleanClusterPolicies(policyGVR) // Clear Namespace By(fmt.Sprintf("Deleting Namespace: \"%s\"", nspace))