-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24515 from edsantiago/kube-template
system tests: safer install_kube_template()
- Loading branch information
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,13 +65,18 @@ install_kube_template() { | |
# If running from a podman source directory, build and use the source | ||
# version of the play-kube-@ unit file | ||
unit_name="[email protected]" | ||
unit_file="contrib/systemd/system/${unit_name}" | ||
if [[ -e ${unit_file}.in ]]; then | ||
echo "# [Building & using $unit_name from source]" >&3 | ||
# Force regenerating unit file (existing one may have /usr/bin path) | ||
rm -f $unit_file | ||
BINDIR=$(dirname $PODMAN) make $unit_file | ||
cp $unit_file $UNIT_DIR/$unit_name | ||
unit_file_in="contrib/systemd/system/${unit_name}.in" | ||
if [[ -e $unit_file_in ]]; then | ||
unit_file_out=$UNIT_DIR/$unit_name | ||
sed -e "s;@@PODMAN@@;$PODMAN;g" <$unit_file_in >$unit_file_out.tmp.$$ \ | ||
&& mv $unit_file_out.tmp.$$ $unit_file_out | ||
elif [[ "$PODMAN" = "/usr/bin/podman" ]]; then | ||
# Not running from a source directory. This is expected in gating, | ||
# and is probably OK, but it could fail on a misinstalled setup. | ||
# Maintainer will only see this warning in case of test failure. | ||
echo "WARNING: Test will rely on system-installed unit files." >&2 | ||
else | ||
skip "No $unit_file_in, and PODMAN=$PODMAN" | ||
fi | ||
} | ||
|
||
|
7a3e8da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
podman-next COPR build failed. @containers/packit-build please check.