-
Notifications
You must be signed in to change notification settings - Fork 140
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] VM Type int64 Netbox v4.0.2 #598
Comments
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 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 |
@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 |
Do you have any eta on this @fbreckle ? :) |
i wonder if we could use different versions of the library depending on the Netbox version. if there is a new major of the api lib, you can use both at the same time in a Go project |
We are also affected but unfortunately there is no easy path backwards for us. Wouldn't it be better to implement wrapped client using different libs depending on version of netbox api? (not that i am skilled enough to implement it) |
I feel that this will massively bloat the provider over time. Consider what happens when completely new resources arrive, attributes get changed etc. My gut tells me to stick to the current approach of supporting the latest version (and yes, I know we're way behind on that). |
so it might make more sense if i just put up a PR to support 4.x? |
I went ahead and implemented everything in feature/netbox-4.0. HOWEVER I basically took your implementation and removed the version switches, so I absolutely want to encourage you to make your own commits and PR so you get the credit. I just had to see it work myself first. |
The one comment from me is probably is best to bump the version to 4 as to be more aligned with netbox and signify that breakage will occur. Will try to test it tomorrow |
Nah, if we match the major version of netbox, we will have the same problem when breaking changes in the provider occur. The big things to do are custom fields and generalized data source parameters. I want to use major versions for these. |
no worries, that's not a big deal. if you want you can throw a just happy to see progress on the 4.x support |
At least for my use case (vm, addr, interface, primary ip of the vm) works. Just it complains that it is not compatible with the version of netbox ( https://github.com/e-breuninger/terraform-provider-netbox/blob/feature/netbox-4.0/netbox/provider.go#L298 ) |
Oh, absolutely. I'll fix that and release later today. |
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
The text was updated successfully, but these errors were encountered: