Skip to content

Commit e985778

Browse files
authored
Merge branch 'main' into jaypipes/serverless
2 parents d370472 + 030b081 commit e985778

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

internal/temporalcli/commands.worker.deployment.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,10 @@ func (c *TemporalWorkerDeploymentSetCurrentVersionCommand) run(cctx *CommandCont
10281028
}
10291029
defer cl.Close()
10301030

1031+
if c.BuildId != "" && c.Unversioned {
1032+
return fmt.Errorf("specify either --build-id or --unversioned, not both")
1033+
}
1034+
10311035
token, err := c.Parent.getConflictToken(cctx, &getDeploymentConflictTokenOptions{
10321036
safeMode: !c.Yes,
10331037
safeModeMessage: "Current",

internal/temporalcli/commands.worker.deployment_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,17 @@ func (s *SharedServerSuite) TestDeployment_Set_Current_Version() {
196196
s.NoError(res.Err)
197197
s.NoError(json.Unmarshal(res.Stdout.Bytes(), &jsonVersionOut))
198198
s.Nil(jsonVersionOut.Metadata)
199+
200+
// --build-id and --unversioned are either/or. there should be an error if
201+
// the user specifies both flags.
202+
res = s.Execute(
203+
"worker", "deployment", "set-current-version",
204+
"--address", s.Address(),
205+
"--deployment-name", version.DeploymentName, "--build-id", version.BuildID,
206+
"--unversioned",
207+
)
208+
s.Error(res.Err)
209+
s.ErrorContains(res.Err, "specify either --build-id or --unversioned")
199210
}
200211

201212
func (s *SharedServerSuite) TestDeployment_Set_Current_Version_AllowNoPollers() {

0 commit comments

Comments
 (0)