Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion envs/k3s_administration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module "server_node" {
ssh_user = "pipeline"

# renovate: datasource=github-releases depName=k3s-io/k3s
k3s_version = "v1.36.4+k3s1"
k3s_version = "v1.37.0+k3s1"
datastore = "sqlite"
tls_san = [var.server_administration_ip]
}
Expand Down
59 changes: 47 additions & 12 deletions modules/k3s/server_node/vendor/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,14 @@ setup_selinux() {
rpm_target=sle
rpm_site_infix=microos
package_installer=zypper
if [ "${ID_LIKE:-}" = suse ] && ( [ "${VARIANT_ID:-}" = sle-micro ] || [ "${ID:-}" = sle-micro ] ); then
rpm_target=sle

# SleMicro 6.2 and SLEs 16 uses the same ID and same VERSION_ID in case the ID and VERSION_ID changes we will catch SLEMicro 6.2 using VARIANT_ID transactional
if [ "${ID:-}" = sles ] && [ -n "${VERSION_ID}" ] && [ "${VERSION_ID%%.*}" -ge 16 ]; then
rpm_site_infix=slemicro
elif [ "${VARIANT_ID:-}" = sle-micro ] || [ "${VARIANT_ID:-}" = transactional ] || [ "${ID:-}" = sle-micro ] || [ "${ID:-}" = sl-micro ] || [ "${ID:-}" = sle-micro-rancher ]; then
rpm_site_infix=slemicro
package_installer=zypper
fi

# cover any atomic fedora flavors using rpm-ostree
elif { [ "${ID:-}" = fedora ] || [ "${ID_LIKE:-}" = fedora ]; } && [ -n "${OSTREE_VERSION:-}" ]; then
rpm_target=coreos
Expand Down Expand Up @@ -962,19 +965,51 @@ rm -rf /var/lib/kubelet
rm -f ${BIN_DIR}/k3s
rm -f ${KILLALL_K3S_SH}

if type yum >/dev/null 2>&1; then
yum remove -y k3s-selinux
rm -f /etc/yum.repos.d/rancher-k3s-common*.repo
elif type rpm-ostree >/dev/null 2>&1; then
rpm-ostree uninstall k3s-selinux
rm -f /etc/yum.repos.d/rancher-k3s-common*.repo
elif type zypper >/dev/null 2>&1; then
# uninstall k3s-selinux package if a compatible package manager is found
zypper_remove_selinux_rpm() {
uninstall_cmd="zypper remove -y k3s-selinux"
if [ "\${TRANSACTIONAL_UPDATE=false}" != "true" ] && [ -x /usr/sbin/transactional-update ]; then
uninstall_cmd="transactional-update --no-selfupdate -d run \$uninstall_cmd"
fi
$SUDO \$uninstall_cmd
\$uninstall_cmd
}
dnf_remove_selinux_rpm() {
package_manager=dnf
# yum is only needed for rhel 7, which is EOM since 2024 anyway
if ! type dnf >/dev/null 2>&1; then
package_manager=yum
fi
\$package_manager remove -y k3s-selinux
}
rpm_ostree_uninstall_cmd="rpm-ostree uninstall --idempotent k3s-selinux"

# shellcheck source=/dev/null
[ -r /etc/os-release ] && . /etc/os-release

if [ "\$(expr "\${ID_LIKE}" : ".*suse.*")" != 0 ]; then
zypper_remove_selinux_rpm
# cover any standard & atomic rhel/centos/fedora + derivatives like amazon linux
elif [ "\${ID:-}" = fedora ] || [ "\$(expr "\${ID_LIKE}" : ".*fedora.*\|.*rhel.*\|.*centos.*")" != 0 ]; then
if [ -n "\${OSTREE_VERSION:-}" ]; then
\$rpm_ostree_uninstall_cmd
else
dnf_remove_selinux_rpm
fi
# if we did not match yet just check for package managers commonly found on selinux-enabled distributions
elif type rpm-ostree >/dev/null 2>&1; then
\$rpm_ostree_uninstall_cmd
elif type zypper >/dev/null 2>&1; then
zypper_remove_selinux_rpm
elif type yum >/dev/null 2>&1; then
dnf_remove_selinux_rpm
elif [ -d /usr/share/selinux ]; then
echo '[WARN] Automatic removal of "k3s-selinux" package not possible, please remove it manually.' >&2
fi

if [ -d /etc/zypp/repos.d ]; then
rm -f /etc/zypp/repos.d/rancher-k3s-common*.repo
elif [ -d /etc/yum.repos.d ]; then
rm -f /etc/yum.repos.d/rancher-k3s-common*.repo
fi
EOF
$SUDO chmod 755 ${UNINSTALL_K3S_SH}
Expand All @@ -993,7 +1028,7 @@ create_env_file() {
info "env: Creating environment file ${FILE_K3S_ENV}"
$SUDO touch ${FILE_K3S_ENV}
$SUDO chmod 0600 ${FILE_K3S_ENV}
sh -c export | while read x v; do echo $v; done | grep -E '^(K3S|CONTAINERD)_' | $SUDO tee ${FILE_K3S_ENV} >/dev/null
sh -c export | while read x v; do echo $v; done | grep -E '^(K3S|CONTAINERD|KINE)_' | $SUDO tee ${FILE_K3S_ENV} >/dev/null
sh -c export | while read x v; do echo $v; done | grep -Ei '^(NO|HTTP|HTTPS)_PROXY' | $SUDO tee -a ${FILE_K3S_ENV} >/dev/null
}

Expand Down
6 changes: 3 additions & 3 deletions vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
- git:
commitTitle: '[release-1.36] Update to v1.36.4-k3s1 and Go 1.26.7 (#14545)...'
sha: 4dedb15be78017a8ddd5b9e81acd44f3481078ed
commitTitle: Update hashicorp gpg fingerprint...
sha: bb7cf0657bafdfbb4349d1740810442d09c2248a
tags:
- v1.36.4+k3s1
- v1.37.0+k3s1
path: .
path: modules/k3s/server_node/vendor
- contents:
Expand Down
2 changes: 1 addition & 1 deletion vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ directories:
- path: .
git:
url: https://github.com/k3s-io/k3s
ref: v1.36.4+k3s1
ref: v1.37.0+k3s1
depth: 1
includePaths:
- install.sh
Expand Down
Loading