Skip to content

Commit

Permalink
Remove ARN from AWS machine template generation
Browse files Browse the repository at this point in the history
Removed ARN from the AWS machine template generation. This field was previously optional and was dropped from the CAPA spec in kubernetes-sigs/cluster-api-provider-aws#3835.

Signed-off-by: Bryan Cox <[email protected]>
  • Loading branch information
bryan-cox committed Dec 22, 2022
1 parent b62852f commit 8ab7864
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ import (
"k8s.io/client-go/util/workqueue"
"k8s.io/utils/clock"
k8sutilspointer "k8s.io/utils/pointer"
capiaws "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2" // Need this dep atm to satisfy IBM provider dep.
capiaws "sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta2"
capiibmv1 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1"
capikubevirt "sigs.k8s.io/cluster-api-provider-kubevirt/api/v1alpha1"
capiv1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down Expand Up @@ -3938,24 +3938,6 @@ func (r *HostedClusterReconciler) reconcileAWSSubnets(ctx context.Context, creat
}
// Sort for stable update detection (is this needed?)
sort.Strings(subnetIDs)

// Reconcile subnet IDs in AWSCluster
// TODO (alberto): drop this once this is fixed upstream https://github.com/kubernetes-sigs/cluster-api-provider-aws/pull/2864.
awsInfraCR, ok := infraCR.(*capiaws.AWSCluster)
if !ok {
return nil
}
subnets := capiaws.Subnets{}
for _, subnetID := range subnetIDs {
subnets = append(subnets, capiaws.SubnetSpec{ID: subnetID})
}
_, err = createOrUpdate(ctx, r.Client, awsInfraCR, func() error {
awsInfraCR.Spec.NetworkSpec.Subnets = subnets
return nil
})
if err != nil {
return fmt.Errorf("failed to reconcile networks for CAPA Infra CR: %w", err)
}
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions hypershift-operator/controllers/nodepool/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func awsMachineTemplateSpec(infraName, ami string, hostedCluster *hyperv1.Hosted
subnet := &capiaws.AWSResourceReference{}
if nodePool.Spec.Platform.AWS.Subnet != nil {
subnet.ID = nodePool.Spec.Platform.AWS.Subnet.ID
subnet.ARN = nodePool.Spec.Platform.AWS.Subnet.ARN
for k := range nodePool.Spec.Platform.AWS.Subnet.Filters {
filter := capiaws.Filter{
Name: nodePool.Spec.Platform.AWS.Subnet.Filters[k].Name,
Expand Down Expand Up @@ -60,7 +59,6 @@ func awsMachineTemplateSpec(infraName, ami string, hostedCluster *hyperv1.Hosted
})
}
securityGroups = append(securityGroups, capiaws.AWSResourceReference{
ARN: sg.ARN,
ID: sg.ID,
Filters: filters,
})
Expand Down

0 comments on commit 8ab7864

Please sign in to comment.