Skip to content

Commit

Permalink
cli: Output message on success writing config entry
Browse files Browse the repository at this point in the history
  • Loading branch information
crhino committed May 7, 2020
1 parent f0df674 commit 330aa89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion command/config/write/config_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (c *cmd) Run(args []string) int {
return 1
}

// TODO (mkeeler) should we output anything when successful
c.UI.Info(fmt.Sprintf("Config entry %q / %q updated successfully", entry.GetKind(), entry.GetName()))
return 0
}

Expand Down
4 changes: 4 additions & 0 deletions command/config/write/config_write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ func TestConfigWrite(t *testing.T) {

code := c.Run(args)
require.Empty(t, ui.ErrorWriter.String())
require.Contains(t, ui.OutputWriter.String(),
`Config entry "service-defaults" / "web" updated successfully`)
require.Equal(t, 0, code)

entry, _, err := client.ConfigEntries().Get("service-defaults", "web", nil)
Expand Down Expand Up @@ -85,6 +87,8 @@ func TestConfigWrite(t *testing.T) {

code := c.Run(args)
require.Empty(t, ui.ErrorWriter.String())
require.Contains(t, ui.OutputWriter.String(),
`Config entry "proxy-defaults" / "global" updated successfully`)
require.Equal(t, 0, code)

entry, _, err := client.ConfigEntries().Get(api.ProxyDefaults, api.ProxyConfigGlobal, nil)
Expand Down

0 comments on commit 330aa89

Please sign in to comment.