-
Notifications
You must be signed in to change notification settings - Fork 66
Fix: Unordered IIS Site Binding Comparison to Prevent Unnecessary Resource Updates #407
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
base: main
Are you sure you want to change the base?
Fix: Unordered IIS Site Binding Comparison to Prevent Unnecessary Resource Updates #407
Conversation
457e9fc
to
50f4495
Compare
@span786 Can you please review this? do you want me to add changelog and metadata updates as well to this PR ? |
9556945
to
97e3699
Compare
Could you please add the tests? |
Thanks for the reply, I don't see the spec jobs running when I push, so I can't find those issues when I make changes, I saw that job only when you commented so can you point me in the right direction please how can I get those jobs running spec tests for my push ? |
You can check the test steps, and follow the same while running tests in your local |
@span786 Added unit test and removed the unused and unreferenced bindings class and tested locally (attached the spec run log here for your reference).
|
5bc9435
to
281f394
Compare
Sites using non-HTTP protocols (net.pipe, net.tcp, net.msmq, msmq.formatname) were reapplied on every Puppet run due to unreliable sorting and hash order sensitivity in binding comparison. Replace custom sorting with set-based comparison to ensure identical bindings are recognized regardless of array order or hash property order. Resolves: Continuous configuration drift for non-HTTP protocol bindings
Add comprehensive unit tests to validate the new set-based binding comparison logic in iis_site type. Tests verify that: - Bindings with identical content but different order are in sync - Bindings with different content are correctly detected as out of sync - Bindings with different counts are properly identified as out of sync These tests ensure the order-independent comparison works correctly and prevent regression to order-sensitive behavior.
- Document hostname-only format for net.pipe, net.msmq, msmq.formatname - Document port:hostname format for net.tcp - Add comprehensive multi-protocol example - Clarify SSL parameter restrictions for HTTPS only
b7328d2
to
68edd94
Compare
Fix IIS Site Binding Comparison to Prevent Unnecessary Resource Updates
Summary
This pull request modifies the
insync?
method in thebindings
property of theiis_site
resource type to use a set-based comparison instead of an order-dependent array comparison. This change prevents Puppet from detecting false differences and unnecessarily reapplying bindings when the only difference is the order in which IIS returns the bindings.The specific change:
insync?
method inPuppet/iis/lib/puppet/type/iis_site.rb
to convert binding arrays to sets before comparison, making the comparison order-independentAdditional Context
Root cause and the steps to reproduce:
net.msmq
andmsmq.formatname
).net.msmq
andmsmq.formatname
both using the same hostname). Run Puppet multiple times and observe that it detects changes and reapplies the bindings on every run.Thought process behind the implementation:
sort_bindings
method to ensure a stable sortinsync?
methodRelated Issues
This PR addresses an issue where IIS sites with multiple binding types would be unnecessarily updated on every Puppet run, causing potential service disruptions and increased Puppet run times.
Checklist