hitachienergy / epiphany

Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Apache License 2.0
138 stars 107 forks source link

[BUG] [Ubuntu] download-requirements.py ignores package version when resolving dependencies #3209

Closed to-bar closed 2 years ago

to-bar commented 2 years ago

Describe the bug In requirements/x86_64/debian/ubuntu-20.04/packages.yml we have some packages with version (e.g. rabbitmq-server=3.8.9*) but only the name is passed to get_package_dependencies method: https://github.com/epiphany-platform/epiphany/blob/059ad6f66626c24f7573426c94cb096f1dde929b/ansible/playbooks/roles/repository/files/download-requirements/src/mode/debian_family_mode.py#L109

The underlying command may give different results, for example:

# apt-cache depends --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends rabbitmq-server | wc -l
31

vs

# apt-cache depends --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --no-pre-depends rabbitmq-server=3.8.9* | wc -l
59

How to reproduce Run /var/tmp/epi-download-requirements/download-requirements.py /var/www/html/epirepo ubuntu-20.04 --repos-backup-file /var/tmp/enabled-system-repos.tar --log-level=debug on repository host.

Expected behavior Download dependencies that correspond to the specified package version instead of the latest.

Environment

epicli version: 2.0.0

Additional context n/a


DoD checklist