Skip to content

Commit

Permalink
Merge pull request #36 from robertchoi80/main
Browse files Browse the repository at this point in the history
add validation for numOfAz
  • Loading branch information
ktkfree authored Mar 23, 2022
2 parents 82e7ad5 + c6e8d7f commit e752470
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

var (
filePathAzRegion = "./az-per-region.txt"
filePathAzRegion = "./az-per-region.txt"
)

const MAX_SIZE_PER_AZ = 99
Expand Down Expand Up @@ -75,6 +75,12 @@ func constructClusterConf(rawConf *pb.ClusterRawConf) (clusterConf *pb.ClusterCo
numOfAz := 3
if rawConf != nil && rawConf.NumOfAz != 0 {
numOfAz = int(rawConf.NumOfAz)

if numOfAz > 3 {
log.Error("Error: numOfAz cannot exceed 3.")
temp_err := fmt.Errorf("Error: numOfAz cannot exceed 3.")
return nil, temp_err
}
}

sshKeyName := "tks-seoul"
Expand Down Expand Up @@ -471,7 +477,6 @@ func (s *server) InstallAppGroups(ctx context.Context, in *pb.InstallAppGroupsRe
workflowTemplate = "tks-lma-federation"
parameters = append(parameters, "logging_component=efk")


case pb.AppGroupType_SERVICE_MESH:
workflowTemplate = "tks-service-mesh"

Expand Down

0 comments on commit e752470

Please sign in to comment.