Skip to content

Commit

Permalink
Fix LB priorities and leave gap for custom rules
Browse files Browse the repository at this point in the history
Leave 1-200 empty for users to create their own custom rules. Forgot to
generate a seed for review app rules.
  • Loading branch information
ipmb committed Apr 9, 2021
1 parent 2e4c915 commit d430db6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ func createAppOrPipeline(cmd *cobra.Command, args []string, pipeline bool) {
},
{
ParameterKey: aws.String("LoadBalancerRulePriority"),
ParameterValue: aws.String(fmt.Sprintf("%d", rand.Intn(50000-1)+1)), // TODO: verify empty slot
ParameterValue: aws.String(fmt.Sprintf("%d", rand.Intn(50000-200)+200)), // TODO: verify empty slot
},
{
ParameterKey: aws.String("Name"),
Expand Down
4 changes: 3 additions & 1 deletion cmd/reviewapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"fmt"
"math/rand"
"strings"
"time"

"github.com/apppackio/apppack/app"
"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -186,6 +187,7 @@ var reviewappsCreateCmd = &cobra.Command{
checkErr(err)
parameters, err := pipelineCfnParameters(stack)
checkErr(err)
rand.Seed(time.Now().UnixNano())
parameters = append(parameters, []*cloudformation.Parameter{
{
ParameterKey: aws.String("Name"),
Expand All @@ -197,7 +199,7 @@ var reviewappsCreateCmd = &cobra.Command{
},
{
ParameterKey: aws.String("LoadBalancerRulePriority"),
ParameterValue: aws.String(fmt.Sprintf("%d", rand.Intn(50000-1)+1)),
ParameterValue: aws.String(fmt.Sprintf("%d", rand.Intn(50000-200)+200)),
},
}...)
err = createStackOrChangeSet(a.Session, &cloudformation.CreateStackInput{
Expand Down

0 comments on commit d430db6

Please sign in to comment.