smutel/terraform-provider-netbox

Fail fetching virtualization cluster with NetBox 3.2.0

Closed this issue · 7 comments

Summary

We bumped our NetBox version from 3.1.11 to 3.2.0, and since then, the netbox_virtualization_cluster datasource stopped working. Apparently they converted the "created" field in the "virtualization_cluster" table from date to timestamp with timezone.

Edit:
Just checked their changelog, and it's a global change: https://github.com/netbox-community/netbox/releases/tag/v3.2.0 :(
And also, this is due to go-netbox usage in here I guess: netbox-community/go-netbox#127

Version

Netbox version

3.2.0

Terraform version

1.1.7

Provider version

3.0.0

Issue details

Affected Data(s) / Resource(s)

  • data netbox_virtualization_cluster

Terraform Configuration Files

# Fetch cluster information from NetBox
data "netbox_virtualization_cluster" "cluster" {
  name = format("openstack-%s", var.environment)
}

Terraform Output

│ Error: parsing time "2022-04-11T00:00:00Z": extra text: "T00:00:00Z"
│ 
│   with module.instances.module.mytestmachine.data.netbox_virtualization_cluster.cluster,
│   on ../../modules/instance/netbox.tf line 2, in data "netbox_virtualization_cluster" "cluster":
│    2: data "netbox_virtualization_cluster" "cluster" {
│ 

Behaviors

Actual Behavior

  • This prevents terraform plan/apply from completing.

Expected Behavior

  • We should be able to run terraform plan/apply.

Steps to Reproduce

  1. terraform plan

Edited the issue, but definitely not something due to this provider, sorry for this, should have checked upstream before :)

Hello together,

is there any news on this yet? I'm struggling with the same problem after updating the Netbox to 3.2.0.

Please check the compatibility matrix in the readme.

Hello, will the provider ever be compatible with NetBox 3.2? Apparently, the go-netbox code has been fixed already.
netbox-community/go-netbox#127
https://github.com/netbox-community/go-netbox/releases/tag/netbox_v3.2

Hello,

This project is not using https://github.com/netbox-community/go-netbox but https://github.com/smutel/go-netbox for several reasons.

Generating the library and updating this provider each time a version is released is very time consuming. In addition, Netbox application is sometimes breaking the API even if it is a patch release (3.2.1 => 3.2.2).

So I prefer to wait the final release of a minor version (3.0.12, 3.1.12, ...) to create a new provider.

@smutel The API breaking change was done in 3.2.0, according to general guidelines.
It would be a shame to wait a year to make this terraform provider compatible with 3.2. There are so many nice improvements and new features in 3.2

Agree, not good to force people to wait so long to be able to upgrade NetBox, especially since this apparently must not be a big change on the code level.