-
Notifications
You must be signed in to change notification settings - Fork 63
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
v2.0.9 of the Provider is a breaking change / not backwards compatible #304
Comments
I was able to showcase the The root cause is that the fields, even when empty, are now being sent to the API on POST requests and it is performing validation. The validation must not be performed when the fields are not sent, which is the old behavior. // You can edit this code!
// Click here and start typing.
package main
import (
"encoding/json"
"fmt"
)
type OmitEmpties struct {
Map map[string]string `json:"map,omitempty"`
List []string `json:"list,omitempty"`
Number int `json:"number"`
}
type NoOmits struct {
Map map[string]string `json:"map"`
List []string `json:"list"`
Number int `json:"number"`
}
func main() {
noOmits := &NoOmits{
Number: 1,
}
omits := &OmitEmpties{
Number: 1,
}
fmt.Println("OmitEmpty")
omitBytes, err := json.Marshal(omits)
fmt.Println(err)
fmt.Println(string(omitBytes))
fmt.Println()
fmt.Println()
fmt.Println("No Omit Empty")
noOmitBytes, err := json.Marshal(noOmits)
fmt.Println(err)
fmt.Println(string(noOmitBytes))
} Note the output: OmitEmpty
<nil>
{"number":1}
No Omit Empty
<nil>
{"map":null,"list":null,"number":1} |
Related PRs:
|
Closed based on discussion in ns1/ns1-go#222 @tlkamp Please open a new issue if you're still experiencing any with the latest provider version. |
Terraform Version
Terraform v1.5.2
Affected Resource(s)
ns1_record
Terraform Configuration
Plan Output
Expected Behavior
I expected updates to the answer section on my record to succeed.
Actual Behavior
I'm receiving the following error:
Error: POST https://api.nsone.net/v1/zones/MYZONE/MYRECORD/A: 400 tags and blocked_tags must be updated together
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
tags
orblocked_tags
specifiedWorkaround
v2.0.8
tags
andblocked_tags
null
or empty values ({}
and[]
respectively) does not workReferences
The text was updated successfully, but these errors were encountered: