Open ThorstenFR-Cyber opened 1 month ago
I get this error when I run the current test suite against netbox 4.0.2 as well, so I figure this is caused by a change made in netbox 4.0.
ATM, the provider does not support netbox 4.0. This will be next up once we have some of the recent PRs merged.
I may have found the problem. It comes from a repository https://github.com/fbreckle/go-netbox that defines the structure of the requests, specifically in the nested_ip_address.go
file. It is necessary to change the NestedIPAddress
structure from:
type NestedIPAddress struct {
// Address
//
// IPv4 or IPv6 address (with mask)
// Required: true
Address *string `json:"address"`
// Display
// Read Only: true
Display string `json:"display,omitempty"`
// Family
// Read Only: true
Family int64 `json:"family,omitempty"`
// ID
// Read Only: true
ID int64 `json:"id,omitempty"`
// Url
// Read Only: true
// Format: uri
URL strfmt.URI `json:"url,omitempty"`
}
to:
type NestedIPAddress struct {
// Address
//
// IPv4 or IPv6 address (with mask)
// Required: true
Address *string `json:"address"`
// Display
// Read Only: true
Display string `json:"display,omitempty"`
// Family
// Read Only: true
Family struct {
ID int64 `json:"id"`
Label string `json:"label"`
} `json:"family,omitempty"`
// ID
// Read Only: true
ID int64 `json:"id,omitempty"`
// Url
// Read Only: true
// Format: uri
URL strfmt.URI `json:"url,omitempty"`
}
I will test this change over the weekend to see if it fixes the problem and does not impact the older versions of NetBox.
Well, yeah, that is my dedicated library to support this provider. Naturally, it will need to be adjusted for netbox 4.0.
Changing the type of the Family
field will lead to unmarshalling errors in older versions, I suppose.
@fbreckle any chance to get this somehow fixed? 4.x is already out for quite some time…
No, it won't be fixed right away. I haven't resolved the issues yet because it's not just this function that's impacted. Additionally, after my modifications, the old versions of Netbox won't work anymore. He wants to merge all the PRs before patching for version 4.x.
Basically, yes.
Since 4.0 support will break 3.x versions, I prefer to get features merged right now, release a final 3.x provider version (including the new features) and THEN do the 4.0 upgrade.
Plus just got out of Pentecost, which has impacted the time I had to work on this provider.
Any update about this? I have the same error.
Thanks for your effort and your work
Issue Reporting Guide
Hi there,
I can't retrieve information about VMs in Netbox using Terraform. I'm encountering an error related to type
int64
. I have checked the code, but I couldn't findNestedIPAddress.results.primary_ip.family
. If you can help, that would be great.Netbox Version
V4.0.2
Terraform Version
Terraform v1.7.4 on linux_amd64
Affected Resource(s)
Debug Output
https://gist.github.com/ThorstenFR-Cyber/6a60d4dd9a039953bb8ab1b055a9fffe
Expected Behavior