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

Bug: azurerm_frontdoor fix for caching issue #5358

Merged
merged 35 commits into from
Jan 25, 2020
Merged

Conversation

WodansSon
Copy link
Collaborator

@WodansSon WodansSon commented Jan 9, 2020

Original PR #4618
Fixes #4461

Copy link
Contributor

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

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:

  1. 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?
  2. 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) {
Copy link
Contributor

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?

Copy link
Collaborator Author

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),
Copy link
Contributor

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?

Copy link
Collaborator Author

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),
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same.

website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved
website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved
website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved
website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved
website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved

* `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`.
Copy link
Contributor

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"
)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

website/docs/r/front_door.html.markdown Outdated Show resolved Hide resolved
WodansSon and others added 17 commits January 13, 2020 15:24
@ghost ghost added size/M and removed size/L labels Jan 14, 2020
@ghost ghost added size/XL and removed size/L labels Jan 23, 2020
@tombuildsstuff tombuildsstuff modified the milestones: v1.42.0, v1.43.0 Jan 24, 2020
@WodansSon WodansSon modified the milestones: v1.43.0, v1.42.0 Jan 24, 2020
@WodansSon
Copy link
Collaborator Author

WodansSon commented Jan 24, 2020

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

@WodansSon
Copy link
Collaborator Author

image

Copy link
Collaborator

@katbyte katbyte left a 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`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be true?

Copy link
Collaborator Author

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 {
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep yep

@WodansSon WodansSon merged commit d42f493 into master Jan 25, 2020
@WodansSon WodansSon deleted the rf_frontdoor_cache branch January 25, 2020 01:44
WodansSon added a commit that referenced this pull request Jan 25, 2020
@ghost
Copy link

ghost commented Jan 27, 2020

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

@ghost
Copy link

ghost commented Mar 28, 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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure FrontDoor : Caching issue - Unexpected resource modifying
3 participants