gardener / gardener-extension-provider-azure

Gardener extension controller for the Azure cloud provider (https://azure.microsoft.com).
https://gardener.cloud
Apache License 2.0
10 stars 78 forks source link

Fix restoration of infra with migrated network layout #907

Open plkokanov opened 3 months ago

plkokanov commented 3 months ago

How to categorize this PR?

/area control-plane-migration /kind bug /platform azure

What this PR does / why we need it: This PR modifies the layout mutator which adds the migration.azure.provider.extensions.gardener.cloud/zone annotation on the Infrastructure resource so that the annotation is also added during the restore phase of control plane migration in the following cases:

  1. If the .status.state field is defined and is in the azure.provider.extensions.gardener.cloud/v1alpha1 group version, then
    • If its .data field contains an entry for migration.azure.provider.extensions.gardener.cloud/zone, then this entry is added as an annotation to the Infrastructure resource
  2. If the .status.state field is defined and its type is InfrastructureState, then
    • If this .state field contains a .savedProviderStatus field and its .networks.subnets array contains a subnet for which the .migrated field is true and the .zone field is not nil

Additionally, during reconciliation, if the new flow reconciler is used and the migration.azure.provider.extensions.gardener.cloud/zone annotation is present on the Infrastructure resource, then it is persisted in the .status.state.data map.

Which issue(s) this PR fixes: Fixes #827

Special notes for your reviewer:

Release note:

Fixed an issue that prevented the `Infrastructure` resource to be correctly restored during control plane migration, if the `Infrastructure` was previously migrated from a single subnet network layout to a multiple subnet network layout.
gardener-robot commented 3 months ago

@plkokanov You need rebase this pull request with latest master branch. Please check.

plkokanov commented 3 months ago

/hold I want to do a few more tests of the changes.