1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#!/bin/bash
set -euo pipefail
CRI_PROTO_URL=https://raw.githubusercontent.com/kubernetes/cri-api/master/pkg/apis/runtime/v1alpha2/api.proto
CRI_PROTO_TMP=$(mktemp /tmp/falcosecurity-libs-cri-proto.XXXXXX)
CRI_PROTO="$(dirname $0)/../cri.proto"
cleanup() {
rm -f "$CRI_PROTO_TMP"
}
trap cleanup EXIT
(
echo "//// automatically generated by $0, rerun to update"
echo ""
curl -fsSL "$CRI_PROTO_URL" | grep -v gogoproto | sed '-res@std(in|out|err) @f_std\1 @g' | sed 's/ \[deprecated=true\]//g'
) > "$CRI_PROTO_TMP" && mv "$CRI_PROTO_TMP" "$CRI_PROTO"
|