Skip to content

always marshal CustomHostnameSSL.Wildcard into api request body payload#604

Merged
jacobbednarz merged 1 commit intocloudflare:masterfrom
nicktate:ntate/custom-hostname-ssl-wildcard-marshal
Mar 24, 2021
Merged

always marshal CustomHostnameSSL.Wildcard into api request body payload#604
jacobbednarz merged 1 commit intocloudflare:masterfrom
nicktate:ntate/custom-hostname-ssl-wildcard-marshal

Conversation

@nicktate
Copy link
Copy Markdown

@nicktate nicktate commented Mar 5, 2021

Description

When the CustomHostnameSSL field is converted to a json payload for the http request body, the Wildcard value is stripped when set to false.

Has your change been tested?

  • I tested updating a custom hostname wildcard from true to false with my branch and the update succeeded
  • The modified tests also succeeded via go test .

Types of changes

What sort of change does your code introduce/modify?

  • Breaking change (fix or feature that would cause existing functionality to change)

Previously omitting the Wildcard key from the CustomHostname struct would effectively execute a partial update and omit the update of the wildcard field. Custom hostname updates will now always set the wildcard to the value of the passed in struct (whether or not explicitly referenced).

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jacobbednarz
Copy link
Copy Markdown
Contributor

I think we may need a similar approach to #595 whereby we use a boolean pointer and explicitly set the value when it is expected. IIRC, this puts tools like Terraform in a bad position to handle changes as is.

As this is breaking change (and we've just cut 0.14 which was also breaking) we will need to wait for another breaking release to handle this one.

@nicktate nicktate force-pushed the ntate/custom-hostname-ssl-wildcard-marshal branch from 05ac28a to 6bacf8b Compare March 8, 2021 17:43
@nicktate
Copy link
Copy Markdown
Author

nicktate commented Mar 8, 2021

I think we may need a similar approach to #595 whereby we use a boolean pointer and explicitly set the value when it is expected. IIRC, this puts tools like Terraform in a bad position to handle changes as is.

As this is breaking change (and we've just cut 0.14 which was also breaking) we will need to wait for another breaking release to handle this one.

Updated for a *bool -- good callout on the terraform implications

@jacobbednarz jacobbednarz added this to the v0.15 milestone Mar 8, 2021
@jacobbednarz jacobbednarz merged commit f12a197 into cloudflare:master Mar 24, 2021
@jacobbednarz
Copy link
Copy Markdown
Contributor

Thanks for this @nicktate. I suspect this will be going out in our next release as 0.15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants