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

Return tags associated with ip addresses. #406

Merged
merged 3 commits into from
May 31, 2023

Conversation

pier-nl
Copy link
Contributor

@pier-nl pier-nl commented May 30, 2023

I extended the dataSourceNetboxIpAddressesRead function so it will return the list of tags which are connected to the ip addresses.

@fbreckle
Copy link
Collaborator

Hi and thank you for your MR!

Please add tests for the new functionality.

@pier-nl
Copy link
Contributor Author

pier-nl commented May 30, 2023

new_results
original_results
TFCode
Added test results from Terraform with connection to our local Netbox installation.

@fbreckle
Copy link
Collaborator

No, what I meant is that the feature should be added to the automated test suite.
In your case, this means that you should add the feature as part of a test in https://github.com/e-breuninger/terraform-provider-netbox/blob/master/netbox/data_source_netbox_ip_addresses_test.go.

If you are unable or unwilling to do so, ping me so I can help you or add the tests.

@pier-nl
Copy link
Contributor Author

pier-nl commented May 31, 2023

I have extended the TestAccNetboxIpAddressesDataSource_basic function to compare the value of netbox_tag.test.name with the returned data in data.netbox_ip_addresses.test.ip_addresses.0.tags.0.name.

I hope this is what you meant when asking for tests.. Sorry, but i am a newbie for collaborating at open-source projects.

@fbreckle
Copy link
Collaborator

The good thing here was that tags were already implemented in the test resources. That means all you had to do was to verify that the tag attribute is actually set.

Good job!

@fbreckle fbreckle merged commit 67f9aca into e-breuninger:master May 31, 2023
23 checks passed
twink0r pushed a commit to twink0r/terraform-provider-netbox that referenced this pull request Sep 15, 2023
* Return tags associated with ip addresses.

* Extended TestAccNetboxIpAddressesDataSource_basic

* chore: Fix some whitespace

---------

Co-authored-by: Pier Nijenhuis <pnijenhuis@infinitaslearning.com>
Co-authored-by: Fabian Breckle <fabian.breckle@breuninger.de>
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.

None yet

3 participants