Add yaml linter (#1111)

Co-authored-by: Dimitris Karakasilis <jimmykarily@gmail.com>
This commit is contained in:
Itxaka 2024-10-16 17:27:34 +02:00 committed by GitHub
parent 24ed37c490
commit 066659219a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
20 changed files with 78 additions and 40 deletions

View File

@ -1,13 +1,12 @@
name: Build ARM64
concurrency:
group: "master-arm64-build"
#cancel-in-progress: true
on:
push:
branches: [ main ]
branches:
- main
jobs:
build:
runs-on: ARM64
env:

View File

@ -1,13 +1,12 @@
name: Build
concurrency:
group: "master-build"
#cancel-in-progress: true
on:
push:
branches: [ main ]
branches:
- main
jobs:
build:
runs-on: fast
env:

13
.github/workflows/lint.yaml vendored Normal file
View File

@ -0,0 +1,13 @@
name: Lint
on:
push:
branches:
- main
pull_request:
permissions: read-all
jobs:
call-workflow:
uses: kairos-io/linting-composite-action/.github/workflows/reusable-linting.yaml@8dd82218a024735daac578d2588522a5b4bb2614 # v0.0.9
with:
yamldirs: ".github/workflows/ packages/static/kairos-overlay-files/files"
is-go: false

21
.yamllint Normal file
View File

@ -0,0 +1,21 @@
extends: default
rules:
# 80 chars should be enough, but don't fail if a line is longer
line-length:
max: 305
level: warning
# accept both key:
# - item
#
# and key:
# - item
indentation:
indent-sequences: whatever
truthy:
check-keys: false
document-start:
present: false

View File

@ -22,6 +22,7 @@ depends() {
# shellcheck disable=SC2144
# add network-legacy module if it exists
# shellcheck disable=SC2154
if [ -d "${dracutbasedir}"/modules.d/??network-legacy ]; then
network_handler="network-legacy"
fi

View File

@ -4,14 +4,14 @@ set -euxo pipefail
RELEASE=$1
DOWNLOAD_DIR=$2
ARCH=$3
cd $DOWNLOAD_DIR
sudo curl -L --remote-name-all https://dl.k8s.io/release/${RELEASE}/bin/linux/${ARCH}/{kubeadm,kubelet,kubectl}
cd "$DOWNLOAD_DIR"
sudo curl -L --remote-name-all https://dl.k8s.io/release/"${RELEASE}"/bin/linux/"${ARCH}"/{kubeadm,kubelet,kubectl}
sudo chmod +x {kubeadm,kubelet,kubectl}
cd -
cat files/etc/systemd/system/kubelet.service | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service
sed "s:/usr/bin:${DOWNLOAD_DIR}:g" files/etc/systemd/system/kubelet.service | sudo tee /etc/systemd/system/kubelet.service
sudo mkdir -p /etc/systemd/system/kubelet.service.d
cat files/etc/systemd/system/kubelet.service.d/10-kubeadm.conf | sed "s:/usr/bin:${DOWNLOAD_DIR}:g" | sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sed "s:/usr/bin:${DOWNLOAD_DIR}:g" files/etc/systemd/system/kubelet.service.d/10-kubeadm.conf | sudo tee /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
mkdir -p /etc/default
cp files/etc/default/kubelet /etc/default
systemctl enable kubelet

View File

@ -37,6 +37,7 @@ set -e
SCRIPT_DIR="$(dirname $(readlink -f "${0}"))"
SCRIPT_NAME="$(basename "${0}")"
# shellcheck disable=SC1091
. "${SCRIPT_DIR}/nvcommon_build.sh"
function usage {

View File

@ -1,4 +1,4 @@
packages:
- name: "kairos-overlay-files"
category: "static"
version: "1.3.4"
version: "1.4.0"

View File

@ -4,14 +4,18 @@ HOST_DIR="${HOST_DIR:-/host}"
if [ "$FORCE" != "true" ]; then
if [ -f "/etc/kairos-release" ]; then
# shellcheck disable=SC1091
UPDATE_VERSION=$(source /etc/kairos-release && echo "${KAIROS_VERSION}")
else
# shellcheck disable=SC1091
UPDATE_VERSION=$(source /etc/os-release && echo "${KAIROS_VERSION}")
fi
if [ -f "/etc/kairos-release" ]; then
# shellcheck disable=SC1091
CURRENT_VERSION=$(source "${HOST_DIR}"/etc/kairos-release && echo "${KAIROS_VERSION}")
else
# shellcheck disable=SC1091
CURRENT_VERSION=$(source "${HOST_DIR}"/etc/os-release && echo "${KAIROS_VERSION}")
fi
@ -23,8 +27,8 @@ if [ "$FORCE" != "true" ]; then
fi
fi
mount --rbind $HOST_DIR/dev /dev
mount --rbind $HOST_DIR/run /run
mount --rbind "$HOST_DIR"/dev /dev
mount --rbind "$HOST_DIR"/run /run
recovery_mode=false
while [[ "$#" -gt 0 ]]; do