Use yq instead of sed

This commit is contained in:
Jonathan Crowther
2026-03-17 13:55:14 -04:00
parent e89a790fc9
commit 4928ca8925

View File

@@ -14,7 +14,6 @@ go run sigs.k8s.io/controller-tools/cmd/controller-gen@${CONTROLLER_TOOLS_VERSIO
# add the 'helm.sh/resource-policy: keep' annotation to the CRDs
for f in ./charts/k3k/templates/crds/*.yaml; do
sed -i '' '1,/^[[:space:]]*annotations:/s/^[[:space:]]*annotations:/&\n helm.sh\/resource-policy: keep/' "$f"
echo "Validating $f"
yq . "$f" > /dev/null
echo "Annotating $f"
yq -i '.metadata.annotations["helm.sh/resource-policy"] = "keep"' "$f"
done