Skip to content

Commit 3271b7a

Browse files
authored
Merge pull request #3748 from sedefsavas/externalvpc-cc
Make subnet spec id field required for SSA to work with CC
2 parents 2c8580a + 39f088b commit 3271b7a

15 files changed

+225
-100
lines changed

api/v1beta2/network_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (v *VPCSpec) IsIPv6Enabled() bool {
242242
// SubnetSpec configures an AWS Subnet.
243243
type SubnetSpec struct {
244244
// ID defines a unique identifier to reference this resource.
245-
ID string `json:"id,omitempty"`
245+
ID string `json:"id"`
246246

247247
// CidrBlock is the CIDR block to be used when the provider creates a managed VPC.
248248
CidrBlock string `json:"cidrBlock,omitempty"`
@@ -284,6 +284,8 @@ func (s *SubnetSpec) String() string {
284284
}
285285

286286
// Subnets is a slice of Subnet.
287+
// +listType=map
288+
// +listMapKey=id
287289
type Subnets []SubnetSpec
288290

289291
// ToMap returns a map from id to subnet.

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,8 +446,13 @@ spec:
446446
description: Tags is a collection of tags describing the
447447
resource.
448448
type: object
449+
required:
450+
- id
449451
type: object
450452
type: array
453+
x-kubernetes-list-map-keys:
454+
- id
455+
x-kubernetes-list-type: map
451456
vpc:
452457
description: VPC configuration.
453458
properties:
@@ -1719,8 +1724,13 @@ spec:
17191724
description: Tags is a collection of tags describing the
17201725
resource.
17211726
type: object
1727+
required:
1728+
- id
17221729
type: object
17231730
type: array
1731+
x-kubernetes-list-map-keys:
1732+
- id
1733+
x-kubernetes-list-type: map
17241734
vpc:
17251735
description: VPC configuration.
17261736
properties:

config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,8 +1153,13 @@ spec:
11531153
description: Tags is a collection of tags describing the
11541154
resource.
11551155
type: object
1156+
required:
1157+
- id
11561158
type: object
11571159
type: array
1160+
x-kubernetes-list-map-keys:
1161+
- id
1162+
x-kubernetes-list-type: map
11581163
vpc:
11591164
description: VPC configuration.
11601165
properties:

config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,8 +757,13 @@ spec:
757757
description: Tags is a collection of tags describing
758758
the resource.
759759
type: object
760+
required:
761+
- id
760762
type: object
761763
type: array
764+
x-kubernetes-list-map-keys:
765+
- id
766+
x-kubernetes-list-type: map
762767
vpc:
763768
description: VPC configuration.
764769
properties:

test/e2e/data/e2e_conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ providers:
105105
- sourcePath: "./infrastructure-aws/generated/cluster-template-limit-az.yaml"
106106
- sourcePath: "./infrastructure-aws/generated/cluster-template-machine-pool.yaml"
107107
- sourcePath: "./infrastructure-aws/generated/cluster-template-md-remediation.yaml"
108-
- sourcePath: "./infrastructure-aws/generated/cluster-template-multi-az.yaml"
109108
- sourcePath: "./infrastructure-aws/generated/cluster-template-nested-multitenancy.yaml"
110109
- sourcePath: "./infrastructure-aws/generated/cluster-template-remote-management-cluster.yaml"
111110
- sourcePath: "./infrastructure-aws/generated/cluster-template-simple-multitenancy.yaml"
@@ -122,6 +121,7 @@ providers:
122121
- sourcePath: "./infrastructure-aws/generated/cluster-template-nested-multitenancy-clusterclass.yaml"
123122
- sourcePath: "./infrastructure-aws/kustomize_sources/nested-multitenancy-clusterclass/clusterclass-multi-tenancy.yaml"
124123
- sourcePath: "./infrastructure-aws/generated/cluster-template-self-hosted-clusterclass.yaml"
124+
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-vpc-clusterclass.yaml"
125125
- sourcePath: "./shared/v1beta2_provider/metadata.yaml"
126126
- sourcePath: "./infrastructure-aws/generated/cluster-template-ignition.yaml"
127127
replacements:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
- op: add
2+
path: /spec/topology/variables/-
3+
value:
4+
name: byoInfra
5+
value: "true"
6+
- op: add
7+
path: /spec/topology/variables/-
8+
value:
9+
name: vpcID
10+
value: "${BYO_VPC_ID}"
11+
- op: add
12+
path: /spec/topology/variables/-
13+
value:
14+
name: publicSubnetID
15+
value: "${BYO_PUBLIC_SUBNET_ID}"
16+
- op: add
17+
path: /spec/topology/variables/-
18+
value:
19+
name: privateSubnetID
20+
value: "${BYO_PRIVATE_SUBNET_ID}"
21+
- op: add
22+
path: /spec/topology/variables/-
23+
value:
24+
name: fdForBYOSubnets
25+
value: "us-west-2a"
26+
- op: replace
27+
path: /spec/topology/workers/machineDeployments/0/failureDomain
28+
value: "us-west-2a"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bases:
2+
- ../topology/cluster-template.yaml
3+
4+
patches:
5+
- path: ./byo-infra-variables.yaml
6+
target:
7+
group: cluster.x-k8s.io
8+
version: v1beta1
9+
kind: Cluster
10+
- path: ./limited-az-variable.yaml
11+
target:
12+
group: cluster.x-k8s.io
13+
version: v1beta1
14+
kind: Cluster
15+
16+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- op: add
2+
path: /spec/topology/variables/-
3+
value:
4+
name: vpcAZUsageLimit
5+
value: "1"

test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/kustomization.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/patches/multi-az.yaml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)