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

fix: Add error to tags lookup if tag does not exist #400

Merged
merged 1 commit into from
May 25, 2023

Conversation

tagur87
Copy link
Contributor

@tagur87 tagur87 commented May 11, 2023

There has been no error or check to determine if a tag exists already or not. This causes the terraform to always try to make a change if the tag does not exist, since there's no indication that the lookup didn't find anything.

This is helpful, since it provides feedback to the user that the associated tag does not exist, and needs to be added with the netbox_tag resource.

Since there are a lot of resources that use tags, we are only activating this feature on the netbox_virtual_machine resource to start. It can be added to other resources by returning the diag and appending it to the return of the function.

There has been no error or check to determine if a tag exists already
or not. This causes the terraform to always try to make a change if the
tag does not exist, since there's no indication that the lookup didn't
find anything.

This is helpful, since it provides feedback to the user that the
associated tag does not exist, and needs to be added with the
`netbox_tag` resource.

Since there are a lot of resources that use tags, we are only activating
this feature on the netbox_virtual_machine resource to start. It can
be added to other resources by returning the diag and appending it to
the return of the function.
@tagur87 tagur87 force-pushed the virtual-machine-tags branch from 88bb1f5 to e1eead9 Compare May 11, 2023 18:00
@fbreckle fbreckle merged commit 7b98abf into e-breuninger:master May 25, 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.

2 participants