Skip to content

Commit f60a7cd

Browse files
hgreebehanwen-cluster
authored andcommitted
Lock kernel minor version during image build
1 parent 123590a commit f60a7cd

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

cli/src/pcluster/resources/imagebuilder/update_and_reboot.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ phases:
5757
fi
5858
5959
echo ${!OS}
60+
- name: OperatingSystemVersion
61+
action: ExecuteBash
62+
inputs:
63+
commands:
64+
- |
65+
set -v
66+
FILE=/etc/os-release
67+
if [ -e ${!FILE} ]; then
68+
. ${!FILE}
69+
echo "${!VERSION_ID}"
70+
else
71+
echo "The file '${!FILE}' does not exist. Failing build."
72+
exit {{ FailExitCode }}
73+
fi
74+
6075
6176
# Get platform name
6277
- name: PlatformName
@@ -151,6 +166,11 @@ phases:
151166
set -v
152167
OS='{{ build.OperatingSystemName.outputs.stdout }}'
153168
PLATFORM='{{ build.PlatformName.outputs.stdout }}'
169+
VERSION='{{ build.OperatingSystemVersion.outputs.stdout }}'
170+
if [[ ${!OS} == rhel9 ]]; then
171+
echo ${!VERSION} > /etc/yum/vars/releasever
172+
yum clean all
173+
fi
154174
155175
if [[ ${!PLATFORM} == RHEL ]]; then
156176
yum -y install jq

0 commit comments

Comments
 (0)