From 2c75ec2f9b73d9b61f4fdc93b7c8558a82dd3721 Mon Sep 17 00:00:00 2001 From: Luc DUZAN Date: Wed, 20 Mar 2024 11:42:21 +0100 Subject: [PATCH] Consistent message between live and dry run --- client/client.go | 9 --------- client/client_test.go | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/client/client.go b/client/client.go index 48c7c6e..7dbff31 100644 --- a/client/client.go +++ b/client/client.go @@ -74,15 +74,6 @@ func (client *Client) Apply(resource *resource.Resource, dryMode bool) (string, if err != nil { return resp.String(), nil } - if dryMode && upsertResponse.UpsertResult == "Created" { - return "To be created", nil - } - if dryMode && upsertResponse.UpsertResult == "Updated" { - return "To be updated", nil - } - if dryMode && upsertResponse.UpsertResult == "NotChanged" { - return "Nothing to do", nil - } return upsertResponse.UpsertResult, nil } diff --git a/client/client_test.go b/client/client_test.go index cc8dfb5..4370510 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -72,7 +72,7 @@ func TestApplyWithDryModeShouldWork(t *testing.T) { if err != nil { t.Error(err) } - if body != "Nothing to do" { + if body != "NotChanged" { t.Errorf("Bad result expected NotChanged got: %s", body) } }