Skip to content

Commit

Permalink
Resolve #711: CLI panics on domain update when domain doesn't exist (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
halakaraki authored Jun 12, 2018
1 parent 1a167d7 commit 85dbdf5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/cli/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ func (s *cliAppSuite) TestDomainUpdate_DomainNotExist() {
s.Nil(err)
}

func (s *cliAppSuite) TestDomainUpdate_ActiveClusterFlagNotSet_DomainNotExist() {
s.service.EXPECT().DescribeDomain(gomock.Any(), gomock.Any(), callOptions...).Return(nil, &shared.EntityNotExistsError{})
err := s.app.Run([]string{"", "--do", domainName, "domain", "update"})
s.Nil(err)
}

func (s *cliAppSuite) TestDomainUpdate_Failed() {
resp := describeDomainResponse
s.service.EXPECT().DescribeDomain(gomock.Any(), gomock.Any(), callOptions...).Return(resp, nil)
Expand Down
1 change: 1 addition & 0 deletions tools/cli/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func UpdateDomain(c *cli.Context) {
} else {
fmt.Printf("Domain %s does not exist.\n", domain)
}
return
}

description := resp.DomainInfo.GetDescription()
Expand Down

0 comments on commit 85dbdf5

Please sign in to comment.