mirror of
https://github.com/rancher/k3k.git
synced 2026-04-20 09:36:48 +00:00
Use yq instead of sed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user