yast / yast-yast2

YaST module yast2
http://en.opensuse.org/Portal:YaST
GNU General Public License v2.0
54 stars 44 forks source link

Container-compatible check for the journal client #1274

Closed ancorgs closed 1 year ago

ancorgs commented 1 year ago

Problem

When trying to open certain deprecated log files, the view_anymsg client may suggest to install yast2-journal. It basically does the following:

That mechanism is quite broken when view_anymsg is containerized. The root of the problem is that view_anymsg relies on Package.Install("yast2-journal") without previously checking whether the client is already there. Since YaST's package manager checks for packages in the host system, it concludes yast2-journal is not available and the whole process fails even if the journal client is actually part of the same container.

Solution

Check for the existence of the journal client before resorting to Package.Install. If that client is included in the container (which is always the case in the official YaST containers), then everything will work. If the client is there then there is no need to check for the package.

NOTE: if the container does not contain the journal client then this pull request fixes nothing and the current (broken) behavior remains. But that's a theoretical problem because all the official YaST containers include yast2-journal.

Testing

coveralls commented 1 year ago

Coverage Status

Coverage increased (+0.004%) to 41.684% when pulling 3d6d074d58929ea7bf9b4beaf2c347d3d7d02937 on ancorgs:container_journal into b63ec1fd8893a9c01d5dee2e5e2ce7fab242da78 on yast:master.

yast-bot commented 1 year ago

:heavy_check_mark: Public Jenkins job #385 successfully finished :heavy_check_mark: Created OBS submit request #1006698

yast-bot commented 1 year ago

:heavy_check_mark: Internal Jenkins job #209 successfully finished :heavy_check_mark: Created IBS submit request #281062