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

Add site and site_slug labels to device services #171

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

jkrcma
Copy link
Contributor

@jkrcma jkrcma commented Apr 4, 2024

Describe your changes

Hello,

when developing an internal Service Discovery framework I found out that Netbox devices do not necessarily have the Site label present. When digging I found out that the condition applies only to devices without Cluster set. I've made this PR to prioritize locally configured Site of the device object, instead of Rack or Cluster. Given how loose the constraints in Netbox database are, I might have missed something. Let me know please!

Issue ticket number and link

None.

Checklist before requesting a review

  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.

@FlxPeters
Copy link
Owner

@jkrcma tests seem to be broken. Can you please check and fix this?
I agree with the change at all, so if the build is green we can move forward.

@jkrcma
Copy link
Contributor Author

jkrcma commented Apr 19, 2024

Looks like a consequence of the change I did in b40f30e. Despite using Docker I wasn't able to make tests running on my local laptop without that commit. Thanks for the CI output, I will dig in it.

@jkrcma
Copy link
Contributor Author

jkrcma commented Apr 19, 2024

Alright, figured out. I did a mistake in the first step of delegating the venv to poetry itself. I apologize, haven't worked with it much lately 🙂

@FlxPeters
Copy link
Owner

Looks good to me regarding the code. Can you please reformat the commits to comply with the semantic commit convention (https://github.com/FlxPeters/netbox-plugin-prometheus-sd?tab=readme-ov-file#conventional-commits)?

@jkrcma
Copy link
Contributor Author

jkrcma commented Apr 22, 2024

Done, let me know if you have any suggestion for the scope of the feat one. I was thinking of api or services, but I chose to not specify it at all.

@FlxPeters FlxPeters merged commit 0b532f8 into FlxPeters:main Apr 22, 2024
7 checks passed
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