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

feat(xo-server-netbox): synchronize VM tags #6957

Merged
merged 4 commits into from
Aug 8, 2023
Merged

Conversation

pdonias
Copy link
Member

@pdonias pdonias commented Jul 28, 2023

DO NOT SQUASH!

Fixes #5899
See Zammad#12478
See https://xcp-ng.org/forum/topic/6902

Screenshots

Capture_2023-07-28_17:09:39
Capture_2023-07-28_17:09:59

Description

Synchronize XO VM tags with Netbox VM tags.

Checklist

  • Commit
    • Title follows commit conventions
    • Reference the relevant issue (Fixes #007, See xoa-support#42, See https://...)
    • If bug fix, add Introduced by
  • Changelog
    • If visible by XOA users, add changelog entry
    • Update "Packages to release" in CHANGELOG.unreleased.md
  • PR
    • If UI changes, add screenshots
    • If not finished or not tested, open as Draft

@pdonias pdonias requested a review from julien-f July 28, 2023 15:21
@pdonias pdonias force-pushed the pierre-netbox-sync-tags branch 2 times, most recently from 9f2fc81 to d8f5594 Compare July 28, 2023 15:28
@@ -306,7 +306,7 @@ class Netbox {

log.info('Synchronizing VMs')

const createNetboxVm = async (vm, { cluster, platforms }) => {
const createNetboxVm = async (vm, { cluster, platforms, netboxTags }) => {
Copy link
Member

Choose a reason for hiding this comment

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

Can you find a better name than netboxTags?

Also, it make the code a bit harder to understand with cluster vs netboxTags.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm trying to differentiate Netbox objects from XO objects even when there's no variable name conflict (tag vs netboxTag). But when the object type was already different, I didn't namespace them (pool vs cluster). But maybe I should? And maybe I should also namespace XO objects?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure, maybe always prefixing objects with xo and nb would make the code clearer 🤔

What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I like it. It might be a bit verbose but at least it's clear and consistent.

@pdonias pdonias force-pushed the pierre-netbox-sync-tags branch from 274f7d6 to df97d22 Compare August 7, 2023 14:39
@pdonias pdonias requested a review from julien-f August 7, 2023 14:40
@julien-f julien-f force-pushed the pierre-netbox-sync-tags branch from df97d22 to 439a1df Compare August 8, 2023 13:05
@julien-f julien-f force-pushed the pierre-netbox-sync-tags branch from 439a1df to 54b633f Compare August 8, 2023 13:08
@pdonias pdonias requested a review from julien-f August 8, 2023 13:22
@julien-f julien-f merged commit 3081810 into master Aug 8, 2023
@julien-f julien-f deleted the pierre-netbox-sync-tags branch August 8, 2023 13:23
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.

Netbox Plugin: tags export
2 participants