Skip to content
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

Merged
merged 3 commits into from
Nov 5, 2020

Conversation

njuCZ
Copy link
Contributor

@njuCZ njuCZ commented Oct 30, 2020

fix #9099

@ghost ghost added the size/XS label Oct 30, 2020
Copy link
Member

@tombuildsstuff tombuildsstuff left a 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!

synapseAuth, err := builder.AuthConfig.GetAuthorizationToken(sender, oauthConfig, env.ResourceIdentifiers.Synapse)
if err != nil {
return nil, err
var synapseAuth autorest.Authorizer
Copy link
Member

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

Copy link
Contributor Author

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 tombuildsstuff added upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR waiting-response labels Oct 30, 2020
@ghost ghost added size/S and removed size/XS labels Nov 2, 2020
@njuCZ
Copy link
Contributor Author

njuCZ commented Nov 2, 2020

@tombuildsstuff thanks for your suggestions. I have added some error handling if the synapse authorizer is nil.

@ghost ghost removed the waiting-response label Nov 2, 2020
@tombuildsstuff tombuildsstuff added this to the v2.35.0 milestone Nov 4, 2020
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM 👍

@njuCZ
Copy link
Contributor Author

njuCZ commented Nov 5, 2020

@tombuildsstuff thanks for your kindly review. I have updated the codes

@jackofallops jackofallops merged commit 442b581 into hashicorp:master Nov 5, 2020
jackofallops added a commit that referenced this pull request Nov 5, 2020
@ghost
Copy link

ghost commented Nov 5, 2020

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 ...

@ghost
Copy link

ghost commented Dec 5, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/S upstream/microsoft Indicates that there's an upstream issue blocking this issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AzureRM Provider 2.34 fails to authenticate on US Government (Regression from 2.33)
3 participants