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

whereabouts-reconciler image entrypoint does not deal with base container image of CentOS #2070

Open
GingerGeek opened this issue Dec 17, 2024 Discussed in #2060 · 1 comment

Comments

@GingerGeek
Copy link
Member

Discussed in #2060

Originally posted by manfuin November 21, 2024
Upgrade to scos-release:4.16.0-okd-scos.0 from 4.15.0-0.okd-scos-2024-01-18-223523 for me stuck on network-operator rolling out the DaemonSet "/openshift-multus/whereabouts-reconciler" (after applying fix from #1971).

The whereabouts-reconciler Pod is crashlooping with:

 [entrypoint.sh] FATAL ERROR: Unsupported OS ID=centos

Indeed, is image is based on:

cat /etc/os-release:
NAME="CentOS Stream"
VERSION="9"
ID="centos"
...

But entrypoint.sh does not handle the centos name:

# Collect host OS information
. /etc/os-release
rhelmajor=
# detect which version we're using in order to copy the proper binaries
case "${ID}" in
        rhcos|scos)
                rhelmajor=$(echo ${RHEL_VERSION} | cut -f 1 -d .)
                ;;
        rhel)
                rhelmajor=$(echo "${VERSION_ID}" | cut -f 1 -d .)
                ;;
        fedora)
                if [ "${VARIANT_ID}" == "coreos" ]; then
                        rhelmajor=8
                else
                        log "FATAL ERROR: Unsupported Fedora variant=${VARIANT_ID}"
                        exit 1
                fi
                ;;
        *) log "FATAL ERROR: Unsupported OS ID=${ID}"; exit 1
                ;;
esac

It is the same OS in scos-release:4.16.0-okd-scos.1.

But for 4.15 it was:

$ podman run -it quay.io/okd/scos-content@sha256:ee302ce6a9ac0be1e9225af2973c7be0b9db785069a376dc4ab5e12d889045d8 /bin/sh -c 'cat /etc/os-release'
NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"

Any mitigation you can think of?

I tried to manually patching daemonset with dirrefent command that skips this check, but network operator is changing it back to broken one.

@GingerGeek
Copy link
Member Author

There is an open PR at openshift/whereabouts-cni#322 to account for CentOS.

Meanwhile there is a known workaround by @manfuin in the original discussion

Still an issue for 4.17.0-okd-scos.0.

The way I go forward is introducing an admission controller for openshift-multus namespace that mutates the image of whereabouts-reconciler Pods during Pod creation. This way DaemonSet remains intact and CNO can be managed again.

The working image substituted by mutation is build from upstraeam image matching the OKD release with patched entrypoint.sh:

@@ -17,7 +17,7 @@
        rhcos|scos)
                rhelmajor=$(echo ${RHEL_VERSION} | cut -f 1 -d .)
                ;;
-       rhel|centos)
+       rhel)
                rhelmajor=$(echo "${VERSION_ID}" | cut -f 1 -d .)
                ;;
        fedora)

Note: The generated diff provided is the wrong way round

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant