Skip to content

Commit f09ef9e

Browse files
authored
fix: Don't set AWS region as required (#219)
AWS region should not be required as it can be set in the ClusterClass. Making it optional and setting it in the example instead. It also doesn't really make sense to have a default in the code for a region since there is no "default".
1 parent 1bf48c5 commit f09ef9e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

api/v1alpha1/aws_clusterconfig_types.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ package v1alpha1
55

66
import (
77
clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
8-
9-
"github.com/d2iq-labs/capi-runtime-extensions/common/pkg/capi/clustertopology/variables"
108
)
119

1210
type AWSSpec struct {
@@ -22,7 +20,6 @@ func (AWSSpec) VariableSchema() clusterv1.VariableSchema {
2220
Properties: map[string]clusterv1.JSONSchemaProps{
2321
"region": Region("").VariableSchema().OpenAPIV3Schema,
2422
},
25-
Required: []string{"region"},
2623
},
2724
}
2825
}
@@ -33,7 +30,6 @@ func (Region) VariableSchema() clusterv1.VariableSchema {
3330
return clusterv1.VariableSchema{
3431
OpenAPIV3Schema: clusterv1.JSONSchemaProps{
3532
Type: "string",
36-
Default: variables.MustMarshal("us-west-2"),
3733
Description: "AWS region to create cluster in",
3834
},
3935
}

examples/capi-quick-start/aws-cluster.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ spec:
2727
providers:
2828
- name: aws-ebs
2929
nfd: {}
30-
aws: {}
30+
aws:
31+
region: us-west-2
3132
version: v1.27.5
3233
workers:
3334
machineDeployments:

hack/examples/bases/aws/kustomization.yaml.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ patches:
3131
value:
3232
- name: "clusterConfig"
3333
value:
34-
aws: {}
34+
aws:
35+
region: us-west-2
3536
- op: "add"
3637
path: "/spec/topology/variables/0/value/addons"
3738
value:

0 commit comments

Comments
 (0)