mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-21 20:08:54 +00:00
scripts: Change here document delimiters
Fix the outstanding scripts using non standard shell here document delimiters. This should have been caught by https://github.com/kata-containers/tests/pull/3937, but there is a bug in the checker which is fixed on https://github.com/kata-containers/tests/pull/4569. Fixes: #3864. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
This commit is contained in:
@@ -59,7 +59,7 @@ build_image() {
|
||||
|
||||
usage() {
|
||||
return_code=${1:-0}
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Create image and initrd in a tarball for kata containers.
|
||||
Use it to build an image to distribute kata.
|
||||
|
||||
@@ -70,7 +70,7 @@ Options:
|
||||
--imagetype=${image_type}
|
||||
--prefix=${prefix}
|
||||
--destdir=${destdir}
|
||||
EOT
|
||||
EOF
|
||||
|
||||
exit "${return_code}"
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ error() {
|
||||
|
||||
usage() {
|
||||
return_code=${1:-0}
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
This script is used as part of the ${project} release process.
|
||||
It is used to create a tarball with static binaries.
|
||||
|
||||
@@ -74,7 +74,7 @@ options:
|
||||
rootfs-image
|
||||
rootfs-initrd
|
||||
shim-v2
|
||||
EOT
|
||||
EOF
|
||||
|
||||
exit "${return_code}"
|
||||
}
|
||||
|
@@ -94,10 +94,10 @@ function configure_different_shims_base() {
|
||||
fi
|
||||
fi
|
||||
|
||||
cat << EOT | tee "$shim_file"
|
||||
cat << EOF | tee "$shim_file"
|
||||
#!/usr/bin/env bash
|
||||
KATA_CONF_FILE=/opt/kata/share/defaults/kata-containers/configuration-${shim}.toml /opt/kata/bin/containerd-shim-kata-v2 "\$@"
|
||||
EOT
|
||||
EOF
|
||||
chmod +x "$shim_file"
|
||||
|
||||
if [ "${shim}" == "${default_shim}" ]; then
|
||||
@@ -132,7 +132,7 @@ function configure_crio_runtime() {
|
||||
local kata_path="/usr/local/bin/containerd-shim-${runtime}-v2"
|
||||
local kata_conf="crio.runtime.runtimes.${runtime}"
|
||||
|
||||
cat <<EOT | tee -a "$crio_drop_in_conf_file"
|
||||
cat <<EOF | tee -a "$crio_drop_in_conf_file"
|
||||
|
||||
# Path to the Kata Containers runtime binary that uses the $1
|
||||
[$kata_conf]
|
||||
@@ -140,7 +140,7 @@ function configure_crio_runtime() {
|
||||
runtime_type = "vm"
|
||||
runtime_root = "/run/vc"
|
||||
privileged_without_host_devices = true
|
||||
EOT
|
||||
EOF
|
||||
}
|
||||
|
||||
function configure_crio() {
|
||||
@@ -178,22 +178,22 @@ function configure_containerd_runtime() {
|
||||
echo "Configuration exists for $runtime_table, overwriting"
|
||||
sed -i "/\[$runtime_table\]/,+1s#runtime_type.*#runtime_type = \"${runtime_type}\"#" $containerd_conf_file
|
||||
else
|
||||
cat <<EOT | tee -a "$containerd_conf_file"
|
||||
cat <<EOF | tee -a "$containerd_conf_file"
|
||||
[$runtime_table]
|
||||
runtime_type = "${runtime_type}"
|
||||
privileged_without_host_devices = true
|
||||
pod_annotations = ["io.katacontainers.*"]
|
||||
EOT
|
||||
EOF
|
||||
fi
|
||||
|
||||
if grep -q "\[$options_table\]" $containerd_conf_file; then
|
||||
echo "Configuration exists for $options_table, overwriting"
|
||||
sed -i "/\[$options_table\]/,+1s#ConfigPath.*#ConfigPath = \"${config_path}\"#" $containerd_conf_file
|
||||
else
|
||||
cat <<EOT | tee -a "$containerd_conf_file"
|
||||
cat <<EOF | tee -a "$containerd_conf_file"
|
||||
[$options_table]
|
||||
ConfigPath = "${config_path}"
|
||||
EOT
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ source "${packaging_scripts_dir}/lib.sh"
|
||||
|
||||
usage() {
|
||||
exit_code="$1"
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Overview:
|
||||
|
||||
Build a kernel for Kata Containers
|
||||
@@ -99,7 +99,7 @@ Options:
|
||||
-t <hypervisor> : Hypervisor_target.
|
||||
-v <version> : Kernel version to use if kernel path not provided.
|
||||
-x <type> : Confidential guest protection type, such as sev and tdx
|
||||
EOT
|
||||
EOF
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ die() {
|
||||
|
||||
usage() {
|
||||
return_code=${1:-0}
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage:
|
||||
|
||||
${script_name} [options] <version>
|
||||
@@ -41,7 +41,7 @@ options:
|
||||
|
||||
-h : show this help
|
||||
-p : push image to github
|
||||
EOT
|
||||
EOF
|
||||
|
||||
exit "${return_code}"
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ trap exit_handler EXIT
|
||||
|
||||
usage() {
|
||||
return_code=${1:-}
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage ${script_name} <previous-release> <new_release>
|
||||
|
||||
Args:
|
||||
@@ -37,7 +37,7 @@ new-release: new release version that will have the
|
||||
Example:
|
||||
./${script_name} 1.2.0 1.2.1 > notes.md
|
||||
|
||||
EOT
|
||||
EOF
|
||||
exit "${return_code}"
|
||||
}
|
||||
|
||||
@@ -81,25 +81,25 @@ changes() {
|
||||
}
|
||||
|
||||
print_release_notes() {
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
# Release ${runtime_version}
|
||||
|
||||
EOT
|
||||
EOF
|
||||
|
||||
for repo in "${repos[@]}"; do
|
||||
git clone -q "https://github.com/${project}/${repo}.git" "${tmp_dir}/${repo}"
|
||||
pushd "${tmp_dir}/${repo}" >>/dev/null
|
||||
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
## ${repo} Changes
|
||||
$(changes)
|
||||
|
||||
EOT
|
||||
EOF
|
||||
popd >>/dev/null
|
||||
rm -rf "${tmp_dir}/${repo}"
|
||||
done
|
||||
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
|
||||
## Compatibility with CRI-O
|
||||
Kata Containers ${runtime_version} is compatible with CRI-O ${crio_version}
|
||||
@@ -157,7 +157,7 @@ More information [Limitations][limitations]
|
||||
[custom-agent-doc]: https://github.com/kata-containers/kata-containers/blob/main/docs/Developer-Guide.md#build-a-custom-kata-agent---optional
|
||||
[limitations]: https://github.com/kata-containers/kata-containers/blob/${new_release}/docs/Limitations.md
|
||||
[installation]: https://github.com/kata-containers/kata-containers/blob/${new_release}/docs/install
|
||||
EOT
|
||||
EOF
|
||||
}
|
||||
|
||||
main() {
|
||||
|
@@ -27,16 +27,16 @@ source "${script_dir}/../scripts/lib.sh"
|
||||
|
||||
function usage() {
|
||||
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage: ${script_name} [options] <args>
|
||||
This script creates a new release for ${PROJECT}.
|
||||
It tags and create release for:
|
||||
EOT
|
||||
EOF
|
||||
for r in "${repos[@]}"; do
|
||||
echo " - ${r}"
|
||||
done
|
||||
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
|
||||
Args:
|
||||
status : Get Current ${PROJECT} tags status
|
||||
@@ -48,7 +48,7 @@ Options:
|
||||
-h : Show this help
|
||||
-p : push tags
|
||||
|
||||
EOT
|
||||
EOF
|
||||
|
||||
}
|
||||
|
||||
|
@@ -223,12 +223,12 @@ bump_repo() {
|
||||
|
||||
info "Creating PR message"
|
||||
notes_file=notes.md
|
||||
cat <<EOT >"${notes_file}"
|
||||
cat <<EOF >"${notes_file}"
|
||||
# Kata Containers ${new_version}
|
||||
|
||||
$(get_changes "$current_version")
|
||||
|
||||
EOT
|
||||
EOF
|
||||
cat "${notes_file}"
|
||||
|
||||
if (echo "${current_version}" | grep "alpha") && (echo "${new_version}" | grep -v "alpha");then
|
||||
@@ -282,7 +282,7 @@ EOT
|
||||
|
||||
usage() {
|
||||
exit_code="$1"
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage:
|
||||
${script_name} [options] <args>
|
||||
Args:
|
||||
@@ -293,7 +293,7 @@ Example:
|
||||
Options
|
||||
-h : Show this help
|
||||
-p : create a PR
|
||||
EOT
|
||||
EOF
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
||||
|
@@ -12,7 +12,7 @@ script_dir="$(realpath $(dirname $0))"
|
||||
patches_dir="$1"
|
||||
|
||||
if [ -z "$patches_dir" ]; then
|
||||
cat <<-EOT
|
||||
cat <<-EOF
|
||||
Apply patches to the sources at the current directory.
|
||||
|
||||
Patches are expected to be named in the standard git-format-patch(1) format where
|
||||
@@ -30,7 +30,7 @@ if [ -z "$patches_dir" ]; then
|
||||
$0 PATCHES_DIR
|
||||
Where:
|
||||
PATCHES_DIR is the directory containing the patches
|
||||
EOT
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@@ -72,7 +72,7 @@ die() {
|
||||
|
||||
# Display usage to stdout.
|
||||
usage() {
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Overview:
|
||||
|
||||
Display configure options required to build the specified
|
||||
@@ -94,7 +94,7 @@ Example:
|
||||
|
||||
$ $script_name qemu
|
||||
|
||||
EOT
|
||||
EOF
|
||||
}
|
||||
|
||||
show_tags_header() {
|
||||
@@ -102,10 +102,10 @@ show_tags_header() {
|
||||
local key
|
||||
local value
|
||||
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
# Recognised option tags:
|
||||
#
|
||||
EOT
|
||||
EOF
|
||||
|
||||
# sort the tags
|
||||
keys=${!recognised_tags[@]}
|
||||
|
@@ -55,7 +55,7 @@ gen_version_file() {
|
||||
# see https://github.com/semver/semver/issues/145
|
||||
kata_version=$(get_kata_version)
|
||||
kata_version=${kata_version/-/\~}
|
||||
cat > "$versions_txt" <<EOT
|
||||
cat > "$versions_txt" <<EOF
|
||||
# This is a generated file from ${script_name}
|
||||
|
||||
kata_version=${kata_version}
|
||||
@@ -70,7 +70,7 @@ kernel_version=${kernel_version}
|
||||
|
||||
# Golang
|
||||
go_version=${golang_version}
|
||||
EOT
|
||||
EOF
|
||||
}
|
||||
|
||||
die() {
|
||||
@@ -85,7 +85,7 @@ die() {
|
||||
|
||||
usage() {
|
||||
exit_code=$"${1:-0}"
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage:
|
||||
${script_name} [--compare | -h | --help] <kata-branch>
|
||||
|
||||
@@ -98,7 +98,7 @@ Options:
|
||||
--compare Only compare the kata version at branch <kata-branch> with the
|
||||
one in ${versions_txt} and leave the file untouched.
|
||||
--head Use <kata-branch>'s head to generate the versions file.
|
||||
EOT
|
||||
EOF
|
||||
exit "${exit_code}"
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,7 @@ info() {
|
||||
|
||||
usage(){
|
||||
exit_code="$1"
|
||||
cat <<EOT
|
||||
cat <<EOF
|
||||
Usage:
|
||||
|
||||
${script_name} [options]
|
||||
@@ -43,7 +43,7 @@ Options
|
||||
-d <path> : destination path, path where go will be installed.
|
||||
-f : enable force install, remove existent go pkg before installation.
|
||||
-h : display this help.
|
||||
EOT
|
||||
EOF
|
||||
|
||||
exit "$exit_code"
|
||||
}
|
||||
|
Reference in New Issue
Block a user