-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
fix synapse endpoint not available issue in other cloud #9100
Conversation
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.
hi @njuCZ
Thanks for this PR.
Whilst on first glance it appears this'd fix the issue - this'd end up creating a default authorizer object albeit with no authentication configured, creating a misleading set of errors here. Instead we'll need to make this a pointer, and thread this through appropriately - meaning that in the resources we'll need to check if the client is nil during the CRUD functions and raise a more descriptive error if appropriate.
Thanks!
azurerm/internal/clients/builder.go
Outdated
synapseAuth, err := builder.AuthConfig.GetAuthorizationToken(sender, oauthConfig, env.ResourceIdentifiers.Synapse) | ||
if err != nil { | ||
return nil, err | ||
var synapseAuth autorest.Authorizer |
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 would give us a default authorizer with no auth configured in the event we're not in Azure Public.. instead this needs to become a pointer and threaded through correctly to conditionally omit setting these clients / raising an error in these regions
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.
autorest.Authorizer
is an interface, the default vaule is nil. I have changed to declared it to nil explicitly.
@tombuildsstuff thanks for your suggestions. I have added some error handling if the synapse authorizer is nil. |
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.
otherwise LGTM 👍
azurerm/internal/services/synapse/synapse_role_assignment_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/synapse/tests/synapse_role_assignment_resource_test.go
Outdated
Show resolved
Hide resolved
@tombuildsstuff thanks for your kindly review. I have updated the codes |
This has been released in version 2.35.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.35.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
fix #9099