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

Remove IP Prefix description if it is null #382

Merged
merged 1 commit into from
May 7, 2023
Merged

Remove IP Prefix description if it is null #382

merged 1 commit into from
May 7, 2023

Conversation

DevOpsFu
Copy link

This PR fixes an issue whereby removing the description of an IP Prefix had no effect when applied.

This will set the description to a single space (" ") if the description is passed in as null. Setting the description to an empty string also does not appear to clear the description, so this uses the same pattern as in the IP Address resource type.

@fbreckle
Copy link
Collaborator

fbreckle commented May 3, 2023

Hi,

thanks for your PR!
Can you add a test that verifies this behavior? I.e.: Add a test that fails without your fix, but succeeds with it.

@DevOpsFu
Copy link
Author

DevOpsFu commented May 3, 2023

Can you add a test that verifies this behavior? I.e.: Add a test that fails without your fix, but succeeds with it.

I'll try! I'm not very familiar with tests in Go, but I'll certainly take a look and update this PR when I've had time.

This will set the description to a single space (`" "`) if the
description is passed in as `null`. Previously, a null description was
not updating the description in the NetBox API call, and so the resource
was showing an expected change on every plan.
@fbreckle fbreckle merged commit 464b613 into e-breuninger:master May 7, 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