Skip to content

Commit 9b683b9

Browse files
committed
fix: copy falco driver migration to v0.50
1 parent 2a050d9 commit 9b683b9

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
HERE="$(dirname "$(readlink -f "${0}")")"
4+
ROOT="$(readlink -f "${HERE}/../../../")"
5+
6+
# shellcheck source=scripts/migration/lib.sh
7+
source "${ROOT}/scripts/migration/lib.sh"
8+
9+
update_falco_driver() {
10+
local -r cluster="${1}"
11+
local current_driver
12+
current_driver="$(yq_dig "${cluster}" '.falco.driver.kind')"
13+
14+
if [[ "${current_driver}" == "modern-bpf" ]] || [[ "${current_driver}" == "kmod" ]]; then
15+
log_info "Updating falco driver from ${current_driver} to modern_ebpf in ${cluster}-config..."
16+
yq_add "${cluster}" '.falco.driver.kind' '"modern_ebpf"'
17+
fi
18+
}
19+
20+
if [[ "${CK8S_CLUSTER}" =~ ^(sc|both)$ ]]; then
21+
update_falco_driver sc
22+
fi
23+
if [[ "${CK8S_CLUSTER}" =~ ^(wc|both)$ ]]; then
24+
update_falco_driver wc
25+
fi
26+
update_falco_driver common

0 commit comments

Comments
 (0)