From 9017a652907b17cee0be9500bc36d455ee51c49f Mon Sep 17 00:00:00 2001 From: phm07 <22707808+phm07@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:53:51 +0200 Subject: [PATCH] fix(firewall): wrong wording when firewall is removed from resource (#812) Closes #809 --- internal/cmd/firewall/apply_to_resource.go | 2 +- internal/cmd/firewall/apply_to_resource_test.go | 4 ++-- internal/cmd/firewall/remove_from_resource.go | 2 +- internal/cmd/firewall/remove_from_resource_test.go | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/cmd/firewall/apply_to_resource.go b/internal/cmd/firewall/apply_to_resource.go index 7bc334d5..bbb2337c 100644 --- a/internal/cmd/firewall/apply_to_resource.go +++ b/internal/cmd/firewall/apply_to_resource.go @@ -84,7 +84,7 @@ var ApplyToResourceCmd = base.Cmd{ if err := s.WaitForActions(cmd, s, actions...); err != nil { return err } - cmd.Printf("Firewall %d applied\n", firewall.ID) + cmd.Printf("Firewall %d applied to resource\n", firewall.ID) return nil }, diff --git a/internal/cmd/firewall/apply_to_resource_test.go b/internal/cmd/firewall/apply_to_resource_test.go index 2a9b0519..2116e431 100644 --- a/internal/cmd/firewall/apply_to_resource_test.go +++ b/internal/cmd/firewall/apply_to_resource_test.go @@ -43,7 +43,7 @@ func TestApplyToServer(t *testing.T) { out, errOut, err := fx.Run(cmd, []string{"--type", "server", "--server", "my-server", "test"}) - expOut := "Firewall 123 applied\n" + expOut := "Firewall 123 applied to resource\n" assert.NoError(t, err) assert.Empty(t, errOut) @@ -79,7 +79,7 @@ func TestApplyToLabelSelector(t *testing.T) { out, errOut, err := fx.Run(cmd, []string{"--type", "label_selector", "--label-selector", "my-label", "test"}) - expOut := "Firewall 123 applied\n" + expOut := "Firewall 123 applied to resource\n" assert.NoError(t, err) assert.Empty(t, errOut) diff --git a/internal/cmd/firewall/remove_from_resource.go b/internal/cmd/firewall/remove_from_resource.go index a7f37a94..b93385c0 100644 --- a/internal/cmd/firewall/remove_from_resource.go +++ b/internal/cmd/firewall/remove_from_resource.go @@ -83,7 +83,7 @@ var RemoveFromResourceCmd = base.Cmd{ if err := s.WaitForActions(cmd, s, actions...); err != nil { return err } - cmd.Printf("Firewall %d applied\n", firewall.ID) + cmd.Printf("Firewall %d removed from resource\n", firewall.ID) return nil }, diff --git a/internal/cmd/firewall/remove_from_resource_test.go b/internal/cmd/firewall/remove_from_resource_test.go index 862aa34f..2fb78346 100644 --- a/internal/cmd/firewall/remove_from_resource_test.go +++ b/internal/cmd/firewall/remove_from_resource_test.go @@ -43,7 +43,7 @@ func TestRemoveFromServer(t *testing.T) { out, errOut, err := fx.Run(cmd, []string{"--type", "server", "--server", "my-server", "test"}) - expOut := "Firewall 123 applied\n" + expOut := "Firewall 123 removed from resource\n" assert.NoError(t, err) assert.Empty(t, errOut) @@ -79,7 +79,7 @@ func TestRemoveFromLabelSelector(t *testing.T) { out, errOut, err := fx.Run(cmd, []string{"--type", "label_selector", "--label-selector", "my-label", "test"}) - expOut := "Firewall 123 applied\n" + expOut := "Firewall 123 removed from resource\n" assert.NoError(t, err) assert.Empty(t, errOut)