Skip to content

Commit da70ce3

Browse files
Merge pull request #3817 from fontivan/sskeard/cnf-22506-update-ubi-tags-4-14
[release-4.14] CNF-22504: Best practices for ubi tags
2 parents cfcad72 + d5997ed commit da70ce3

File tree

9 files changed

+56
-80
lines changed

9 files changed

+56
-80
lines changed

cnf-tests/.konflux/Makefile

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@ PROJECT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
77
# Trim any trailing slash from the directory path as we will add if when necessary later
88
ROOT_PROJECT_DIR := $(shell dirname $(shell dirname $(abspath $(PROJECT_DIR))))
99

10-
# RHEL8_RELEASE defines the RHEL8 release version to update the rpm lock file for the runtime
11-
# This is automatically extracted from the Containerfile
12-
RHEL8_RELEASE ?= $(shell awk '/^FROM registry.access.redhat.com\/ubi8-minimal:/ {split($$2, parts, /[:|@]/); print parts[2]}' $(PROJECT_DIR)/Dockerfile)
13-
RHEL8_RELEASE_DASHED := $(subst .,-,$(RHEL8_RELEASE))
14-
1510
# RHEL9_RELEASE defines the RHEL9 release version to update the rpm lock file for the runtime
16-
RHEL9_RELEASE ?= 9.4
17-
RHEL9_RELEASE_DASHED := $(subst .,-,$(RHEL9_RELEASE))
11+
RHEL9_RELEASE ?= latest
12+
RHEL8_RELEASE ?= latest
1813

1914
# These should be set by the caller of the Makefile
2015
RHEL9_ACTIVATION_KEY ?= ""
@@ -28,6 +23,14 @@ RHEL8_ORG_ID ?= ""
2823
# This can be set from the command line if the default is not correct for your environment.
2924
REGISTRY_AUTH_FILE ?= $(shell echo $${XDG_RUNTIME_DIR:-/run/user/$$(id -u)})/containers/auth.json
3025

26+
# BSD sed (macOS) requires a backup suffix after -i (use '' for none); GNU sed (Linux) uses plain -i.
27+
UNAME_S := $(shell uname -s)
28+
ifeq ($(UNAME_S),Darwin)
29+
SED_INPLACE := sed -i ''
30+
else
31+
SED_INPLACE := sed -i
32+
endif
33+
3134
.PHONY: help
3235
help: ## Display this help.
3336
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
@@ -47,12 +50,12 @@ konflux-update-rpm-lock-runtime: sync-telco5g-konflux-submodule ## Update the rp
4750
cp $(PROJECT_DIR)/Dockerfile $(PROJECT_DIR)/lock-runtime/Dockerfile
4851
@echo "Copying rpms.in.yaml to lock-runtime directory..."
4952
cp $(PROJECT_DIR)/rpms.in.yaml $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
50-
sed -i 's|sslclientkey: $$SSL_CLIENT_KEY|sslclientkey: /etc/pki/entitlement/placeholder-key.pem|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
51-
sed -i 's|sslclientcert: $$SSL_CLIENT_CERT|sslclientcert: /etc/pki/entitlement/placeholder.pem|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
53+
$(SED_INPLACE) 's|sslclientkey: $$SSL_CLIENT_KEY|sslclientkey: /etc/pki/entitlement/placeholder-key.pem|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
54+
$(SED_INPLACE) 's|sslclientcert: $$SSL_CLIENT_CERT|sslclientcert: /etc/pki/entitlement/placeholder.pem|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
5255
@cat $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
5356
$(MAKE) -C $(ROOT_PROJECT_DIR)/telco5g-konflux/scripts/rpm-lock generate-rhel8-locks \
5457
LOCK_SCRIPT_TARGET_DIR=$(PROJECT_DIR)/lock-runtime \
55-
RHEL8_IMAGE_TO_LOCK=$$(awk '/^FROM registry.access.redhat.com\/ubi8-minimal:/ {print $$2}' $(PROJECT_DIR)/Dockerfile) \
58+
RHEL8_IMAGE_TO_LOCK=registry.access.redhat.com/ubi8/ubi-minimal:$(RHEL8_RELEASE) \
5659
REGISTRY_AUTH_FILE=$(REGISTRY_AUTH_FILE) \
5760
\
5861
RHEL9_RELEASE=$(RHEL9_RELEASE) \

