network icon indicating copy to clipboard operation
network copied to clipboard

fix: Allow network to restart when wireless or team connection is specified

Open liangwen12year opened this issue 1 year ago • 20 comments

Enhancement: Ask user's consent to restart NM due to wireless or team interfaces when the updates for network packages are available.

Reason: When wireless or team connections are specified and the updates for network packages are available, NetworkManager must be restarted, the role requires user's consent to restart NetworkManager. Otherwise, there might be property conflicts between NetworkManager daemon and plugin, or NetworkManager plugin is not taking effect.

Result: When wireless or team connections are specified and the updates for network packages are available, NetworkManager must be restarted, the role will ask user's explicit consent to restart NetworkManager.

Issue Tracker Tickets (Jira or BZ if any):

Resolves: https://issues.redhat.com/browse/NMT-1039

liangwen12year avatar Feb 18 '24 03:02 liangwen12year

[citest]

liangwen12year avatar Feb 18 '24 03:02 liangwen12year

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 20.50%. Comparing base (b90e123) to head (0fca710).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #675   +/-   ##
=======================================
  Coverage   20.50%   20.50%           
=======================================
  Files          10       10           
  Lines        1478     1478           
  Branches      433      433           
=======================================
  Hits          303      303           
  Misses       1174     1174           
  Partials        1        1           
Flag Coverage Δ
sanity 20.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 18 '24 03:02 codecov[bot]

[citest]

liangwen12year avatar Feb 18 '24 14:02 liangwen12year

[citest]

liangwen12year avatar Feb 18 '24 20:02 liangwen12year

This seems to be wrong. The role needs to handle this scenario properly (or the NM packages need to be changed).

tyll avatar Feb 19 '24 14:02 tyll

[citest]

liangwen12year avatar Feb 19 '24 21:02 liangwen12year

[citest]

liangwen12year avatar Feb 19 '24 23:02 liangwen12year

[citest]

liangwen12year avatar Feb 20 '24 19:02 liangwen12year

[citest]

liangwen12year avatar Feb 22 '24 02:02 liangwen12year

Since team is deprecated in RHEL-9, I think that it is not appropriate to test team connection in this PR, I will switch to wifi instead tomorrow.

liangwen12year avatar Feb 22 '24 02:02 liangwen12year

[citest]

liangwen12year avatar Feb 27 '24 22:02 liangwen12year

[citest]

liangwen12year avatar Feb 28 '24 23:02 liangwen12year

@richm , about the test failure in c9s container test, my original idea is to remove the conflicting NM package, and then check again if the updates for the network_package are available, then install the new NM package, but that would necessarily need to restart NM regardless of user's consent. It is bad because restarting NM can result in connectivity loss and therefore the role does not allow it without the consent. The problem here is that the local system has the NetworkManager package version NetworkManager-1:1.46.0-1.el9.x86_64 installed, but the baseos repo has the version NetworkManager-team-1:1.45.91-1.el9.x86_64 and NetworkManager-1:1.45.91-1.el9.x86_64. I honestly do not know why this situation would happen, I can imagine a way to do about it:

  1. Add a rescue task in main.yml explaining better the error message about the package conflicts
TASK [linux-system-roles.network : Check if updates for network packages are available through the DNF package manager due to wireless or team interfaces] ***
fatal: [localhost]: FAILED! => {"changed": false, "failures": [], "msg": "Depsolve Error occured: \n Problem: cannot install both NetworkManager-1:1.45.91-1.el9.x86_64 from baseos and NetworkManager-1:1.46.0-1.el9.x86_64 from @System\n  - package NetworkManager-team-1:1.45.91-1.el9.x86_64 from baseos requires NetworkManager(x86-64) = 1:1.45.91-1.el9, but none of the providers can be installed\n  - cannot install the best update candidate for package NetworkManager-1:1.46.0-1.el9.x86_64\n  - cannot install the best candidate for the job", "rc": 1, "results": []}

liangwen12year avatar Mar 04 '24 21:03 liangwen12year

@richm , about the test failure in c9s container test, my original idea is to remove the conflicting NM package, and then check again if the updates for the network_package are available, then install the new NM package, but that would necessarily need to restart NM regardless of user's consent. It is bad because restarting NM can result in connectivity loss and therefore the role does not allow it without the consent. The problem here is that the local system has the NetworkManager package version NetworkManager-1:1.46.0-1.el9.x86_64 installed, but the baseos repo has the version NetworkManager-team-1:1.45.91-1.el9.x86_64 and NetworkManager-1:1.45.91-1.el9.x86_64. I honestly do not know why this situation would happen, I can imagine a way to do about it:

  1. Add a rescue task in main.yml explaining better the error message about the package conflicts
TASK [linux-system-roles.network : Check if updates for network packages are available through the DNF package manager due to wireless or team interfaces] ***
fatal: [localhost]: FAILED! => {"changed": false, "failures": [], "msg": "Depsolve Error occured: \n Problem: cannot install both NetworkManager-1:1.45.91-1.el9.x86_64 from baseos and NetworkManager-1:1.46.0-1.el9.x86_64 from @System\n  - package NetworkManager-team-1:1.45.91-1.el9.x86_64 from baseos requires NetworkManager(x86-64) = 1:1.45.91-1.el9, but none of the providers can be installed\n  - cannot install the best update candidate for package NetworkManager-1:1.46.0-1.el9.x86_64\n  - cannot install the best candidate for the job", "rc": 1, "results": []}

Ok, after rebuilding the c9s container image in quay, the github c9s container integration test passed.

liangwen12year avatar Mar 05 '24 17:03 liangwen12year

[citest]

liangwen12year avatar Mar 05 '24 20:03 liangwen12year

The PR description is missing the text for Enhancement/Reason/Result.

tyll avatar Mar 07 '24 09:03 tyll

[citest]

liangwen12year avatar Mar 09 '24 23:03 liangwen12year

[citest]

liangwen12year avatar Mar 11 '24 02:03 liangwen12year

The PR description is missing the text for Enhancement/Reason/Result.

I added it.

liangwen12year avatar Mar 12 '24 20:03 liangwen12year

[citest]

liangwen12year avatar Mar 12 '24 20:03 liangwen12year

[citest]

liangwen12year avatar Mar 14 '24 21:03 liangwen12year

[citest]

liangwen12year avatar Mar 15 '24 02:03 liangwen12year

@tyll , if you agree, then I will proceed to merge this PR.

liangwen12year avatar Mar 15 '24 14:03 liangwen12year

[citest]

liangwen12year avatar Mar 15 '24 14:03 liangwen12year