Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(firewall): wrong wording when firewall is removed from resource #812

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/cmd/firewall/apply_to_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/firewall/apply_to_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might target many resources when using the label selector, but I think this is good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also add special messages like Firewall 123 applied to label selector xyz


assert.NoError(t, err)
assert.Empty(t, errOut)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/remove_from_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/firewall/remove_from_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down