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

Package manager list wrong deps #1455

Closed
TeddyAndrieux opened this issue Jul 19, 2019 · 0 comments
Closed

Package manager list wrong deps #1455

TeddyAndrieux opened this issue Jul 19, 2019 · 0 comments
Assignees
Labels
complexity:medium Something that requires one or few days to fix kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages topic:lifecycle Issues related to upgrade or downgrade of MetalK8s

Comments

@TeddyAndrieux
Copy link
Collaborator

Component:

'salt', 'kubernetes'

What happened:

If several version of a package is available in our repos then the module metalk8s_package_manager.list_pkg_deps will take the wrong one

[root@bootstrap ~]# repoquery --whatrequires --recursive --qf '%{NAME} %{VERSION}-%{RELEASE}' kubelet-1.12.9 --disablerepo '*' --enablerepo 'metalk8s-*'
calico-cni-plugin 3.8.0-1.el7
kubelet 1.12.9-0
kubelet 1.13.7-0
kubernetes-cni 0.7.5-0
[root@bootstrap ~]# salt-call metalk8s_package_manager.list_pkg_deps kubelet 1.12.9 fromrepo="metalk8s-*"
local:
    ----------
    calico-cni-plugin:
        3.8.0-1.el7
    kubelet:
        1.13.7-0
    kubernetes-cni:
        0.7.5-0

What was expected:

Get the right kubelet version.

Steps to reproduce

Configure repo to have several version of kubelet (or another package) available.

Resolution proposal (optional):

Does not use --recursive in the module and do the recursive search manually filtering out package already found.

@TeddyAndrieux TeddyAndrieux added kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages moonshot topic:lifecycle Issues related to upgrade or downgrade of MetalK8s complexity:medium Something that requires one or few days to fix labels Jul 19, 2019
@TeddyAndrieux TeddyAndrieux added this to the MetalK8s 2.0.0-alpha4 milestone Jul 19, 2019
@TeddyAndrieux TeddyAndrieux self-assigned this Jul 23, 2019
TeddyAndrieux added a commit that referenced this issue Jul 23, 2019
…ates

Does not use `--recursive` with repoquery to always take the closer
requires version instead of the last one.

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 25, 2019
gdemonet added a commit that referenced this issue Jul 26, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (due to the `--recursive` behaviour from `repoquery`)
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method
- inefficient listing of all possible requires, while one should only
  consider the packages managed by this MetalK8s version (referenced in
  `salt://metalk8s/versions.json`

We fix the issues by:

- implementing our own recursive search for requires, filtering based on
  the `repo:packages` pillar information
- renaming and documenting this custom module for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 26, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 26, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 26, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 29, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 29, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
gdemonet added a commit that referenced this issue Jul 30, 2019
The previous implementation had the following issues:

- a bug when listing from a repository containing multiple versions of a
  single package (can happen with dirty ISO tree during development),
  as it was not able to choose the 'good one'.
- bad naming of functions/variables and imperfect documentation, leading
  to misunderstandings w.r.t. the goal of this method

We fix the issues by:

- implement filtering based on the `repo:packages` pillar information,
  which is already used by the `pkg_installed` macro
- renaming and documenting these custom methods for easier maintenance

Fixes: #1455
@bert-e bert-e closed this as completed in 5ffd747 Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:medium Something that requires one or few days to fix kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages topic:lifecycle Issues related to upgrade or downgrade of MetalK8s
Projects
None yet
Development

No branches or pull requests

1 participant