Skip to content

Commit a699e1d

Browse files
Sara El-Zayatfoot
andauthored
Add support for AWSManagedControlPlane (#288)
* Add support for AWSManagedControlPlane * Update cmd/clusters-service/pkg/credentials/credentials.go Co-authored-by: Simon <[email protected]> * Remove unnecessary entries Co-authored-by: Simon Howe <[email protected]>
1 parent 102b142 commit a699e1d

File tree

4 files changed

+30
-13
lines changed

4 files changed

+30
-13
lines changed

cmd/clusters-service/pkg/credentials/credentials.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ var IdentityParamsList = []IdentityParams{
3131
Group: "infrastructure.cluster.x-k8s.io",
3232
Versions: []string{"v1alpha3", "v1alpha4"},
3333
Kind: "AWSClusterStaticIdentity",
34-
ClusterKinds: []string{"AWSCluster", "AWSManagedCluster"},
34+
ClusterKinds: []string{"AWSCluster", "AWSManagedCluster", "AWSManagedControlPlane"},
3535
},
3636
{
3737
Group: "infrastructure.cluster.x-k8s.io",
3838
Versions: []string{"v1alpha3", "v1alpha4"},
3939
Kind: "AWSClusterRoleIdentity",
40-
ClusterKinds: []string{"AWSCluster", "AWSManagedCluster"},
40+
ClusterKinds: []string{"AWSCluster", "AWSManagedCluster", "AWSManagedControlPlane"},
4141
},
4242
{
4343
Group: "infrastructure.cluster.x-k8s.io",

cmd/clusters-service/pkg/credentials/credentials_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ kind: AWSCluster
125125
t.Fatalf("expected didn't match result! %v", diff)
126126
}
127127

128-
for _, clusterKind := range []string{"AWSCluster", "AWSManagedCluster"} {
128+
for _, clusterKind := range []string{"AWSCluster", "AWSManagedCluster", "AWSManagedControlPlane"} {
129129
t.Run(clusterKind, func(t *testing.T) {
130130
templateBits := [][]byte{
131131
[]byte(fmt.Sprintf(`

cmd/clusters-service/pkg/server/server.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,17 @@ import (
4141
)
4242

4343
var providers = map[string]string{
44-
"AWSCluster": "aws",
45-
"AWSManagedCluster": "aws",
46-
"AzureCluster": "azure",
47-
"AzureManagedCluster": "azure",
48-
"DOCluster": "digitalocean",
49-
"DockerCluster": "docker",
50-
"GCPCluster": "gcp",
51-
"OpenStackCluster": "openstack",
52-
"PacketCluster": "packet",
53-
"VSphereCluster": "vsphere",
44+
"AWSCluster": "aws",
45+
"AWSManagedCluster": "aws",
46+
"AWSManagedControlPlane": "aws",
47+
"AzureCluster": "azure",
48+
"AzureManagedCluster": "azure",
49+
"DOCluster": "digitalocean",
50+
"DockerCluster": "docker",
51+
"GCPCluster": "gcp",
52+
"OpenStackCluster": "openstack",
53+
"PacketCluster": "packet",
54+
"VSphereCluster": "vsphere",
5455
}
5556

5657
type server struct {

cmd/clusters-service/pkg/server/server_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,22 @@ func TestGetProvider(t *testing.T) {
926926
},
927927
provider: "aws",
928928
},
929+
{
930+
name: "AWSManagedControlPlane",
931+
template: &capiv1.CAPITemplate{
932+
Spec: capiv1.CAPITemplateSpec{
933+
ResourceTemplates: []capiv1.CAPIResourceTemplate{
934+
{
935+
RawExtension: rawExtension(`{
936+
"apiVersion": "infrastructure.cluster.x-k8s.io/v1alpha4",
937+
"kind": "AWSManagedControlPlane"
938+
}`),
939+
},
940+
},
941+
},
942+
},
943+
provider: "aws",
944+
},
929945
{
930946
name: "AzureCluster",
931947
template: &capiv1.CAPITemplate{

0 commit comments

Comments
 (0)