Browse Source

api accepts machine_type param

Alexander Belanger 5 years ago
parent
commit
4ee15e059e
3 changed files with 5 additions and 1 deletions
  1. 1 0
      internal/forms/infra.go
  2. 2 1
      internal/kubernetes/agent.go
  3. 2 0
      server/api/provision_handler.go

+ 1 - 0
internal/forms/infra.go

@@ -48,6 +48,7 @@ func (ce *CreateECRInfra) ToInfra() (*models.Infra, error) {
 // EKS infra via the provisioning container
 type CreateEKSInfra struct {
 	EKSName          string `json:"eks_name" form:"required"`
+	MachineType      string `json:"machine_type"`
 	ProjectID        uint   `json:"project_id" form:"required"`
 	AWSIntegrationID uint   `json:"aws_integration_id" form:"required"`
 }

+ 2 - 1
internal/kubernetes/agent.go

@@ -312,7 +312,7 @@ func (a *Agent) ProvisionECR(
 func (a *Agent) ProvisionEKS(
 	projectID uint,
 	awsConf *integrations.AWSIntegration,
-	eksName string,
+	eksName, machineType string,
 	repo repository.Repository,
 	infra *models.Infra,
 	operation provisioner.ProvisionerOperation,
@@ -337,6 +337,7 @@ func (a *Agent) ProvisionEKS(
 		},
 		EKS: &eks.Conf{
 			ClusterName: eksName,
+			MachineType: machineType,
 		},
 	}
 

+ 2 - 0
server/api/provision_handler.go

@@ -389,6 +389,7 @@ func (app *App) HandleProvisionAWSEKSInfra(w http.ResponseWriter, r *http.Reques
 		uint(projID),
 		awsInt,
 		form.EKSName,
+		form.MachineType,
 		*app.Repo,
 		infra,
 		provisioner.Apply,
@@ -481,6 +482,7 @@ func (app *App) HandleDestroyAWSEKSInfra(w http.ResponseWriter, r *http.Request)
 		infra.ProjectID,
 		awsInt,
 		form.EKSName,
+		"",
 		*app.Repo,
 		infra,
 		provisioner.Destroy,