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 sync rule restore from snapshot on name change #2467

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

raviks789
Copy link
Collaborator

Icinga director throws error when we try to restore sync rule from snapshot of the configuration basket after its name has been changed.

ref/IP/37949

@cla-bot cla-bot bot added the cla/signed label Jan 28, 2022
@raviks789 raviks789 force-pushed the fix/sync-rule-snapshot-restore branch 3 times, most recently from 34daa0b to e55975d Compare January 28, 2022 11:33
@Thomas-Gelf
Copy link
Contributor

Hi @raviks789,

thanks a lot! The second part of this pull request scares me a little bit, however I didn't investigate whether it has or hasn't any side effects. Anyway, the culprit is elsewhere: I do not like what SyncRule::import() does with IDs. Guess the original idea was to "preserve IDs, at least where possible". Didn't work out as intended, that's why other import methods are not doing so. I'll check whether that special treatment can be removed an let you know, that would fix the problem at it's root.

Cheers,
Thomas

@wp-perc
Copy link
Contributor

wp-perc commented Mar 17, 2022

Hi @Thomas-Gelf, I am the source of this headache of yours :)

The issue behind this pull request is a good blocker for us.
Do you think will be merged anytime soon?

@Thomas-Gelf
Copy link
Contributor

Hi @wp-perc,

I'm in contact with @raviks789. The pull request will not be merged as it is, he'll provide a modified version. On name change, a new Sync Rule will be created. We're not going to deal with IDs, as this is too dangerous once multiple systems are involved.

In future we'll bring UUIDs to non-Icinga-objects (and to our baskets) too, and then we'll allow baskets to also rename objects.

Cheers,
Thomas

On name change new Sync rule would be created, hence we do not have to preserve the Sync rule Ids in SyncRule::import() method.
@raviks789 raviks789 force-pushed the fix/sync-rule-snapshot-restore branch from e55975d to 25a0391 Compare March 17, 2022 13:37
@Thomas-Gelf Thomas-Gelf added this to the 1.9.1 milestone Mar 17, 2022
Copy link
Contributor

@Thomas-Gelf Thomas-Gelf left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@Thomas-Gelf Thomas-Gelf merged commit 71f3654 into master Mar 17, 2022
@Thomas-Gelf Thomas-Gelf deleted the fix/sync-rule-snapshot-restore branch March 17, 2022 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants