From 7e4af9a66bf68f4e2211817b7a90ac0e9e1c0769 Mon Sep 17 00:00:00 2001 From: "Kenneth D. Evensen" Date: Sat, 2 Jul 2016 05:58:25 -0400 Subject: [PATCH 1/3] Added flag to skip zone check --- pkg/cloudprovider/providers/aws/aws.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 37c042923e6..ef9331b2677 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -300,6 +300,8 @@ type CloudConfig struct { //has setup a rule that allows inbound traffic on kubelet ports from the //local VPC subnet (so load balancers can access it). E.g. 10.82.0.0/16 30000-32000. DisableSecurityGroupIngress bool + + DisableStrictZoneCheck bool } } @@ -664,9 +666,13 @@ func newAWSCloud(config io.Reader, awsServices Services) (*Cloud, error) { return nil, err } - valid := isRegionValid(regionName) - if !valid { - return nil, fmt.Errorf("not a valid AWS zone (unknown region): %s", zone) + if !cfg.Global.DisableStrictZoneCheck { + valid := isRegionValid(regionName) + if !valid { + return nil, fmt.Errorf("not a valid AWS zone (unknown region): %s", zone) + } + } else { + glog.Warningf("Strict AWS zone checking is disabled. Proceeding with zone: %s", zone) } ec2, err := awsServices.Compute(regionName) From 274411b94efe93b6e49b63509d34a0594b1c73bf Mon Sep 17 00:00:00 2001 From: "Kenneth D. Evensen" Date: Sat, 2 Jul 2016 16:54:41 -0400 Subject: [PATCH 2/3] Adding comments --- pkg/cloudprovider/providers/aws/aws.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index ef9331b2677..451ac9a46b7 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -300,7 +300,16 @@ type CloudConfig struct { //has setup a rule that allows inbound traffic on kubelet ports from the //local VPC subnet (so load balancers can access it). E.g. 10.82.0.0/16 30000-32000. DisableSecurityGroupIngress bool - + + //During the instantiation of an new AWS cloud provider, the detected region + //is validated against a known set of regions. + // + //In a non-standard, AWS like environment (e.g. Eucalyptus), this check may + //be undesirable. Setting this to true will disable the check and provide + //a warning that the check was skipped. Please note that this is an + //experimental feature and work-in-progress for the moment. If you find + //yourself in an non-AWS cloud and open an issue, please indicate that in the + //issue body. DisableStrictZoneCheck bool } } From d69fe11c0938a11168fc427cdba2909b7caebe1b Mon Sep 17 00:00:00 2001 From: "Kenneth D. Evensen" Date: Tue, 19 Jul 2016 16:50:55 -0400 Subject: [PATCH 3/3] Fixing gofmt errors --- pkg/cloudprovider/providers/aws/aws.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cloudprovider/providers/aws/aws.go b/pkg/cloudprovider/providers/aws/aws.go index 451ac9a46b7..63120742cb5 100644 --- a/pkg/cloudprovider/providers/aws/aws.go +++ b/pkg/cloudprovider/providers/aws/aws.go @@ -304,10 +304,10 @@ type CloudConfig struct { //During the instantiation of an new AWS cloud provider, the detected region //is validated against a known set of regions. // - //In a non-standard, AWS like environment (e.g. Eucalyptus), this check may - //be undesirable. Setting this to true will disable the check and provide - //a warning that the check was skipped. Please note that this is an - //experimental feature and work-in-progress for the moment. If you find + //In a non-standard, AWS like environment (e.g. Eucalyptus), this check may + //be undesirable. Setting this to true will disable the check and provide + //a warning that the check was skipped. Please note that this is an + //experimental feature and work-in-progress for the moment. If you find //yourself in an non-AWS cloud and open an issue, please indicate that in the //issue body. DisableStrictZoneCheck bool