add k8up package (#181)
ci/woodpecker/push/deploy-fedora43 Pipeline was successful
ci/woodpecker/push/deploy-fedora44 Pipeline was successful
ci/woodpecker/push/deploy-fedora42 Pipeline was successful
ci/woodpecker/push/deploy-almalinux8 Pipeline was canceled
ci/woodpecker/push/deploy-almalinux9 Pipeline was canceled

The k8up CLI (`k8up cli restore`) has no package, so restores need a manual GitHub download on each host.

- add k8up package pinned to 2.16.0, matching the deployed operator
- verify the release tarball against upstream checksums.txt
- ship urfave/cli bash, zsh and fish completions
- build for el9 and fedora 42-44

Requires terraform-artifactapi github allowlist for k8up-io/k8up.

Reviewed-on: #181
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #181.
This commit is contained in:
2026-10-03 00:23:58 +10:00
committed by BenVincent
parent abcfe87090
commit 05f44b83c4
6 changed files with 149 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
name: k8up
github: k8up-io/k8up
github_release_pattern: ^v2\.
description: K8up Kubernetes backup operator command line client.
arch: amd64
platform: linux
maintainer: K8up Authors
homepage: https://github.com/k8up-io/k8up
license: Apache-2.0
dist_tag: true
builds:
- repository:
- almalinux/el9
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: 1
version: 2.16.0
- repository:
- fedora/42
- fedora/43
- fedora/44
image: git.unkin.net/unkin/almalinux9-rpmbuilder:latest
release: 1
version: 2.16.0
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/bash
set -e
BASE_URL="https://artifactapi.k8s.syd1.au.unkin.net/api/v1/remote/github/k8up-io/k8up/releases/download/v${PACKAGE_VERSION}"
TARBALL="k8up_${PACKAGE_VERSION}_linux_amd64.tar.gz"
wget -O "/app/${TARBALL}" "${BASE_URL}/${TARBALL}"
wget -O /app/checksums.txt "${BASE_URL}/checksums.txt"
cd /app
grep " ${TARBALL}$" checksums.txt | sha256sum --check --strict -
tar xf "/app/${TARBALL}" -C /app/ k8up
envsubst < /app/resources/nfpm.yaml > /app/nfpm.yaml
nfpm pkg --config /app/nfpm.yaml --target /app/dist --packager rpm
+16
View File
@@ -0,0 +1,16 @@
#compdef k8up
local -a opts
local cur
cur=${words[-1]}
if [[ "$cur" == "-"* ]]; then
opts=("${(@f)$(${words[@]:0:#words[@]-1} ${cur} --generate-bash-completion 2>/dev/null)}")
else
opts=("${(@f)$(${words[@]:0:#words[@]-1} --generate-bash-completion 2>/dev/null)}")
fi
if [[ "${opts[1]}" != "" ]]; then
_describe 'values' opts
else
_files
fi
+34
View File
@@ -0,0 +1,34 @@
: ${PROG:=$(basename ${BASH_SOURCE})}
# Macs have bash3 for which the bash-completion package doesn't include
# _init_completion. This is a minimal version of that function.
_cli_init_completion() {
COMPREPLY=()
_get_comp_words_by_ref "$@" cur prev words cword
}
_cli_bash_autocomplete() {
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
local cur opts base words
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
if declare -F _init_completion >/dev/null 2>&1; then
_init_completion -n "=:" || return
else
_cli_init_completion -n "=:" || return
fi
words=("${words[@]:0:$cword}")
if [[ "$cur" == "-"* ]]; then
requestComp="${words[*]} ${cur} --generate-bash-completion"
else
requestComp="${words[*]} --generate-bash-completion"
fi
opts=$(eval "${requestComp}" 2>/dev/null)
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
fi
}
complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete $PROG
unset PROG
+11
View File
@@ -0,0 +1,11 @@
function __k8up_complete
set -l words (commandline -opc)
set -l cur (commandline -ct)
if string match -q -- '-*' $cur
$words $cur --generate-bash-completion 2>/dev/null
else
$words --generate-bash-completion 2>/dev/null
end
end
complete -c k8up -f -a '(__k8up_complete)'
+48
View File
@@ -0,0 +1,48 @@
# nfpm.yaml
name: ${PACKAGE_NAME}
version: ${PACKAGE_VERSION}
release: ${PACKAGE_RELEASE}
arch: ${PACKAGE_ARCH}
platform: ${PACKAGE_PLATFORM}
section: default
priority: extra
description: "${PACKAGE_DESCRIPTION}"
maintainer: ${PACKAGE_MAINTAINER}
homepage: ${PACKAGE_HOMEPAGE}
license: ${PACKAGE_LICENSE}
disable_globbing: false
replaces:
- k8up
provides:
- k8up
contents:
- src: /app/k8up
dst: /usr/bin/k8up
file_info:
mode: 0755
owner: root
group: root
- src: /app/resources/completions/k8up
dst: /usr/share/bash-completion/completions/k8up
file_info:
mode: 0644
owner: root
group: root
- src: /app/resources/completions/_k8up
dst: /usr/share/zsh/site-functions/_k8up
file_info:
mode: 0644
owner: root
group: root
- src: /app/resources/completions/k8up.fish
dst: /usr/share/fish/vendor_completions.d/k8up.fish
file_info:
mode: 0644
owner: root
group: root