forked from kube-rs/gateway-api-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·52 lines (41 loc) · 1.27 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -eoux pipefail
VERSION="v0.5.1"
STANDARD_APIS=(
gatewayclasses
gateways
httproutes
referencegrants
)
EXPERIMENTAL_APIS=(
gatewayclasses
gateways
httproutes
referencegrants
grpcroutes
tcproutes
tlsroutes
udproutes
)
rm -rf src/apis/
mkdir -p src/apis/
cat << EOF > src/apis/mod.rs
pub mod experimental;
pub mod standard;
EOF
mkdir -p src/apis/standard/
mkdir -p src/apis/experimental/
echo "// WARNING! generated file do not edit" > src/apis/standard/mod.rs
for API in "${STANDARD_APIS[@]}"
do
echo "generating standard api ${API}"
curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/main/config/crd/standard/gateway.networking.k8s.io_${API}.yaml?ref=${VERSION}" | kopium -Af - > src/apis/standard/${API}.rs
echo "pub mod ${API};" >> src/apis/standard/mod.rs
done
echo "// WARNING! generated file do not edit" > src/apis/experimental/mod.rs
for API in "${EXPERIMENTAL_APIS[@]}"
do
echo "generating experimental api $API"
curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/main/config/crd/experimental/gateway.networking.k8s.io_${API}.yaml?ref=${VERSION}" | kopium -Af - > src/apis/experimental/${API}.rs
echo "pub mod ${API};" >> src/apis/experimental/mod.rs
done