Skip to content

Commit

Permalink
Add another error code to the list of unregistered RP errors (Azure#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Oct 5, 2023
1 parent 8b62891 commit 9831d3a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sdk/azcore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* Added types `KeyCredentialPolicy` and `SASCredentialPolicy` to the `azcore/runtime` package.
* Includes their respective constructor functions and options types.

### Bugs Fixed

* Fixed an issue that could cause some ARM RPs to not be automatically registered.

### Other Changes

* The following functions in the `runtime` package are now exposed from the `policy` package, and the `runtime` versions have been deprecated.
Expand Down
1 change: 1 addition & 0 deletions sdk/azcore/arm/runtime/policy_register_rp.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ var unregisteredRPCodes = []string{
"MissingSubscriptionRegistration",
"MissingRegistrationForResourceProvider",
"Subscription Not Registered",
"SubscriptionNotRegistered",
}

func isUnregisteredRPCode(errorCode string) bool {
Expand Down
1 change: 1 addition & 0 deletions sdk/azcore/arm/runtime/policy_register_rp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ func TestRPRegistrationPolicyEnvironmentsInSubExceeded(t *testing.T) {

func TestIsUnregisteredRPCode(t *testing.T) {
require.True(t, isUnregisteredRPCode("Subscription Not Registered"))
require.True(t, isUnregisteredRPCode("SubscriptionNotRegistered"))
require.False(t, isUnregisteredRPCode("Your subscription isn't registered"))
}

Expand Down

0 comments on commit 9831d3a

Please sign in to comment.