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

Fix Azure IMDS Url in InstanceMetadataService initialization #4600

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster-autoscaler/cloudprovider/azure/azure_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const (
// The path of deployment parameters for standard vm.
deploymentParametersPath = "/var/lib/azure/azuredeploy.parameters.json"

metadataURL = "http://169.254.169.254/metadata/instance"
metadataURL = "http://169.254.169.254"

// backoff
backoffRetriesDefault = 6
Expand Down
20 changes: 0 additions & 20 deletions cluster-autoscaler/cloudprovider/azure/azure_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,26 +305,6 @@ func TestIsAzureRequestsThrottled(t *testing.T) {
}
}

func TestDeleteBlob(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()

azUtil := GetTestAzureUtil(t)
mockSAClient := mockstorageaccountclient.NewMockInterface(ctrl)
mockSAClient.EXPECT().ListKeys(
gomock.Any(),
azUtil.manager.config.ResourceGroup,
testAccountName).Return(storage.AccountListKeysResult{
Keys: &[]storage.AccountKey{
{Value: to.StringPtr("dmFsdWUK")},
},
}, nil)
azUtil.manager.azClient.storageAccountsClient = mockSAClient

err := azUtil.DeleteBlob(testAccountName, "vhd", "blob")
assert.True(t, strings.Contains(err.Error(), storageAccountClientErrMsg))
}

func TestDeleteVirtualMachine(t *testing.T) {
ctrl := gomock.NewController(t)
defer ctrl.Finish()
Expand Down