Skip to content

Commit c60f08b

Browse files
committed
packages-openshift: define repos list there
Previously, when building the layered node image, we were relying on the default repo enablement settings. This though is at the source of a lot of complexity because then we need to make sure that we only inject just the repos that we need with the right enablement. See e.g. the complex logic in `get-ocp-repo.sh`. Let's instead match the semantics already in use by the base compose and extensions builds, both of which explicitly list the repos to enable. This means that we can be a lot less careful in what repo definitions we inject into the build environment, knowing only the necessary ones will be enabled. This is pretty easy to do now that (1) rpm-ostree suppports inlined treefiles, and (2) `treefile-apply` supports a `--var` option to define variables at invocation time.
1 parent b85fbe0 commit c60f08b

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

Containerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ fi
4747
# https://github.com/CentOS/centos-bootc/issues/393
4848
mkdir -p /var/opt
4949

50+
source /etc/os-release
5051
# this is where all the real work happens
5152
rpm-ostree experimental compose treefile-apply \
52-
/run/src/packages-openshift.yaml
53+
--var id=$ID /run/src/packages-openshift.yaml
5354

5455
# do any cleanups necessary to undo what `get-ocp-repo.sh` did
5556
if [ "${OPENSHIFT_CI}" != 0 ]; then

manifest-c9s.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
summary: CentOS Stream CoreOS 9
77

88
variables:
9+
id: "centos"
910
osversion: "c9s"
1011
inherit_tier_x: true
1112

manifest-rhel-9.6.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
summary: RHEL CoreOS 9.6
77

88
variables:
9+
id: "rhel"
910
osversion: "rhel-9.6"
1011
inherit_tier_x: true
1112

packages-openshift.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,24 @@ metadata:
44
# inject when building the layered image.
55
ocp_version: "4.19"
66

7+
conditional-include:
8+
- if: id == "rhel"
9+
include:
10+
repos:
11+
- rhel-9.6-baseos
12+
- rhel-9.6-appstream
13+
- rhel-9.6-early-kernel
14+
- rhel-9.6-fast-datapath
15+
- rhel-9.6-server-ose-4.19
16+
- if: id == "centos"
17+
include:
18+
repos:
19+
- c9s-baseos
20+
- c9s-appstream
21+
- c9s-sig-nfv
22+
- c9s-sig-cloud-okd
23+
- rhel-9.6-server-ose-4.19
24+
725
packages:
826
# The packages below are required by OpenShift/OKD
927
# but are not present in CentOS Stream and RHEL.

0 commit comments

Comments
 (0)