Bug 2068148 - [4.11] /etc/redhat-release symlink is broken
Summary: [4.11] /etc/redhat-release symlink is broken
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RHCOS
Version: 4.11
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Timothée Ravier
QA Contact: Michael Nguyen
URL:
Whiteboard:
Depends On:
Blocks: 2070888
TreeView+ depends on / blocked
 
Reported: 2022-03-24 14:37 UTC by Denis Ollier
Modified: 2022-08-10 11:02 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:01:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github coreos fedora-coreos-config pull 1777 0 None open Add test to verify the symlink pointing to a valid file 2022-06-09 07:31:17 UTC
Github k8snetworkplumbingwg sriov-network-operator pull 276 0 None open Use `/run/ostree-booted` to determine if host is RHCOS 2022-04-05 09:29:36 UTC
Github openshift os pull 815 0 None open Rebase to RHEL 8.6 2022-06-03 16:41:49 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:02:25 UTC

Internal Links: 2070888

Description Denis Ollier 2022-03-24 14:37:08 UTC
Description of problem
----------------------

Some workflows / use cases don't work anymore because /etc/redhat-release seems to be a broken symlink.

Version of all relevant components
----------------------------------

OCP Version: 4.11.0-0.nightly-2022-03-20-160505
RHCOS Version: 411.85.202203181601-0

Steps to reproduce
------------------

1. Deploy an OpenShift 4.11 cluster
2. Log-in to one node and check /etc/redhat-release.

Actual results
--------------

1. /etc/redhat-release is a symlink pointing to a non-existent file (/usr/lib/system-release)
2. /etc/redhat-release is an absolute symlink

Expected results
----------------

1. /etc/redhat-release is a symlink pointing to a valid file (/usr/lib/redhat-release is used in RHCOS-4.10)
2. /etc/redhat-release is a relative symlink (../usr/lib/redhat-release is used in RHCOS-4.10)

Additional info
---------------

This breaks one script used for SR-IOV network operator configuration (https://github.com/openshift/sriov-network-operator/blob/master/bindata/scripts/enable-kargs.sh) which expects /etc/redhat-release to exist and to be a relative symlink because it is accessed through /host mountpoint.

Comment 1 Colin Walters 2022-03-24 14:45:12 UTC
This is from https://github.com/openshift/os/pull/713


> 1. Deploy an OpenShift 4.11 cluster

BTW, as of lately you can just do e.g.:

$ podman run --rm -ti registry.ci.openshift.org/rhcos-devel/rhel-coreos:4.11 

(This is part of https://github.com/openshift/enhancements/pull/1032 , we will be moving the image to a more official place)


> 1. /etc/redhat-release is a symlink pointing to a non-existent file (/usr/lib/system-release)

Yeah, definitely a bug.

(But that said, why are you parsing redhat-release?  The new cross-distribution standard is `/usr/lib/os-release` (or previously `/etc/os-release`))

Comment 2 Denis Ollier 2022-03-24 14:58:38 UTC
(In reply to Colin Walters from comment #1)
> (But that said, why are you parsing redhat-release?  The new
> cross-distribution standard is `/usr/lib/os-release` (or previously
> `/etc/os-release`))

I am innocent :). I'm just a user of the SR-IOV operator.

This script was written by the OpenShift Network SR-IOV team. I don't know if there is a real motivation behind it or they just used /etc/redhat-release out of habit.

Comment 3 Timothée Ravier 2022-03-24 16:33:36 UTC
We will fix that but the script should be looking for /run/ostree-booted instead of greping a release file. Will file an issue.

Comment 4 Timothée Ravier 2022-03-24 16:38:49 UTC
Filed: https://github.com/openshift/sriov-network-operator/issues/647

Comment 5 HuijingHei 2022-06-07 07:43:40 UTC
Verify passed with rhcos-411.86.202206062029-0-qemu.x86_64.qcow2

[core@cosa-devsh ~]$ ll /etc/redhat-release
lrwxrwxrwx. 1 root root 23 Jun  6 20:35 /etc/redhat-release -> /usr/lib/system-release

[core@cosa-devsh ~]$ ll /usr/lib/system-release
-rw-r--r--. 2 root root 45 Jan  1  1970 /usr/lib/system-release

Comment 7 HuijingHei 2022-06-09 06:42:22 UTC
Remove the bootimage tracker bug as it does not need

Comment 8 HuijingHei 2022-06-09 06:55:46 UTC
Verify passed with latest image rhcos-411.86.202206090101-0-qemu.x86_64.qcow2

[core@cosa-devsh ~]$ ll /etc/redhat-release
lrwxrwxrwx. 1 root root 23 Jun  9 01:07 /etc/redhat-release -> /usr/lib/system-release
[core@cosa-devsh ~]$ ll /usr/lib/system-release
-rw-r--r--. 2 root root 45 Jan  1  1970 /usr/lib/system-release

Comment 10 errata-xmlrpc 2022-08-10 11:01:08 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069


Note You need to log in before you can comment on or make changes to this bug.