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

Upgrade to latest Azure Go SDK #105

Merged
merged 69 commits into from
Nov 17, 2023
Merged

Upgrade to latest Azure Go SDK #105

merged 69 commits into from
Nov 17, 2023

Conversation

unmarshall
Copy link
Contributor

@unmarshall unmarshall commented Aug 31, 2023

What this PR does / why we need it:
Azure SDK go-autorest is now out of support. This PR revamps the codebase and uses the latest SDK.

Which issue(s) this PR fixes:
Fixes #91, #41

Special notes for your reviewer:

Release note:

Uses new Azure SDK as the older go-autorest is out of support. 
Adds 2 new metrics which compute driver API call duration and Azure API call duration for all successful API calls.
Recently introduced Azure fakes are used extensively for unit tests.
Driver.GetMachineStatus now only gets the status from the Machine and not from associated NIC(s).
Deletion of a machine now cascade deletes NIC(s) and Disk(s) (OSDisk and DataDisk(s)) as well. Previously it was a 2 step process of detatch followed by a delete.
In the API following have been marked as deprecated:
- Constants: [api.AzureClientID, api.AzureClientSecret, api.AzureSubscriptionID, api.AzureTenantID, api.AzureAlternativeClientID, api.AzureAlternativeClientSecret, api.AzureAlternativeSubscriptionID, api.AzureAlternativeTenantID, api.MachineSetKindVMO and api.MachineSetKindAvailabilitySet]
- AzureVirtualMachineProperties.MachineSet has been marked as deprecated

unmarshall and others added 30 commits August 31, 2023 17:17
@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 Nov 8, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

9th set of review done

Pls also update the following:

  • update go version in Dockerfile
  • MCM_VERSION -> v0.50.1

Comment on lines 139 to 145
{"should forbid empty subnetName and vnetName",
"", "", 2,
ConsistOf(
PointTo(MatchFields(IgnoreExtras, Fields{"Type": Equal(field.ErrorTypeRequired), "Field": Equal("providerSpec.subnetInfo.vnetName")})),
PointTo(MatchFields(IgnoreExtras, Fields{"Type": Equal(field.ErrorTypeRequired), "Field": Equal("providerSpec.subnetInfo.subnetName")})),
),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

the one with description should forbid empty subnetName and vnetName. because you are already checking them individually before, so why both now?

Makefile Outdated Show resolved Hide resolved
pkg/azure/provider/provider_test.go Show resolved Hide resolved
pkg/azure/provider/provider_test.go Outdated Show resolved Hide resolved
g.Expect(err).ToNot(BeNil())
var statusErr *status.Status
g.Expect(errors.As(err, &statusErr)).Should(BeTrue())
g.Expect(statusErr.Code()).To(Equal(codes.InvalidArgument))
Copy link
Contributor

Choose a reason for hiding this comment

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

We only wanted a validation for errorMessage, but if you feel its not correct, then its fine. We think the earlier way of validation was much simpler and easy to understand. Could you pls revert.

pkg/azure/provider/provider_test.go Outdated Show resolved Hide resolved
@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 Nov 9, 2023
NewTokenCredetial from fake package upstream
@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 Nov 16, 2023
@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 Nov 16, 2023
@gardener-robot-ci-1 gardener-robot-ci-1 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 Nov 16, 2023
Copy link
Contributor

@himanshu-kun himanshu-kun left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks for the clean PR , it was pleasant reviewing it :)

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/changes Needs (more) changes needs/review Needs review needs/second-opinion Needs second review by someone else labels Nov 17, 2023
@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 Nov 17, 2023
@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 Nov 17, 2023
@unmarshall unmarshall 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 needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Nov 17, 2023
@gardener-robot-ci-3 gardener-robot-ci-3 added 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 Nov 17, 2023
@rishabh-11
Copy link
Contributor

rishabh-11 commented Nov 17, 2023

/lgtm
Finally, the review is over.

@unmarshall unmarshall merged commit 02e0c9f into gardener:master Nov 17, 2023
7 checks passed
@gardener-robot gardener-robot added the status/closed Issue is closed (either delivered or triaged) label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/xl Size of pull request is huge (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.

Upgrade to latest Azure Go SDK from out-of-support go-autorest
9 participants