diff --git a/cloud/deployment/fromfile/fromfile.go b/cloud/deployment/fromfile/fromfile.go index cb4c0d002..96f36d019 100644 --- a/cloud/deployment/fromfile/fromfile.go +++ b/cloud/deployment/fromfile/fromfile.go @@ -242,6 +242,8 @@ func getCreateOrUpdateInput(deploymentFromFile *inspect.FormattedDeployment, clu RuntimeReleaseVersion: deploymentFromFile.Deployment.Configuration.RunTimeVersion, DagDeployEnabled: deploymentFromFile.Deployment.Configuration.DagDeployEnabled, SchedulerSize: deploymentFromFile.Deployment.Configuration.SchedulerSize, + APIKeyOnlyDeployments: deploymentFromFile.Deployment.Configuration.APIKeyOnlyDeployments, + IsHighAvailability: deploymentFromFile.Deployment.Configuration.IsHighAvailability, DeploymentSpec: astro.DeploymentCreateSpec{ Executor: deploymentFromFile.Deployment.Configuration.Executor, Scheduler: astro.Scheduler{ @@ -258,12 +260,14 @@ func getCreateOrUpdateInput(deploymentFromFile *inspect.FormattedDeployment, clu fmt.Errorf("changing an existing deployment's cluster %w", errNotPermitted) } updateInput = astro.UpdateDeploymentInput{ - ID: existingDeployment.ID, - ClusterID: clusterID, - Label: deploymentFromFile.Deployment.Configuration.Name, - Description: deploymentFromFile.Deployment.Configuration.Description, - DagDeployEnabled: deploymentFromFile.Deployment.Configuration.DagDeployEnabled, - SchedulerSize: deploymentFromFile.Deployment.Configuration.SchedulerSize, + ID: existingDeployment.ID, + ClusterID: clusterID, + Label: deploymentFromFile.Deployment.Configuration.Name, + Description: deploymentFromFile.Deployment.Configuration.Description, + DagDeployEnabled: deploymentFromFile.Deployment.Configuration.DagDeployEnabled, + SchedulerSize: deploymentFromFile.Deployment.Configuration.SchedulerSize, + APIKeyOnlyDeployments: deploymentFromFile.Deployment.Configuration.APIKeyOnlyDeployments, + IsHighAvailability: deploymentFromFile.Deployment.Configuration.IsHighAvailability, DeploymentSpec: astro.DeploymentCreateSpec{ Executor: deploymentFromFile.Deployment.Configuration.Executor, Scheduler: astro.Scheduler{ diff --git a/cloud/deployment/fromfile/fromfile_test.go b/cloud/deployment/fromfile/fromfile_test.go index facc8f2a4..6ddb1b593 100644 --- a/cloud/deployment/fromfile/fromfile_test.go +++ b/cloud/deployment/fromfile/fromfile_test.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "net/http" + "strconv" "testing" "github.com/astronomer/astro-cli/astro-client" @@ -1022,6 +1023,8 @@ deployment: cluster_name: test-cluster workspace_name: test-workspace deployment_type: HOSTED_DEDICATED + is_high_availability: true + ci_cd_enforcement: true worker_queues: - name: default is_default: true @@ -1112,6 +1115,8 @@ deployment: err = CreateOrUpdate("deployment.yaml", "create", mockClient, mockCoreClient, out) assert.NoError(t, err) assert.Contains(t, out.String(), "configuration:\n name: "+createdDeployment.Label) + assert.Contains(t, out.String(), "ci_cd_enforcement: "+strconv.FormatBool(createdDeployment.APIKeyOnlyDeployments)) + assert.Contains(t, out.String(), "is_high_availability: "+strconv.FormatBool(createdDeployment.IsHighAvailability)) assert.Contains(t, out.String(), "metadata:\n deployment_id: "+createdDeployment.ID) mockClient.AssertExpectations(t) mockCoreClient.AssertExpectations(t)