Skip to content

Commit

Permalink
fix executor update (#1499)
Browse files Browse the repository at this point in the history
* fix executor update

* fix executor update

* remove debug
  • Loading branch information
sunkickr committed Jan 29, 2024
1 parent 114c036 commit 3116aba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cloud/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ const (
)

var (
sleepTime = 180
tickNum = 10
timeoutNum = 180
sleepTime = 180
tickNum = 10
timeoutNum = 180
dedicatedDeploymentRequest = astroplatformcore.UpdateDedicatedDeploymentRequest{}
)

func newTableOut() *printutil.Table {
Expand Down Expand Up @@ -934,7 +935,7 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
case KubeExecutor:
requestedExecutor = astroplatformcore.UpdateDedicatedDeploymentRequestExecutorKUBERNETES
}
dedicatedDeploymentRequest := astroplatformcore.UpdateDedicatedDeploymentRequest{
dedicatedDeploymentRequest = astroplatformcore.UpdateDedicatedDeploymentRequest{
Description: &description,
Name: name,
Executor: requestedExecutor,
Expand Down Expand Up @@ -973,6 +974,7 @@ func Update(deploymentID, name, ws, description, deploymentName, dagDeploy, exec
case astroplatformcore.UpdateDedicatedDeploymentRequestExecutorKUBERNETES:
if *currentDeployment.Executor == astroplatformcore.DeploymentExecutorCELERY {
confirmWithUser = true
dedicatedDeploymentRequest.WorkerQueues = nil
}
}
err := updateDeploymentRequest.FromUpdateDedicatedDeploymentRequest(dedicatedDeploymentRequest)
Expand Down
1 change: 1 addition & 0 deletions cloud/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,7 @@ func TestUpdate(t *testing.T) { //nolint
err = Update("test-id-1", "", ws, "update", "", "", KubeExecutor, "medium", "enable", "disable", "", "", "", "", 0, 0, workerQueueRequest, hybridQueueList, newEnvironmentVariables, false, mockCoreClient, mockPlatformCoreClient)

assert.NoError(t, err)
assert.Equal(t, (*[]astroplatformcore.WorkerQueueRequest)(nil), dedicatedDeploymentRequest.WorkerQueues)
mockCoreClient.AssertExpectations(t)
mockPlatformCoreClient.AssertExpectations(t)
})
Expand Down

0 comments on commit 3116aba

Please sign in to comment.