Skip to content

Commit 2b13dab

Browse files
committed
RHAIENG-1965: chore(cli): introduce subscription refresh before trying to update (opendatahub-io#2685)
1 parent 0f2e3fe commit 2b13dab

File tree

23 files changed

+172
-9
lines changed

23 files changed

+172
-9
lines changed

codeserver/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ USER 0
8484
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
8585

8686
### BEGIN upgrade first to avoid fixable vulnerabilities
87+
# If we have a Red Hat subscription prepared, refresh it
88+
RUN /bin/bash <<'EOF'
89+
set -Eeuxo pipefail
90+
if command -v subscription-manager &> /dev/null; then
91+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
92+
fi
93+
EOF
94+
8795
# Problem: The operation would result in removing the following protected packages: systemd
8896
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
8997
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/datascience/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ EOF
4040
# cpu-base #
4141
####################
4242
FROM ${BASE_IMAGE} AS cpu-base
43-
USER 0
44-
RUN /bin/bash <<'EOF'
45-
set -Eeuxo pipefail
46-
if command -v subscription-manager &> /dev/null; then
47-
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
48-
fi
49-
EOF
5043

5144
WORKDIR /opt/app-root/bin
5245

@@ -60,6 +53,14 @@ ARG TARGETARCH
6053
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
6154

6255
### BEGIN upgrade first to avoid fixable vulnerabilities
56+
# If we have a Red Hat subscription prepared, refresh it
57+
RUN /bin/bash <<'EOF'
58+
set -Eeuxo pipefail
59+
if command -v subscription-manager &> /dev/null; then
60+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
61+
fi
62+
EOF
63+
6364
# Problem: The operation would result in removing the following protected packages: systemd
6465
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
6566
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/minimal/ubi9-python-3.12/Dockerfile.cpu

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ USER 0
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

4242
### BEGIN upgrade first to avoid fixable vulnerabilities
43+
# If we have a Red Hat subscription prepared, refresh it
44+
RUN /bin/bash <<'EOF'
45+
set -Eeuxo pipefail
46+
if command -v subscription-manager &> /dev/null; then
47+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
48+
fi
49+
EOF
50+
4351
# Problem: The operation would result in removing the following protected packages: systemd
4452
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4553
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/minimal/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ USER 0
2424
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2525

2626
### BEGIN upgrade first to avoid fixable vulnerabilities
27+
# If we have a Red Hat subscription prepared, refresh it
28+
RUN /bin/bash <<'EOF'
29+
set -Eeuxo pipefail
30+
if command -v subscription-manager &> /dev/null; then
31+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
32+
fi
33+
EOF
34+
2735
# Problem: The operation would result in removing the following protected packages: systemd
2836
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
2937
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/minimal/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ USER 0
2222
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
2323

2424
### BEGIN upgrade first to avoid fixable vulnerabilities
25+
# If we have a Red Hat subscription prepared, refresh it
26+
RUN /bin/bash <<'EOF'
27+
set -Eeuxo pipefail
28+
if command -v subscription-manager &> /dev/null; then
29+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
30+
fi
31+
EOF
32+
2533
# Problem: The operation would result in removing the following protected packages: systemd
2634
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
2735
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/pytorch+llmcompressor/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ USER 0
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

4242
### BEGIN upgrade first to avoid fixable vulnerabilities
43+
# If we have a Red Hat subscription prepared, refresh it
44+
RUN /bin/bash <<'EOF'
45+
set -Eeuxo pipefail
46+
if command -v subscription-manager &> /dev/null; then
47+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
48+
fi
49+
EOF
50+
4351
# Problem: The operation would result in removing the following protected packages: systemd
4452
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4553
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/pytorch/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ USER 0
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

4242
### BEGIN upgrade first to avoid fixable vulnerabilities
43+
# If we have a Red Hat subscription prepared, refresh it
44+
RUN /bin/bash <<'EOF'
45+
set -Eeuxo pipefail
46+
if command -v subscription-manager &> /dev/null; then
47+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
48+
fi
49+
EOF
50+
4351
# Problem: The operation would result in removing the following protected packages: systemd
4452
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4553
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/rocm/pytorch/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ USER 0
3838
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3939

4040
### BEGIN upgrade first to avoid fixable vulnerabilities
41+
# If we have a Red Hat subscription prepared, refresh it
42+
RUN /bin/bash <<'EOF'
43+
set -Eeuxo pipefail
44+
if command -v subscription-manager &> /dev/null; then
45+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
46+
fi
47+
EOF
48+
4149
# Problem: The operation would result in removing the following protected packages: systemd
4250
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4351
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/rocm/tensorflow/ubi9-python-3.12/Dockerfile.rocm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ USER 0
3838
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
3939

4040
### BEGIN upgrade first to avoid fixable vulnerabilities
41+
# If we have a Red Hat subscription prepared, refresh it
42+
RUN /bin/bash <<'EOF'
43+
set -Eeuxo pipefail
44+
if command -v subscription-manager &> /dev/null; then
45+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
46+
fi
47+
EOF
48+
4149
# Problem: The operation would result in removing the following protected packages: systemd
4250
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4351
# Solution: --best --skip-broken does not work either, so use --nobest

jupyter/tensorflow/ubi9-python-3.12/Dockerfile.cuda

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ USER 0
4040
COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4141

4242
### BEGIN upgrade first to avoid fixable vulnerabilities
43+
# If we have a Red Hat subscription prepared, refresh it
44+
RUN /bin/bash <<'EOF'
45+
set -Eeuxo pipefail
46+
if command -v subscription-manager &> /dev/null; then
47+
subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
48+
fi
49+
EOF
50+
4351
# Problem: The operation would result in removing the following protected packages: systemd
4452
# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4553
# Solution: --best --skip-broken does not work either, so use --nobest

0 commit comments

Comments
 (0)