Azure / draft

A day 0 tool for getting your app on k8s fast
MIT License
514 stars 61 forks source link

fix: query resource group under giving subscription id #238

Closed bcho closed 9 months ago

bcho commented 10 months ago

Description

When there are multiple subscriptions under the local azure account, the setup-gh command would fail to discover the correct resource group with error like this:

Error: resource group not found

This is because the resource group validation logic is expecting 1) the local azcli has fetched all subscriptions 2) the resource group is created under the active subscription. However these assumptions are incorrect when running with command like this:

$ draft setup-gh -s <my-sub-id> -g <my-rg-name>

To get the resource group correctly, this pull request added --subscription parameter on the query command. I also enhanced the error message a bit to provide more details on missing resource group error.

Fixes # (issue) Feature # (details)

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

I tested this change from my local with above command.

Checklist:

davidgamero commented 9 months ago

ty for the contribution this looks great!

Tatsinnit commented 9 months ago

😊🎉☕️🙏 observation to share; 200 premerge checks are super over eager and we should curb them to more smaller list. Let me open a tracking wi against this.

IMG_0392