Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

test: fix aws replace cloud-init user change issue #12

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions os-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ UPGRADE_CONTAINERFILE=${TEMPDIR}/Containerfile.upgrade
QUAY_REPO_TAG="${QUAY_REPO_TAG:-$(tr -dc a-z0-9 < /dev/urandom | head -c 4 ; echo '')}"
INVENTORY_FILE="${TEMPDIR}/inventory"

REPLACE_CLOUD_USER=""
case "$TEST_OS" in
"rhel-9-4")
IMAGE_NAME="rhel9-rhel_bootc"
Expand All @@ -41,15 +42,21 @@ case "$TEST_OS" in
ADD_REPO="COPY rhel-9-4.repo /etc/yum.repos.d/rhel-9-4.repo"
sed "s/REPLACE_ME/${QUAY_SECRET}/g" files/auth.template | tee auth.json > /dev/null
ADD_AUTH="COPY auth.json /etc/ostree/auth.json"
if [[ "$PLATFORM" == "aws" ]]; then SSH_USER="ec2-user"; fi
if [[ "$PLATFORM" == "aws" ]]; then
SSH_USER="ec2-user"
REPLACE_CLOUD_USER='RUN sed -i "s/name: cloud-user/name: ec2-user/g" /etc/cloud/cloud.cfg'
fi
;;
"centos-stream-9")
IMAGE_NAME="centos-bootc"
TIER1_IMAGE_URL="quay.io/centos-bootc/${IMAGE_NAME}:stream9"
SSH_USER="cloud-user"
ADD_REPO=""
ADD_AUTH=""
if [[ "$PLATFORM" == "aws" ]]; then SSH_USER="ec2-user"; fi
if [[ "$PLATFORM" == "aws" ]]; then
SSH_USER="ec2-user"
REPLACE_CLOUD_USER='RUN sed -i "s/name: cloud-user/name: ec2-user/g" /etc/cloud/cloud.cfg'
fi
;;
"fedora-eln")
IMAGE_NAME="fedora-bootc"
Expand All @@ -74,6 +81,7 @@ $ADD_REPO
RUN dnf -y install python3 cloud-init && \
dnf -y clean all
$ADD_AUTH
$REPLACE_CLOUD_USER
EOF

greenprint "Check $TEST_OS installation Containerfile"
Expand Down
Loading