Skip to content

Commit

Permalink
azure/uploader: remove rg location check
Browse files Browse the repository at this point in the history
It's possible to create image galleries with a different location than the one of the resource group, so it shouldn't matter where it exists.

Signed-off-by: Paul Meyer <[email protected]>
  • Loading branch information
katexochen committed Dec 11, 2024
1 parent 137f7b6 commit 9bd0414
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions azure/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,20 +352,7 @@ func (u *Uploader) ensureResourceGroup(ctx context.Context) error {
if err != nil {
return fmt.Errorf("checking existence of resource group %s: %w", rg, err)
}

if resp.Success {
// Check resource group location matches.
group, err := u.groups.Get(ctx, rg, &armresources.ResourceGroupsClientGetOptions{})
if err != nil {
return fmt.Errorf("getting resource group %s: %w", rg, err)
}
if group.Location == nil {
return fmt.Errorf("resource group %s exists but has no location", rg)
}
if !strings.EqualFold(*group.Location, location) {
return fmt.Errorf("resource group %s exists but isn't in the expected location %s but in %s", rg, location, *group.Location)
}

u.log.Printf("Resource group %s in %s exists", rg, location)
return nil
}
Expand Down

0 comments on commit 9bd0414

Please sign in to comment.