Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Commit

Permalink
Don't blow up when KUBE_AWS_S3_DIR_URI does not parse correctly - dis…
Browse files Browse the repository at this point in the history
…play the error and fail.
  • Loading branch information
davidmccormick committed Mar 22, 2018
1 parent f6d4dd4 commit b8892c3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/integration/maincluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration

import (
"fmt"
"log"
"os"
"reflect"
"regexp"
Expand Down Expand Up @@ -29,16 +30,17 @@ func TestMainClusterConfig(t *testing.T) {
if !s3URIExists || s3URI == "" {
s3URI = "s3://mybucket/mydir"
t.Logf(`Falling back s3URI to a stub value "%s" for tests of validating stack templates. No assets will actually be uploaded to S3`, s3URI)
} else {
log.Printf("s3URI is %s", s3URI)
}

s3Loc, err := cfnstack.S3URIFromString(s3URI)
s3Bucket := s3Loc.Bucket()
s3Dir := s3Loc.PathComponents()[0]

if err != nil {
t.Errorf("failed to parse s3 uri: %v", err)
t.FailNow()
}
s3Bucket := s3Loc.Bucket()
s3Dir := s3Loc.PathComponents()[0]

firstAz := kubeAwsSettings.region + "c"

Expand Down Expand Up @@ -3062,7 +3064,7 @@ worker:
hasDefaultExperimentalFeatures,
func(c *config.Config, t *testing.T) {
if len(c.NodePools[0].IAMConfig.Role.ManagedPolicies) < 2 {
t.Errorf("iam.role.managedPolicies: incorrect number of policies expected=2 actual=%s", len(c.NodePools[0].IAMConfig.Role.ManagedPolicies))
t.Errorf("iam.role.managedPolicies: incorrect number of policies expected=2 actual=%d", len(c.NodePools[0].IAMConfig.Role.ManagedPolicies))
}
if c.NodePools[0].IAMConfig.Role.ManagedPolicies[0].Arn != "arn:aws:iam::aws:policy/AdministratorAccess" {
t.Errorf("iam.role.managedPolicies: expected=arn:aws:iam::aws:policy/AdministratorAccess actual=%s", c.NodePools[0].IAMConfig.Role.ManagedPolicies[0].Arn)
Expand Down

0 comments on commit b8892c3

Please sign in to comment.