Skip to content

Commit fda5078

Browse files
committed
Disable subscription-manager container mode detection during registration
Remove the /etc/rhsm-host symlink before calling subscription-manager register so that it does not detect container mode and exit with status 78. subscription-manager checks for /etc/rhsm-host (a symlink to ../run/secrets/rhsm) to determine if it is running inside a container.
1 parent c43fbc3 commit fda5078

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

bootc/rhsm.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ RHSM_REPOS=${RHSM_REPOS:-"--enable=rhoso-18.0-for-rhel-${RHEL_MAJOR}-x86_64-rpms
1313
RHSM_POOL=""
1414

1515
rm -f /etc/yum.repos.d/*.repo
16+
# Disable subscription-manager container detection so that registration
17+
# works during container builds. subscription-manager checks for
18+
# /etc/rhsm-host (a symlink to ../run/secrets/rhsm) to detect
19+
# container mode.
20+
if [ -L /etc/rhsm-host ]; then
21+
rm -f /etc/rhsm-host
22+
fi
23+
1624
# Suppress xtrace to avoid leaking credentials to the build log
1725
set +x
1826
subscription-manager register --username="$RHSM_USER" --password="$RHSM_PASSWORD"

0 commit comments

Comments
 (0)