From b8892c35e84350effe3577b2ce016b4c48a191dc Mon Sep 17 00:00:00 2001 From: David McCormick Date: Thu, 22 Mar 2018 14:35:44 +0000 Subject: [PATCH] Don't blow up when KUBE_AWS_S3_DIR_URI does not parse correctly - display the error and fail. --- test/integration/maincluster_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/integration/maincluster_test.go b/test/integration/maincluster_test.go index 153478372..ec1b847b2 100644 --- a/test/integration/maincluster_test.go +++ b/test/integration/maincluster_test.go @@ -2,6 +2,7 @@ package integration import ( "fmt" + "log" "os" "reflect" "regexp" @@ -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" @@ -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)