File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
scripts/lockfile-generators/helpers Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,13 @@ CERT_DIR="${CERT_DIR:-${SUBSCRIPTION_CERT_DIR:-}}"
7878ACTIVATION_KEY=" ${ACTIVATION_KEY:- ${SUBSCRIPTION_ACTIVATION_KEY:- } } "
7979ORG=" ${ORG:- ${SUBSCRIPTION_ORG:- } } "
8080
81+ # Auto-detect entitlement certs left by the GHA "Add subscriptions" step,
82+ # which writes PEM files to entitlement/ and configures mounts.conf.
83+ if [[ -z " $CERT_DIR " ]] && ls entitlement/* .pem & > /dev/null; then
84+ echo " --- Auto-detected entitlement/ directory from GHA subscription step ---"
85+ CERT_DIR=" entitlement"
86+ fi
87+
8188# Build the hermeto JSON input — add SSL config when using RHEL subscription
8289# so hermeto can authenticate to cdn.redhat.com for entitled content.
8390HERMETO_JSON=' {"type": "rpm"}'
@@ -118,7 +125,7 @@ elif [[ -n "$ACTIVATION_KEY" ]] && [[ -n "$ORG" ]]; then
118125 -e SM_ORG=" $ORG " \
119126 -e SM_KEY=" $ACTIVATION_KEY " \
120127 " $UBI9_IMAGE " \
121- sh -c ' subscription-manager register --org="$SM_ORG" --activationkey="$SM_KEY" >/dev/null && tar -cf - /etc/pki/entitlement/ /etc/rhsm/ca/' \
128+ sh -c ' subscription-manager register --force -- org="$SM_ORG" --activationkey="$SM_KEY" >/dev/null && tar -cf - /etc/pki/entitlement/ /etc/rhsm/ca/' \
122129 > " $CERT_TAR " 2> " $REG_LOG " || true
123130 " $_xtrace_was_set " && set -x
124131 if [[ -s " $CERT_TAR " ]]; then
You can’t perform that action at this time.
0 commit comments