Skip to content

Commit

Permalink
Merge pull request #182 from openinfradev/cloud_account_fix
Browse files Browse the repository at this point in the history
trivial. workarround fix for aws creation
  • Loading branch information
zugwan authored Oct 27, 2023
2 parents d5fb91e + 0305998 commit 8840796
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/usecase/stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (u *StackUsecase) Create(ctx context.Context, dto domain.Stack) (stackId do
return "", httpErrors.NewBadRequestError(httpErrors.DuplicateResource, "S_CREATE_ALREADY_EXISTED_NAME", "")
}

_, err = u.stackTemplateRepo.Get(dto.StackTemplateId)
stackTemplate, err := u.stackTemplateRepo.Get(dto.StackTemplateId)
if err != nil {
return "", httpErrors.NewInternalServerError(errors.Wrap(err, "Invalid stackTemplateId"), "S_INVALID_STACK_TEMPLATE", "")
}
Expand Down Expand Up @@ -106,6 +106,13 @@ func (u *StackUsecase) Create(ctx context.Context, dto domain.Stack) (stackId do
if err = domain.Map(dto.Conf, &stackConf); err != nil {
log.InfoWithContext(ctx, err)
}
if stackTemplate.CloudService == "AWS" && stackTemplate.KubeType == "AWS" {
if stackConf.TksCpNode == 0 {
stackConf.TksCpNode = 3
stackConf.TksCpNodeMax = 3

}
}

workflow := "tks-stack-create"
workflowId, err := u.argo.SumbitWorkflowFromWftpl(workflow, argowf.SubmitOptions{
Expand Down

0 comments on commit 8840796

Please sign in to comment.