cnf-tests/.konflux/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ As part of the update, make sure that packages are updated in both `rpms.in.yaml
4949
It is enough that the Dockerfile that is used to generate the lockfile contain the final base image and the command that installs the packages. For example:
5050

5151
```azure
52-
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10
52+
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
5353
RUN microdnf install -y lksctp-tools iproute \
5454
ethtool iputils procps-ng numactl-libs iptables \
5555
kmod rt-tests linuxptp iperf3 nc \
@@ -61,7 +61,7 @@ When an image version is out-of-maintenance (OOM) some versions has what's calle
6161
As any other RPM repo, also EUS repos need to be enabled in the activation key. Once enabled, the lockfile will be generated with additional EUS packages. The version of the base images should anyhow align with those used for OCP for the same branch.
6262

6363
**Important**:
64-
* When starting the container in which you will be generating the lockfile in, use a production image in order to get the GA RPM repos and not beta one. So use `registry.access.redhat.com/ubi8/ubi-minimal:8.10` and not `registry-proxy.engineering.redhat.com/rh-osbs/ubi9/ubi-minimal:8.10`.
64+
* When starting the container in which you will be generating the lockfile in, use a production image in order to get the GA RPM repos and not beta one. So use `registry.access.redhat.com/ubi8/ubi-minimal:latest` and not `registry-proxy.engineering.redhat.com/rh-osbs/ubi8/ubi-minimal:latest`.
6565
* Please make sure that the repos that you used to pull the RPMs from are found under the activation key that is associated to the konflux public instance by:
6666
<steps on how to confirm this will be detailed later once we have a team activation key>
6767

cnf-tests/.konflux/rpms.lock.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,20 @@ arches:
473473
name: shadow-utils
474474
evr: 2:4.6-23.el8_10
475475
sourcerpm: shadow-utils-4.6-23.el8_10.src.rpm
476-
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/baseos/os/Packages/s/systemd-239-82.el8_10.13.x86_64.rpm
476+
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/baseos/os/Packages/s/systemd-239-82.el8_10.15.x86_64.rpm
477477
repoid: rhel-8-for-x86_64-baseos-rpms
478-
size: 3830800
479-
checksum: sha256:30e7904ba7d991dd821d4be6cfee6dc6db5a65a8bd6e482502e6d2d6e71c58e9
478+
size: 3831596
479+
checksum: sha256:5b0e2ae8da719c108527b9f2fffeb811b846abb392452e0fb38cbe16fe7147bd
480480
name: systemd
481-
evr: 239-82.el8_10.13
482-
sourcerpm: systemd-239-82.el8_10.13.src.rpm
483-
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/baseos/os/Packages/s/systemd-pam-239-82.el8_10.13.x86_64.rpm
481+
evr: 239-82.el8_10.15
482+
sourcerpm: systemd-239-82.el8_10.15.src.rpm
483+
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/baseos/os/Packages/s/systemd-pam-239-82.el8_10.15.x86_64.rpm
484484
repoid: rhel-8-for-x86_64-baseos-rpms
485-
size: 529240
486-
checksum: sha256:b1d738e31d1db8c3759f5e9913fcc7ec7b1fbfd90a2f271d18f8a30ca050e57a
485+
size: 529836
486+
checksum: sha256:e026c5047e6025bb1f87bf0aa79f69f702d69d85ae55f173e5d73dc75f1806cb
487487
name: systemd-pam
488-
evr: 239-82.el8_10.13
489-
sourcerpm: systemd-239-82.el8_10.13.src.rpm
488+
evr: 239-82.el8_10.15
489+
sourcerpm: systemd-239-82.el8_10.15.src.rpm
490490
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/baseos/os/Packages/t/tmux-2.7-3.el8.x86_64.rpm
491491
repoid: rhel-8-for-x86_64-baseos-rpms
492492
size: 324120
@@ -503,7 +503,7 @@ arches:
503503
sourcerpm: util-linux-2.32.1-48.el8_10.src.rpm
504504
source: []
505505
module_metadata:
506-
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/appstream/os/repodata/9e59c9b1a159473ded4cee68c45efa0820f2d2f91e1fb76ab91de26fa1619c97-modules.yaml.gz
506+
- url: https://cdn.redhat.com/content/dist/rhel8/8.10/x86_64/appstream/os/repodata/1d7ebc2a2032efc3056e7eb20fda7d4d3577a93cd9c6d061a53cf275eaa197ba-modules.yaml.gz
507507
repoid: rhel-8-for-x86_64-appstream-rpms
508-
size: 789662
509-
checksum: sha256:9e59c9b1a159473ded4cee68c45efa0820f2d2f91e1fb76ab91de26fa1619c97
508+
size: 794817
509+
checksum: sha256:1d7ebc2a2032efc3056e7eb20fda7d4d3577a93cd9c6d061a53cf275eaa197ba

