Skip to content

Commit

Permalink
Fix job update
Browse files Browse the repository at this point in the history
  • Loading branch information
wpjunior committed Sep 6, 2023
1 parent 44fd67a commit 423d692
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions tsuru/client/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,6 @@ type JobUpdate struct {
plan string
pool string
description string
commands string
image string
envs cmd.StringSliceFlag
privateEnvs cmd.StringSliceFlag
Expand All @@ -493,10 +492,9 @@ type JobUpdate struct {
func (c *JobUpdate) Info() *cmd.Info {
return &cmd.Info{
Name: "job-update",
Usage: "job update <job-name> [--image/-i <image>] [--commands/-c <commands>] [--plan/-p plan name] [--schedule/-s schedule name] [--team/-t team owner] [--pool/-o pool name] [--description/-d description] [--tag/-g tag]...",
Usage: "job update <job-name> [--image/-i <image>] [--plan/-p plan name] [--schedule/-s schedule name] [--team/-t team owner] [--pool/-o pool name] [--description/-d description] [--tag/-g tag]... -- [commands]",
Desc: "Updates a job",
MinArgs: 1,
MaxArgs: 1,
}
}

Expand Down Expand Up @@ -526,9 +524,6 @@ func (c *JobUpdate) Flags() *gnuflag.FlagSet {
c.fs.Var(&c.envs, "e", envMessage)
envMessage = "Private environment variable"
c.fs.Var(&c.privateEnvs, "private-env", envMessage)
commandsMessage := "New commands to execute on the job"
c.fs.StringVar(&c.commands, "commands", "", commandsMessage)
c.fs.StringVar(&c.commands, "c", "", commandsMessage)
imageMessage := "New image for the job to run"
c.fs.StringVar(&c.image, "image", "", imageMessage)
c.fs.StringVar(&c.image, "i", "", imageMessage)
Expand Down
3 changes: 3 additions & 0 deletions tsuru/client/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,9 @@ func (s *S) TestJobUpdate(c *check.C) {
}
client := cmd.NewClient(&http.Client{Transport: &trans}, nil, manager)
command := JobUpdate{}
c.Assert(command.Info().MinArgs, check.Equals, 1)
unlimitedMaxArgs := 0
c.Assert(command.Info().MaxArgs, check.Equals, unlimitedMaxArgs)
command.Flags().Parse(true, []string{"-i", "tsuru/scratch:latest"})
err := command.Run(&context, client)
c.Assert(err, check.IsNil)
Expand Down

0 comments on commit 423d692

Please sign in to comment.