From ed6c3d57746c1302f7550f6ab470658f3a38c8ce Mon Sep 17 00:00:00 2001 From: ederst Date: Wed, 22 Feb 2023 16:45:38 +0100 Subject: [PATCH] fix: make zone in subnet spec optional This makes setting `zone` in the `ClusterSubnetSpec` optional. Technically, kOps does not require this to be set as it will also include the `zones` from the `InstanceGroupSpec`. --- docs/resources/cluster.md | 2 +- hack/gen-tf-code/main.go | 2 +- pkg/schemas/kops/Resource_ClusterSubnetSpec.generated.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md index 312bc434..09dbdf47 100644 --- a/docs/resources/cluster.md +++ b/docs/resources/cluster.md @@ -1340,7 +1340,7 @@ The following arguments are supported: - `name` - (Required) - String - Name is the name of the subnet. - `cidr` - (Optional) - (Computed) - String - CIDR is the IPv4 CIDR block assigned to the subnet. - `ipv6_cidr` - (Optional) - String - IPv6CIDR is the IPv6 CIDR block assigned to the subnet. -- `zone` - (Required) - String - Zone is the zone the subnet is in, set for subnets that are zonally scoped. +- `zone` - (Optional) - String - Zone is the zone the subnet is in, set for subnets that are zonally scoped. - `region` - (Optional) - String - Region is the region the subnet is in, set for subnets that are regionally scoped. - `id` - (Optional) - String - ID is the cloud provider ID for the objects associated with the zone (the subnet on AWS). - `egress` - (Optional) - String - Egress defines the method of traffic egress for this subnet. diff --git a/hack/gen-tf-code/main.go b/hack/gen-tf-code/main.go index bbfd6d0c..800fd513 100644 --- a/hack/gen-tf-code/main.go +++ b/hack/gen-tf-code/main.go @@ -217,7 +217,7 @@ func main() { required("Name"), ), generate(kops.ClusterSubnetSpec{}, - required("Name", "Type", "Zone"), + required("Name", "Type"), computed("CIDR"), ), generate(kops.TopologySpec{}, diff --git a/pkg/schemas/kops/Resource_ClusterSubnetSpec.generated.go b/pkg/schemas/kops/Resource_ClusterSubnetSpec.generated.go index c4ca294f..e91ef131 100644 --- a/pkg/schemas/kops/Resource_ClusterSubnetSpec.generated.go +++ b/pkg/schemas/kops/Resource_ClusterSubnetSpec.generated.go @@ -14,7 +14,7 @@ func ResourceClusterSubnetSpec() *schema.Resource { "name": RequiredString(), "cidr": OptionalComputedString(), "ipv6_cidr": OptionalString(), - "zone": RequiredString(), + "zone": OptionalString(), "region": OptionalString(), "id": OptionalString(), "egress": OptionalString(),