-
Notifications
You must be signed in to change notification settings - Fork 152
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
Azure - Migrate snapshot to a resource group #1019
Conversation
pkg/blockstorage/azure/azuredisk.go
Outdated
@@ -225,7 +225,12 @@ func (s *AdStorage) SnapshotCopyWithArgs(ctx context.Context, from blockstorage. | |||
}, | |||
} | |||
|
|||
result, err := s.azCli.SnapshotsClient.CreateOrUpdate(ctx, s.azCli.ResourceGroup, snapName, createSnap) | |||
migrateResourceGroup := s.azCli.ResourceGroup | |||
if val, ok := args[blockstorage.AzureMigrateStorageKey]; ok && val != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be AzureMigrateResourceGroup instead of AzureMigrateStorageKey ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are very correct
if val, ok := args[blockstorage.AzureMigrateResourceGroup]; ok && val != "" { | ||
migrateResourceGroup = val | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add to the function doc comment to describe this key.
@@ -36,6 +36,7 @@ const ( | |||
AzureResurceMgrEndpoint = "AZURE_RESOURCE_MANAGER_ENDPOINT" | |||
AzureMigrateStorageAccount = "AZURE_MIGRATE_STORAGE_ACCOUNT_NAME" | |||
AzureMigrateStorageKey = "AZURE_MIGRATE_STORAGE_ACCOUNT_KEY" | |||
AzureMigrateResourceGroup = "AZURE_MIGRATE_RESOURCE_GROUP" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be referenced in pkg/blockstorage/blockstorage_test.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing reference from the existing UT that covers the other Azure env variables.
That test is skipped. |
Change Overview
The following PR enables Azure to accept a resource group to which a newly create snapshot can belong.
Pull request type
Please check the type of change your PR introduces:
Issues
Test Plan