File: update-cri-proto

package info (click to toggle)
falcosecurity-libs 0.1.1dev%2Bgit20220316.e5c53d64-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,732 kB
  • sloc: cpp: 55,770; ansic: 37,330; makefile: 74; sh: 13
file content (19 lines) | stat: -rwxr-xr-x 557 bytes parent folder | download
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"