smutel / terraform-provider-netbox

Terraform provider for Netbox
ISC License
58 stars 19 forks source link

Fail fetching virtualization cluster with NetBox 3.2.0 #98

Closed arcalys closed 2 years ago

arcalys commented 2 years ago

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: https://github.com/netbox-community/go-netbox/issues/127

Version

Netbox version

3.2.0

Terraform version

1.1.7

Provider version

3.0.0

Issue details

Affected Data(s) / Resource(s)

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

Expected Behavior

Steps to Reproduce

  1. terraform plan
arcalys commented 2 years ago

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

2boostit commented 2 years ago

Hello together,

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

smutel commented 2 years ago

Please check the compatibility matrix in the readme.

CSimpiFoN commented 2 years ago

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

smutel commented 2 years ago

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.

PieterL75 commented 2 years ago

@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

CSimpiFoN commented 2 years ago

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.