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

Improve param_changed detection (#881) #883

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bmagistro
Copy link

This attempts to fix the issues identified in #881 and while it does address the identified issues in our scenario, I have some concerns about the approach/sanity of these checks related to the concerns called out by @MasterMind2k in #781 (comment) .

In this case, the comparison for the mounts + volumes does not preserve the source/destination paring so while comparing the list of source and destination mounts might be correct, the pairing could still be wrong ie source1:dest2 when it should be source1:dest1 and wound not trigger the param_changed event that would be desired. When talking about configured volumes, It also does not take into account the mount type such as volume, bind, etc (not sure if this one should as it could be multiple types and still be a valid match in my opinion).

It also seems like this function may break when called on a windows host. All of the start, stop, create, etc calls wrap the command with run_with_powershell while the detect_changes does not.

I would appreciate hearing from @adrianiurca who authored most of this function as I had to guess at a couple things so if additional light can be shed on what it should be accomplishing I can try to make some updates.

@bmagistro bmagistro requested a review from a team as a code owner December 14, 2022 03:48
@CLAassistant
Copy link

CLAassistant commented Dec 14, 2022

CLA assistant check
All committers have signed the CLA.

@puppet-community-rangefinder
Copy link

docker_params_changed is a function

that may have no external impact to Forge modules.

This module is declared in 6 of 580 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@LukasAud
Copy link
Contributor

Hi @bmagistro, thanks for taking the time to work on this issue. Unfortunately, @adrianiurca is not working in Puppet anymore so we don't think it's going to be possible to get more insight around this update than what we already have.

This resolves issues identified around mount/volume comparisons for
non Windows based OSs. I assume the Windows variant has all the issues
found for 881 too but cannot verify/fix.

To resolve the issues, the mounts/volumes are turned into hashes and
the whole hash is compared versus trying to compare lists of keys. This
allows related parameters (source + dest) to be compared at the same time.

Signed-off-by: Ben Magistro <[email protected]>
This resolves issues identified around port comparison by mapping all related fields
into a hash and comparing the whole hash versus individual keys.

Signed-off-by: Ben Magistro <[email protected]>
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