Open jancespivo opened 3 years ago
Do you have an example of a function that behaves as you would expect in this scenario?
@mikhailshilkov
Actually it is ok to expect this kind of error:
Exception: invoke of azure-native:keyvault:getVault failed: invocation of azure-native:keyvault:getVault returned an error: request failed ...
I've found:
keyvault.get_vault(
resource_group_name='existing_rg_name',
vault_name='not_existing_vault_name',
)
works properly.
However:
keyvault.get_vault(
resource_group_name='existing_rg_name',
vault_name='', #<-- empty!
)
fails with the exception I reported.
Thx!
I spent some time looking into what is going on and a potential fix here.
The sequence basically goes like this:
vault_name
.vaultName
URL segment is empty, so we end up with something like /subscriptions/12344/resourceGroups/rg/providers/Microsoft.KeyVault/vaults/?api-version=2023-02-01
.We could make it more strict and catch the problem on a few different levels:
id
to be inside the response payload to consider it successful.I don't feel good about any of these changes, actually. I can't confidently tell that any of (1) to (3) wouldn't have a side effect and wouldn't break some legit scenario that works today. What if there are scenarios where an empty value is a valid value?
I'll mark this issue as an enhancement and label it as 3.0. We can entertain doing (1) or (2) then and clearly mark it as a breaking change.
Added to epic https://github.com/pulumi/home/issues/3552
When
keyvault.get_vault
tries to get non-existing vault the function throws error:IMO it should return
None
instead.