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 diffparam_volume and add diffparam_mount and diffparam_tmpfs #448

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Commits on Jul 10, 2022

  1. fix diffparam_volume and add diffparam_mount and diffparam_tmpfs

    This is a fix for bug containers#355.
    
    This compares the arguments podman recieved for the currently existing
    container with the (effective) arguments to come.
    
    This approach was taken over parsing Mounts from inspect because:
    
    1. This line from https://github.com/containers/podman/blob/e084f0ee1e1ded564110e84eefca9f18b5669adf/libpod/container_inspect.go#L224
       regarding inspect's Mount value:
    
       "Only includes user-specified mounts. Only includes bind mounts and named volumes, not tmpfs volumes."
    
       Thus an incomplete solution would result.
    
    2. The code required to parse so that it could be compared with the
       stuff to come was getting silly-level complex.
    
    3. Anonymous volumes were impossible to decipher as both Name and
       Source are filled in with the podman-generated values.
    
    Thus we compare the arguments podman create was run with to make the
    existing container with the closest values to those arguments in the
    new config.
    
    This resulted in simpler code that takes care of the issue of anonymous
    volumes.
    
    The downside is that if someone moves, say, a tmpfs from mount to tmpfs
    (or vice versa) that would reult in exactly the same result this will
    be considered a different config. This can (possibly) be fixed if and
    when it becomes an actual issue.
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Jul 10, 2022
    Configuration menu
    Copy the full SHA
    dff5fc1 View commit details
    Browse the repository at this point in the history
  2. clean paths in diff checks

    The old code removed unnecessary slashes via the _clean_volume()
    function. I accidentally got rid of it and have re-introduced it
    here as self._clean_path().
    
    The rename is because it is used outside of mere check of volumes
    but the internal code is as before.
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Jul 10, 2022
    Configuration menu
    Copy the full SHA
    d36b4a6 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2022

  1. correct string in list context errors and sort mount string

    Began sorting in self._clean_path_in_mount_str() as an early
    defense against ordering of mount arguments changing. This steels
    against false comparison errors later.
    
    Fixed lots of embarrassing string in list context errors. Oops! :(
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Jul 11, 2022
    Configuration menu
    Copy the full SHA
    7de11c1 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2022

  1. fix slash squashing in diffparam_volume and _clean_path

    Made _clean_path() squash multiple consecutive slashes into one as
    3+ slashes are just as meaningful as 1.
    
    Slash handling is now done properly diffparam_volume().
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Jul 12, 2022
    Configuration menu
    Copy the full SHA
    384f258 View commit details
    Browse the repository at this point in the history

Commits on Sep 29, 2022

  1. Configuration menu
    Copy the full SHA
    06f068f View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2022

  1. check --mount, --tmpfs, --volume and VOLUME for changes

    Combine diffparam_mount(), diffparam_tmpfs() and diffparam_volume()
    and add handling of VOLUME into one function that allows for movement
    of definitions between the various ways of specifying mount points
    as long as the options are equivalent.
    
    This necessitated translations of the various ways of defining
    mount points into one single "language" so that the definitions
    may be compared and checked for similarity. prep_mount_args_for_comp()
    does this work and includes within it the default options for the
    various CLI arguments and VOLUME.
    
    The consequence of this is that the diff returned by the function
    no longer literally represents the real-life arguments passed but,
    rather, the translations of those arguments.
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    ca151f5 View commit details
    Browse the repository at this point in the history
  2. number fields in string format and key error

    Fixes:
    
    ERROR: Found 7 pylint issue(s) which need to be resolved:
    ERROR: plugins/module_utils/podman/podman_container_lib.py:1288:37: ansible-format-automatic-specification: Format string contains automatic field numbering specification
    ...
    ERROR: plugins/module_utils/podman/podman_container_lib.py:1400:27: ansible-format-automatic-specification: Format string contains automatic field numbering specification
    
    also:
    
    File "/tmp/ansible_containers.podman.podman_container_payload_6atuqv63/ansible_containers.podman.podman_container_payload.zip/ansible_collections/containers/podman/plugins/module_utils/podman/podman_container_lib.py", line 1405, in diffparam_volumes_all
    KeyError: 'config'
    
    Signed-off-by: Andrew <rubiksdot@grue.cc>
    Andrew committed Oct 12, 2022
    Configuration menu
    Copy the full SHA
    84b11d9 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Configuration menu
    Copy the full SHA
    2c45334 View commit details
    Browse the repository at this point in the history