Uplift azure#72
Conversation
4687480 to
eee5869
Compare
|
Apologize for the large PR; I split this change into 4 separate commits with verbose commit messages to make it easier to read, but a broad majority of the file changes are due to changes in vendor/ from dependency upgrades |
| ltrimmed[i] = prefixRemoved[1] | ||
| } else if i < numExpectedRequiredValues { | ||
| // failed to parse required values | ||
| log.Info("image parsed", l) |
|
Squashed 4 commits to 2 which separate vendor changes from code changes |
superseb
left a comment
There was a problem hiding this comment.
Does creating a node with the current driver have the same outcome as creating/replacing a node with this driver? Asking for existing clusters and adding a node after upgrading to a version with this driver for instance.
|
@superseb yes with the following exceptions:
Other than the above exceptions, all changes are just updating the underlying Azure APIs, so the behavior for creating a node with the current driver should have the same outcome as creating/replacing a node with this driver. |
| } else if i < numExpectedRequiredValues { | ||
| // failed to parse required values | ||
| if i == 3 { | ||
| log.Warn(versionNotSuppliedWarnString) |
There was a problem hiding this comment.
If this is required when using gallery, can we make it part of the error? The error should contain enough to root cause the issue, and while the generic error probably covers it, we do know what the error is but now its only logged in a different level and on a separate line. If it's not required/breaking then this can be the additional warning
There was a problem hiding this comment.
Good idea! Should be fixed in the latest commit
| if resp.Err != nil { | ||
| return err | ||
| } else if d.FaultCount > resp.MaximumFaultDomainCount { | ||
| return fmt.Errorf("location %s has MaximumPlatformFaultDomainCount=%d, recieved FaultDomainCount=%d", |
There was a problem hiding this comment.
Thanks for catching this! Fixed in the latest commit.
|
Can we double check there are no fixes we want in later releases of vendored libraries? And can we also check the API versions used are generally available |
|
FYI in my latest commit, I ported a couple of changes / fixes relevant to this PR from #77 since it seems like they make more sense as part of this PR (i.e. uplifting Azure) rather than the NSG PR:
|
Good call! As I was double checking I discovered that Also I just checked / updated the following vendored libraries:
Afaik there are no more pending fixes that we require from these libraries for machine as they should be in their latest versions. Azure puts any service libraries that are on public preview under |
|
This PR will resolve the following issues:
|
| @@ -0,0 +1,25 @@ | |||
| package azureutil | |||
There was a problem hiding this comment.
The timeouts should be moved to where they are needed, one is even exported as it's used in a different package. It also looks like some of these are not used. If we don't need them they can be deleted.
There was a problem hiding this comment.
And can these be set somehow? If they can't be they should be changed to a const.
There was a problem hiding this comment.
Yeah that makes sense. Moving them to their respective files in the latest commit.
They shouldn't be set so I'll change them to a const too.
| log.Warn("Timed out trying to parse the MaximumFaultDomainCount. Continuing execution...") | ||
| case resp := <-r: | ||
| if resp.Err != nil { | ||
| return err |
There was a problem hiding this comment.
shouldnt this return resp.Err? err at this point is going to be from the new client call above.
There was a problem hiding this comment.
ah good catch. fixed in the latest commit!
8020420 to
8acc0d5
Compare
This commit updates github.com/Azure/azure-sdk-for-go to 39.1.0 and github.com/Azure/go-autorest to 13.3.3. Major updates: - Redefines AuthenticateDeviceFlow and AuthenticateServicePrincipal (now renamed AuthenticateClientCredentials) as functions that return Authorizer objects after running ValidateAuthorizer instead of tokens - Simplifies / eliminates several helper functions to use newer autorest libraries for Azure authentication - Introduced arm.go + customimage.go to create a unified way of referring to resources that are parsed from ARM resource identifiers - Using contexts to make calls via the Azure client and evaluating the status of async requests using Azure futures (which support WaitForCompletionRef and future.Result), which removes redundant Get calls - Node driver now implements Kill() as Azure now supports a force kill of an instance - Remove isSwarm logic as docker swarm is no longer supported Misc. Updates: - rename Azure Driver.ctx to Driver.deploymentContext to avoid ambiguity with Go contexts - Registered Microsoft.Subscription and Microsoft.Resources as resource providers - Added some more necessary client logic to clients.go for future commits - moved some Azure fmts to naming.go to centralize naming logic in one file - Added more structs for different types of Azure resources to cleanup.go to create one common way of cleaning up resources instead of having redundant code - Changes supportedEnvironments from a map to a list and adds azure.EnvironmentFromName to get the corresponding environment instead. - Renamed HasAttachedResources to CanBeDeleted and flipped boolean logic accordingly
Reverts a change added as part of rancher#72 to fail on PreCreateCheck if the OS disk already exists. Without this check, provisioning will either still fail on create if a machine tries to attach itself to a managed disk whose settings differ from those listed in `getOSDisk` here: https://github.com/rancher/machine/blob/2fbd7ec65dea41983a8222141df4ce58df7eaeac/drivers/azure/azureutil/azureutil.go#L633-L656. However, currently this also prevents a VM from using a previously created OS Disk (i.e. one that was left over from a previously failed provisioning process if it is a managed disk) that is configured correctly.
Reverts a change added as part of rancher#72 to fail on PreCreateCheck if the OS disk already exists. Without this check, provisioning will either still fail on create if a machine tries to attach itself to a managed disk.
This PR updates github.com/Azure/azure-sdk-for-go to 39.1.0 and github.com/Azure/go-autorest to 13.3.3.
Major updates:
Misc. Updates:
Related Issue: rancher/rancher#25342