Skip to content

Commit

Permalink
[release-v1.57] Automated cherry pick of #1038: Fix issues with the A…
Browse files Browse the repository at this point in the history
…WS flow after last update (#1042)

* add infra webhook to manager

* correctly calculate subnets in infra status by using exportAsFlatmap

* add integration test check
  • Loading branch information
kon-angelo authored Aug 29, 2024
1 parent aa3ebb9 commit 530ea02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/cmd/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
cloudproviderwebhook "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/cloudprovider"
controlplanewebhook "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/controlplane"
controlplaneexposurewebhook "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/controlplaneexposure"
"github.com/gardener/gardener-extension-provider-aws/pkg/webhook/infrastructure"
shootwebhook "github.com/gardener/gardener-extension-provider-aws/pkg/webhook/shoot"
)

Expand Down Expand Up @@ -70,6 +71,7 @@ func WebhookSwitchOptions(gardenerVersion *string) *webhookcmd.SwitchOptions {
webhookcmd.Switch(extensioncontrolplanewebhook.ExposureWebhookName, controlplaneexposurewebhook.AddToManager),
webhookcmd.Switch(extensionshootwebhook.WebhookName, shootwebhook.AddToManager),
webhookcmd.Switch(extensionscloudproviderwebhook.WebhookName, cloudproviderwebhook.AddToManager),
webhookcmd.Switch(infrastructure.WebhookName, infrastructure.AddToManager),
)
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/infrastructure/infraflow/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (c *FlowContext) computeInfrastructureStatus() *awsv1alpha1.InfrastructureS
if vpcID != "" {
var subnets []awsv1alpha1.Subnet
prefix := ChildIdZones + shared.Separator
for k, v := range c.state.AsMap() {
for k, v := range c.state.ExportAsFlatMap() {
if !shared.IsValidValue(v) {
continue
}
Expand Down
5 changes: 5 additions & 0 deletions test/integration/infrastructure/infrastructure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,11 @@ func verifyCreation(
},
))
infrastructureIdentifier.subnetIDs = append(infrastructureIdentifier.subnetIDs, subnet.SubnetId)
Expect(infraStatus.VPC.Subnets).To(ContainElement(Equal(awsv1alpha1.Subnet{
Purpose: awsv1alpha1.PurposeNodes,
ID: ptr.Deref(subnet.SubnetId, ""),
Zone: availabilityZone,
})))
}
if reflect.DeepEqual(tag.Key, awssdk.String("Name")) && reflect.DeepEqual(tag.Value, awssdk.String(infra.Namespace+publicUtilitySuffix)) {
foundExpectedSubnets++
Expand Down

0 comments on commit 530ea02

Please sign in to comment.