Skip to content
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

Rack Support #358

Merged
merged 9 commits into from
Mar 26, 2023
Merged

Conversation

joeyberkovitz
Copy link
Contributor

Closes #352

New resources:

  • netbox_rack
  • netbox_rack_reservation
  • netbox_rack_role

New data sources:

  • netbox_rack_role
  • netbox_racks

Adds support for referencing rack and rack location in a netbox_device resource and data source

Depends on fbreckle/go-netbox#27, tests will break until merged. Tests will also break in master if the go-netbox changes are merged without this PR (specifically commit minimal updates to API 3.4).

Added minimal support for API version 3.4 to ensure that current functionality remains the same

@joeyberkovitz
Copy link
Contributor Author

pushed an update to fix the device rack functionality when a rack is cleared out after being set

let me know once the netbox client PR is merged and I can update the go.mod

Also note that TestAccNetboxProviderConfigure_failure started to fail for me with error context deadline exceeded instead of a DNS lookup failure. If it fails on the CI/CD server, this may need to change, but I left it as is since it's unrelated.

@joeyberkovitz
Copy link
Contributor Author

not sure why the code is failing to build for the tests given that it seems to work fine locally with the same go.mod as on git

@joeyberkovitz
Copy link
Contributor Author

rebased to master and fixed the issue caused by the merge, hopefully should work now

@joeyberkovitz
Copy link
Contributor Author

Looks like tests fail on older versions of netbox which don't support the new attributes added in API 3.4. I think those attributes are primarily metadata, so I can remove them from the tests unless you have any suggestions?

@fbreckle
Copy link
Collaborator

fbreckle commented Mar 26, 2023

Since this patch contains content that is useful for 3.3 users, I think we should for now continue supporting that version.
Then, when a new 3.3 version is out and there are on features pending on the provider, we can make the jump to release only for 3.4.
Edit: Just to point out: what you did in 498f31c was what I wanted

return strVal
}

func getOptionalVal[SchemaT int | float64, ApiT int64 | float64](d *schema.ResourceData, key string) *ApiT {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL Go now has generics 😮

@fbreckle fbreckle merged commit bae0b35 into e-breuninger:master Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can this provider manage racks?
2 participants