Skip to content

Commit

Permalink
fix: check correct message for successful deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
crgisch committed Oct 22, 2024
1 parent 155eb5e commit d104448
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tsuru/client/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ Use the --job/-j flag to specify it.
if readErr != io.EOF {
return fmt.Errorf("error reading response: %v", readErr)
}
if strings.HasSuffix(buf.String(), "\nOK\n") {
if strings.HasSuffix(buf.String(), "\nDeploy finished with success!\n") {
return nil
}
return cmd.ErrAbortCommand
Expand Down
6 changes: 3 additions & 3 deletions tsuru/client/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func (s *S) TestJobDeployRunUsingDockerfile(c *check.C) {
ctx := &cmd.Context{Stdout: io.Discard, Stderr: io.Discard, Args: command.Flags().Args()}

trans := &cmdtest.ConditionalTransport{
Transport: cmdtest.Transport{Message: "deployed\nOK\n", Status: http.StatusOK},
Transport: cmdtest.Transport{Message: "deployed\nDeploy finished with success!\n", Status: http.StatusOK},
CondFunc: func(req *http.Request) bool {
if req.Body != nil {
defer req.Body.Close()
Expand Down Expand Up @@ -598,7 +598,7 @@ func (s *S) TestJobDeployRunUsingDockerfile(c *check.C) {

func (s *S) TestJobDeployRunUsingImage(c *check.C) {
trans := cmdtest.ConditionalTransport{
Transport: cmdtest.Transport{Message: "deploy worked\nOK\n", Status: http.StatusOK},
Transport: cmdtest.Transport{Message: "deploy worked\nDeploy finished with success!\n", Status: http.StatusOK},
CondFunc: func(req *http.Request) bool {
if req.Body != nil {
defer req.Body.Close()
Expand Down Expand Up @@ -698,7 +698,7 @@ func (s *S) TestJobDeployRunWithMessage(c *check.C) {
c.Assert(err, check.IsNil)

trans := cmdtest.ConditionalTransport{
Transport: cmdtest.Transport{Message: "deploy worked\nOK\n", Status: http.StatusOK},
Transport: cmdtest.Transport{Message: "deploy worked\nDeploy finished with success!\n", Status: http.StatusOK},
CondFunc: func(req *http.Request) bool {
if req.Body != nil {
defer req.Body.Close()
Expand Down

0 comments on commit d104448

Please sign in to comment.