-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Bug: azurerm_frontdoor
fix for caching issue
#5358
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.
hey @WodansSon
Thanks for rebasing this PR - I've taken a look through and left some comments inline but this is looking good; there's two main questions for me:
- can we switch to using an ID parsing function and then conditionally check both known cases for the HealthProbeSettings string - rather than parsing the entire Resource ID case insensitively?
- can we revert the breaking changes, instead adding TODO's where we can make these in 2.0
Thanks!
// a known format so I can reliable parse the ID string. | ||
// | ||
// Link to issue: https://github.com/Azure/azure-sdk-for-go/issues/6762 | ||
func ParseAzureResourceIDLowerPath(id string) (*azure.ResourceID, error) { |
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.
since there's two possible values for this - it'd be better to instead check both of the specific casings we need here e.g.
id, err := azure.ParseResourceID(...)
..
name := id.Path["HealthProbeSettings"]
if name == "" {
name = id.Path["healthProbeSettings"]
}
if we wrap this in an ID parsing function (e.g. as shown in #5356) we should be able to instead reuse the existing function?
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.
Fixed.
@@ -198,7 +200,7 @@ func resourceArmFrontDoor() *schema.Resource { | |||
string(frontdoor.HTTPSOnly), | |||
string(frontdoor.MatchRequest), | |||
}, false), | |||
Default: string(frontdoor.MatchRequest), | |||
Default: string(frontdoor.HTTPSOnly), |
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 is a breaking change?
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.
Yes, but the entire cache section it totally broken and this change enables the disabling of the cache. Currently there is no way to disable cache with the originally released resource.
"cache_query_parameter_strip_directive": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ValidateFunc: validation.StringInSlice([]string{ | ||
string(frontdoor.StripAll), | ||
string(frontdoor.StripNone), | ||
}, false), | ||
Default: string(frontdoor.StripNone), |
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 is a breaking change?
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.
Same.
|
||
* `custom_forwarding_path` - (Optional) Path to use when constructing the request to forward to the backend. This functions as a URL Rewrite. Default behavior preserves the URL path. | ||
|
||
* `forwarding_protocol` - (Optional) Protocol to use when redirecting. Valid options are `HttpOnly`, `HttpsOnly`, or `MatchRequest`. Defaults to `MatchRequest`. | ||
* `forwarding_protocol` - (Optional) Protocol to use when redirecting. Valid options are `HTTPOnly`, `HTTPSOnly`, or `MatchRequest`. Defaults to `HTTPSOnly`. |
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.
these aren't the values from the SDK:
// RedirectProtocol enumerates the values for redirect protocol.
type RedirectProtocol string
const (
// RedirectProtocolHTTPOnly ...
RedirectProtocolHTTPOnly RedirectProtocol = "HttpOnly"
// RedirectProtocolHTTPSOnly ...
RedirectProtocolHTTPSOnly RedirectProtocol = "HttpsOnly"
// RedirectProtocolMatchRequest ...
RedirectProtocolMatchRequest RedirectProtocol = "MatchRequest"
)
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.
Fixed.
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
Co-Authored-By: Tom Harvey <tombuildsstuff@users.noreply.github.com>
@tombuildsstuff @katbyte This PR is 100% done and with no breaking changes and it would be great if this could make it into v1.42.0 as there are a lot of customers waiting for this fix. |
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.
Aside from two minor comments this LGTM 👍
|
||
* `cache_use_dynamic_compression` - (Optional) Whether to use dynamic compression when caching. Valid options are `true` or `false`. Defaults to `true`. | ||
* `cache_use_dynamic_compression` - (Optional) Whether to use dynamic compression when caching. Valid options are `true` or `false`. Defaults to `false`. |
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.
should this be true?
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.
I believe this was a documentation error, as in the schema in master the default value is also false. So I think this is good.
c["cache_enabled"] = false | ||
|
||
//get `forwarding_configuration` | ||
if o, ok := oldByName[*name]; ok { |
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.
Name could be nil so we'll need to nil check it
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.
yep yep
This has been released in version 1.42.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 = "~> 1.42.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 👉 hashibot-feedback@hashicorp.com. Thanks! |
Original PR #4618
Fixes #4461