Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect Cloud Instance by Region as Fallback #875

Merged
merged 7 commits into from
Jul 18, 2024

Conversation

AndreasBurger
Copy link
Member

How to categorize this PR?
/area usability
/kind enhancement
/platform azure

What this PR does / why we need it:
With the changes in this PR, the extension will look at the name of the region configured in the shoot to determine the correct cloud instance to connect to iff there is no explicit CloudConfiguration provided.

Release note:

When no CloudConfiguration is given, the Azure Cloud instance to connect to will be inferred from the region configured for the shoot

@AndreasBurger AndreasBurger requested review from a team as code owners May 29, 2024 07:59
@gardener-robot gardener-robot added kind/api-change API change with impact on API users needs/second-opinion Needs second review by someone else area/usability Usability related kind/enhancement Enhancement, improvement, extension platform/azure Microsoft Azure platform/infrastructure needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) labels May 29, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 29, 2024
Comment on lines 46 to 50
if cloudConfiguration == nil {
cloudConfiguration = &azure.CloudConfiguration{Name: helper.CloudInstanceNameFromRegion(backupBucket.Spec.Region)}
}

azCloudConfiguration, err := azureclient.AzureCloudConfigurationFromCloudConfiguration(cloudConfiguration)
Copy link
Contributor

@kon-angelo kon-angelo May 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't these functions be grouped up in a single function ? Can we imagine using one but not the other ? Like get either a cloudinstance *string or a region *string

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, there is one case where they are both required. However, I agree that duplicating these lines of code tenfold is not the way to go.

I've tried my hand at refactoring it a bit, but unfortunately there is some inherent ugliness here due to the way the upstream cloud-instance structs are defined. Not sure if I have hit the mark, honestly 🤔

@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels May 29, 2024
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from 86e5548 to 9bd8736 Compare June 3, 2024 14:09
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from 9bd8736 to 8a80713 Compare June 3, 2024 14:16
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 3, 2024
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from 8a80713 to cdc3f6b Compare June 3, 2024 14:35
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 3, 2024
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from cdc3f6b to ec9d4fa Compare June 3, 2024 14:52
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2024
@AndreasBurger
Copy link
Member Author

/test

@testmachinery
Copy link

testmachinery bot commented Jul 3, 2024

Testrun: e2e-v7wnl
Workflow: e2e-v7wnl-wf
Phase: Failed

+---------------------+---------------------------+---------+----------+
|        NAME         |           STEP            |  PHASE  | DURATION |
+---------------------+---------------------------+---------+----------+
| bastion-test        | bastion-test              | Failed  | 3m27s    |
| infrastructure-test | infrastructure-test       | Omitted | 0s       |
| infrastructure-test | infra-flow-test           | Omitted | 0s       |
| infrastructure-test | infra-flow-migration-test | Omitted | 0s       |
+---------------------+---------------------------+---------+----------+

fall back to the AWS-way of doing things if no explicit
CloudConfiguration is given. We keep the Configuration
for possible future support of arbitrary cloud instances
(these would then _have_ to provide a future version
of the CloudConfiguration).
terraform is basically deprecated at this point
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from 6e16453 to ab8ac4f Compare July 3, 2024 15:02
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 3, 2024
@AndreasBurger
Copy link
Member Author

/test

@testmachinery
Copy link

testmachinery bot commented Jul 3, 2024

Testrun: e2e-s2rfw
Workflow: e2e-s2rfw-wf
Phase: Failed

+---------------------+---------------------------+---------+----------+
|        NAME         |           STEP            |  PHASE  | DURATION |
+---------------------+---------------------------+---------+----------+
| bastion-test        | bastion-test              | Failed  | 2m45s    |
| infrastructure-test | infrastructure-test       | Omitted | 0s       |
| infrastructure-test | infra-flow-test           | Omitted | 0s       |
| infrastructure-test | infra-flow-migration-test | Omitted | 0s       |
+---------------------+---------------------------+---------+----------+

@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from ab8ac4f to 448cfd2 Compare July 4, 2024 08:47
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 4, 2024
@AndreasBurger
Copy link
Member Author

/test

@testmachinery
Copy link

testmachinery bot commented Jul 4, 2024

Testrun: e2e-f8qzt
Workflow: e2e-f8qzt-wf
Phase: Failed

+---------------------+---------------------------+---------+----------+
|        NAME         |           STEP            |  PHASE  | DURATION |
+---------------------+---------------------------+---------+----------+
| bastion-test        | bastion-test              | Failed  | 6m2s     |
| infrastructure-test | infrastructure-test       | Omitted | 0s       |
| infrastructure-test | infra-flow-test           | Omitted | 0s       |
| infrastructure-test | infra-flow-migration-test | Omitted | 0s       |
+---------------------+---------------------------+---------+----------+

@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 4, 2024
@AndreasBurger AndreasBurger force-pushed the az-instance-by-region branch from 448cfd2 to 273e6ea Compare July 4, 2024 10:30
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jul 4, 2024
@AndreasBurger
Copy link
Member Author

/test

@testmachinery
Copy link

testmachinery bot commented Jul 4, 2024

Testrun: e2e-8pd2s
Workflow: e2e-8pd2s-wf
Phase: Succeeded

+---------------------+---------------------------+-----------+----------+
|        NAME         |           STEP            |   PHASE   | DURATION |
+---------------------+---------------------------+-----------+----------+
| bastion-test        | bastion-test              | Succeeded | 8m33s    |
| infrastructure-test | infrastructure-test       | Succeeded | 31m9s    |
| infrastructure-test | infra-flow-test           | Succeeded | 30m54s   |
| infrastructure-test | infra-flow-migration-test | Succeeded | 29m46s   |
+---------------------+---------------------------+-----------+----------+

Copy link
Contributor

@kon-angelo kon-angelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/second-opinion Needs second review by someone else labels Jul 12, 2024
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jul 12, 2024
@AndreasBurger AndreasBurger merged commit e94e67f into gardener:master Jul 18, 2024
12 of 13 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/usability Usability related kind/api-change API change with impact on API users kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) platform/azure Microsoft Azure platform/infrastructure reviewed/lgtm Has approval for merging reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) status/closed Issue is closed (either delivered or triaged)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants