Skip to content

Commit

Permalink
Add cloud ipam behind a feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ole Markus With committed Sep 16, 2021
1 parent dc4c559 commit 81177dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/kops/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,11 @@ func TestMinimalIPv6(t *testing.T) {

// TestIPv6CloudIPAM runs the test on a minimum IPv6 configuration, similar to kops create cluster minimal.example.com --zones us-west-1a
func TestIPv6CloudIPAM(t *testing.T) {
featureflag.ParseFlags("+AWSIPv6")
unsetFeatureFlags := func() {
featureflag.ParseFlags("-AWSIPv6")
}
defer unsetFeatureFlags()
newIntegrationTest("minimal-ipv6.example.com", "ipv6-cloudipam").
withAddons(dnsControllerAddon).
runTestTerraformAWS(t)
Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/kops/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"k8s.io/apimachinery/pkg/util/validation/field"
"k8s.io/kops/pkg/apis/kops"
"k8s.io/kops/pkg/dns"
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/model/components"
"k8s.io/kops/pkg/model/iam"
"k8s.io/kops/upup/pkg/fi"
Expand Down Expand Up @@ -267,6 +268,13 @@ func validateClusterSpec(spec *kops.ClusterSpec, c *kops.Cluster, fieldPath *fie
}
}

if spec.PodCIDRFromCloud {
if !featureflag.AWSIPv6.Enabled() {
allErrs = append(allErrs, field.Forbidden(fieldPath.Child("podCIDRFromCloud", "serviceAccountExternalPermissions"), "podCIDRFromCloud requires the AWSIPv6 feature flag to be enabled"))

}
}

return allErrs
}

Expand Down

0 comments on commit 81177dc

Please sign in to comment.