mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-08 21:14:56 +09:00
Closes IvanHunters' MAJOR on keda/values.yaml:60. The shim hardcodes networkPolicy.flavor: cilium and the vendored templates gate only on networkPolicy.enabled + flavor==cilium, never on the cilium.io/v2 CRD being served. keda is offered on every variant from the shared system bundle, so on a variant that ships no Cilium the CiliumNetworkPolicy is unmappable and the whole HelmRelease fails to install. Add a .Capabilities.APIVersions.Has "cilium.io/v2" check to the three CiliumNetworkPolicy templates so the package installs on any CNI; where Cilium is not served the egress backstop is simply absent and the chart's serverAddress namespace-pin remains the control. The vendored edit is captured as patches/ so make update re-applies it instead of silently reverting. Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
29 lines
1.2 KiB
Makefile
29 lines
1.2 KiB
Makefile
export NAME=keda
|
|
export NAMESPACE=cozy-$(NAME)
|
|
|
|
include ../../../hack/package.mk
|
|
|
|
# Pin the upstream KEDA chart by version. Bump deliberately; the assert below
|
|
# aborts if the pulled Chart.yaml version drifts from the pin.
|
|
KEDA_CHART_VERSION ?= 2.20.2
|
|
|
|
test:
|
|
helm unittest .
|
|
|
|
update:
|
|
rm -rf charts
|
|
helm repo add kedacore https://kedacore.github.io/charts
|
|
helm repo update kedacore
|
|
helm pull kedacore/keda --untar --untardir charts --version "$(KEDA_CHART_VERSION)"
|
|
@actual_version=$$(awk '/^version:/ {print $$2}' charts/keda/Chart.yaml | tr -d '"'); \
|
|
if [ "$$actual_version" != "$(KEDA_CHART_VERSION)" ]; then \
|
|
echo "ERROR: pulled chart Chart.yaml version=$$actual_version but Makefile KEDA_CHART_VERSION=$(KEDA_CHART_VERSION). Bump them in lockstep."; \
|
|
exit 1; \
|
|
fi
|
|
# Cozystack ships its own unittest coverage at tests/; drop the vendored
|
|
# upstream fixtures so they are not mistaken for reviewed code here.
|
|
rm -rf charts/keda/tests
|
|
# Gate the CiliumNetworkPolicy objects on the cilium.io/v2 API being served, so the
|
|
# package installs on variants that ship no Cilium (see the patch header).
|
|
patch --no-backup-if-mismatch -p1 < patches/ciliumnetworkpolicy-capability-gate.patch
|