tools/buildingsctp/src/Dockerfile.sctp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi8/ubi AS builder
1+
FROM registry.access.redhat.com/ubi8/ubi:latest AS builder
22
USER root
33
# Copy entitlements
44
COPY ./etc-pki-entitlement /etc/pki/entitlement
@@ -17,7 +17,7 @@ USER 1001
1717
COPY samplebuild/src/* /src/
1818
RUN gcc /src/sctp.c -o /src/sctpclient -lsctp
1919

20-
FROM registry.access.redhat.com/ubi8/ubi
20+
FROM registry.access.redhat.com/ubi8/ubi:latest
2121
COPY --from=builder /src/sctpclient /usr/local/bin/sctpclient
2222
CMD ["/usr/bin/sctptest"]
2323

ztp/resource-generator/.konflux/Makefile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,9 @@ PROJECT_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
2525
# Trim any trailing slash from the directory path as we will add if when necessary later
2626
ROOT_PROJECT_DIR := $(shell dirname $(shell dirname $(shell dirname $(abspath $(PROJECT_DIR)))))
2727

28-
# RHEL8_RELEASE defines the RHEL8 release version to update the rpm lock file for the runtime
29-
# This is automatically extracted from the Containerfile
30-
RHEL8_RELEASE ?= $(shell awk '/^FROM registry.access.redhat.com\/ubi8-minimal:/ {split($$2, parts, /[:|@]/); print parts[2]}' $(PROJECT_DIR)/../Containerfile)
31-
32-
# Use make's built-in substitution function to replace the dot with a dash
33-
RHEL8_RELEASE_DASHED := $(subst .,-,$(RHEL8_RELEASE))
34-
3528
# RHEL9_RELEASE defines the RHEL9 release version to update the rpm lock file for the runtime
36-
RHEL9_RELEASE ?= 9.4
37-
RHEL9_RELEASE_DASHED := $(subst .,-,$(RHEL9_RELEASE))
29+
RHEL9_RELEASE ?= latest
30+
RHEL8_RELEASE ?= latest
3831

3932
# We don't need activation keys because we only use ubi packages
4033
RHEL9_ACTIVATION_KEY ?= ""
@@ -48,6 +41,14 @@ RHEL8_ORG_ID ?= ""
4841
# This can be set from the command line if the default is not correct for your environment.
4942
REGISTRY_AUTH_FILE ?= $(shell echo $${XDG_RUNTIME_DIR:-/run/user/$$(id -u)})/containers/auth.json
5043

44+
# BSD sed (macOS) requires a backup suffix after -i (use '' for none); GNU sed (Linux) uses plain -i.
45+
UNAME_S := $(shell uname -s)
46+
ifeq ($(UNAME_S),Darwin)
47+
SED_INPLACE := sed -i ''
48+
else
49+
SED_INPLACE := sed -i
50+
endif
51+
5152
help: ## Display this help.
5253
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
5354

@@ -79,11 +80,11 @@ konflux-update-rpm-lock-runtime: sync-telco5g-konflux-submodule ## Update the rp
7980
cp $(PROJECT_DIR)/../Containerfile $(PROJECT_DIR)/lock-runtime/Containerfile
8081
@echo "Copying rpms.in.yaml to lock-runtime directory..."
8182
cp $(PROJECT_DIR)/rpms.in.yaml $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
82-
sed -i 's|../Containerfile|Containerfile|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
83+
$(SED_INPLACE) 's|../Containerfile|Containerfile|g' $(PROJECT_DIR)/lock-runtime/rpms.in.yaml
8384
@echo "Updating rpm lock file for the runtime..."
8485
$(MAKE) -C $(ROOT_PROJECT_DIR)/telco5g-konflux/scripts/rpm-lock generate-rhel8-locks \
8586
LOCK_SCRIPT_TARGET_DIR=$(PROJECT_DIR)/lock-runtime \
86-
RHEL8_IMAGE_TO_LOCK=$$(awk '/^FROM registry.access.redhat.com\/ubi8-minimal:/ {print $$2}' $(PROJECT_DIR)/../Containerfile) \
87+
RHEL8_IMAGE_TO_LOCK=registry.access.redhat.com/ubi8-minimal:$(RHEL8_RELEASE) \
8788
REGISTRY_AUTH_FILE=$(REGISTRY_AUTH_FILE) \
8889
\
8990
RHEL9_RELEASE=$(RHEL9_RELEASE) \

ztp/resource-generator/.konflux/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ To manually regenerate the rpm lock configuration, use the following Makefile ta
6161
- Update the `.konflux/rpms.lock.yaml` file
6262

6363
**Configuration Options:**
64-
- `RHEL8_RELEASE`: RHEL8 release version (automatically extracted from Containerfile)
65-
- `RHEL9_RELEASE`: RHEL9 release version (default: 9.4)
64+
- `RHEL8_RELEASE`: RHEL8 release version (default: latest)
65+
- `RHEL9_RELEASE`: RHEL9 release version (default: latest)
6666
- `RHEL8_ACTIVATION_KEY`: Red Hat activation key for RHEL8 (not needed for UBI packages)
6767
- `RHEL8_ORG_ID`: Red Hat organization ID for RHEL8 (not needed for UBI packages)
6868
- `RHEL9_ACTIVATION_KEY`: Red Hat activation key for RHEL9 (not needed for UBI packages)

ztp/resource-generator/.konflux/rpms.lock.yaml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,13 @@ arches:
2525
name: gzip
2626
evr: 1.9-13.el8_5
2727
sourcerpm: gzip-1.9-13.el8_5.src.rpm
28-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libblkid-2.32.1-47.el8_10.x86_64.rpm
28+
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libfdisk-2.32.1-48.el8_10.x86_64.rpm
2929
repoid: ubi-8-for-x86_64-baseos-rpms
30-
size: 225348
31-
checksum: sha256:d20de50e05c6c7a6a3232c57ba69a2e62d0aebe4ebe5540f6b4776eb762465a8
32-
name: libblkid
33-
evr: 2.32.1-47.el8_10
34-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
35-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libfdisk-2.32.1-47.el8_10.x86_64.rpm
36-
repoid: ubi-8-for-x86_64-baseos-rpms
37-
size: 259176
38-
checksum: sha256:93d94607b800a70cffe242fdaf13ebcf9a62eb77aa98564bab7087f86a8e0832
30+
size: 259376
31+
checksum: sha256:59733655dc4a424ab2314895e5c2f7e274180bb092b65167cbf23e5634662a0a
3932
name: libfdisk
40-
evr: 2.32.1-47.el8_10
41-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
42-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libmount-2.32.1-47.el8_10.x86_64.rpm
43-
repoid: ubi-8-for-x86_64-baseos-rpms
44-
size: 241732
45-
checksum: sha256:c92289f2e195e15fece08617be1d675abfd513109a0bd14c5cf45fcd68fb84a9
46-
name: libmount
47-
evr: 2.32.1-47.el8_10
48-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
33+
evr: 2.32.1-48.el8_10
34+
sourcerpm: util-linux-2.32.1-48.el8_10.src.rpm
4935
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libnsl2-1.2.0-2.20180605git4a062cf.el8.x86_64.rpm
5036
repoid: ubi-8-for-x86_64-baseos-rpms
5137
size: 59120
@@ -67,13 +53,6 @@ arches:
6753
name: libsemanage
6854
evr: 2.9-12.el8_10
6955
sourcerpm: libsemanage-2.9-12.el8_10.src.rpm
70-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libsmartcols-2.32.1-47.el8_10.x86_64.rpm
71-
repoid: ubi-8-for-x86_64-baseos-rpms
72-
size: 183072
73-
checksum: sha256:7203046a7bbf0c72965933901614a682a220800c43f69748f8a4cb209193061c
74-
name: libsmartcols
75-
evr: 2.32.1-47.el8_10
76-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
7756
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libtirpc-1.1.4-12.el8_10.x86_64.rpm
7857
repoid: ubi-8-for-x86_64-baseos-rpms
7958
size: 116808
@@ -88,13 +67,6 @@ arches:
8867
name: libutempter
8968
evr: 1.1.6-14.el8
9069
sourcerpm: libutempter-1.1.6-14.el8.src.rpm
91-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/l/libuuid-2.32.1-47.el8_10.x86_64.rpm
92-
repoid: ubi-8-for-x86_64-baseos-rpms
93-
size: 100768
94-
checksum: sha256:9ba65072e9949c2c6dfa85b8daa36292264f4c3e6a35a515b6ef572d3405aaba
95-
name: libuuid
96-
evr: 2.32.1-47.el8_10
97-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
9870
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/p/pam-1.3.1-39.el8_10.x86_64.rpm
9971
repoid: ubi-8-for-x86_64-baseos-rpms
10072
size: 766824
@@ -116,12 +88,12 @@ arches:
11688
name: tar
11789
evr: 2:1.30-11.el8_10
11890
sourcerpm: tar-1.30-11.el8_10.src.rpm
119-
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/u/util-linux-2.32.1-47.el8_10.x86_64.rpm
91+
- url: https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/Packages/u/util-linux-2.32.1-48.el8_10.x86_64.rpm
12092
repoid: ubi-8-for-x86_64-baseos-rpms
121-
size: 2596592
122-
checksum: sha256:4861ff37cf00bd0bab78a81004dfed1e7b0ee5355403510b9e78e2a90fc7226c
93+
size: 2597936
94+
checksum: sha256:16f51c38ab76c0a1bfb1c9da94d48946a48d94367096ef855343db11574f5aca
12395
name: util-linux
124-
evr: 2.32.1-47.el8_10
125-
sourcerpm: util-linux-2.32.1-47.el8_10.src.rpm
96+
evr: 2.32.1-48.el8_10
97+
sourcerpm: util-linux-2.32.1-48.el8_10.src.rpm
12698
source: []
12799
module_metadata: []

ztp/resource-generator/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ WORKDIR $SC_ROOT
1818
RUN make build
1919

2020
# Container image
21-
FROM registry.access.redhat.com/ubi8-minimal:8.10@sha256:43dde01be4e94afd22d8d95ee8abcc9f610b4e50aff5bcc141b558c74d4c68b5
21+
FROM registry.access.redhat.com/ubi8-minimal:latest
2222
#
2323

2424
USER root

0 commit comments

Comments
 (0)