|
2 | 2 |
|
3 | 3 | # ------------------------------------------------------------------------------ |
4 | 4 | # This script will automatically generate API updates for new Gateway API |
5 | | -# releases. Update the $VERSION to the new release version before executing. |
| 5 | +# releases. Update the $GATEWAY_API_VERSION to the new release version before |
| 6 | +# executing. |
6 | 7 | # |
7 | 8 | # This script requires kopium, which can be installed with: |
8 | 9 | # |
|
13 | 14 |
|
14 | 15 | set -eou pipefail |
15 | 16 |
|
16 | | -VERSION="v1.4.0" |
| 17 | +GATEWAY_API_VERSION="v1.4.0" |
| 18 | +echo "Using Gateway API version ${GATEWAY_API_VERSION}" |
17 | 19 |
|
18 | 20 | STANDARD_APIS=( |
19 | 21 | gatewayclasses |
@@ -53,7 +55,7 @@ echo "// WARNING! generated file do not edit" > $APIS_DIR/standard/mod.rs |
53 | 55 | for API in "${STANDARD_APIS[@]}" |
54 | 56 | do |
55 | 57 | echo "generating standard api ${API}" |
56 | | - curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${VERSION}/config/crd/standard/gateway.networking.k8s.io_${API}.yaml" | kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f - > $APIS_DIR/standard/${API}.rs |
| 58 | + curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${GATEWAY_API_VERSION}/config/crd/standard/gateway.networking.k8s.io_${API}.yaml" | kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f - > $APIS_DIR/standard/${API}.rs |
57 | 59 | sed -i 's/pub use kube::CustomResource;/pub use kube_derive::CustomResource;/g' $APIS_DIR/standard/${API}.rs |
58 | 60 | echo "pub mod ${API};" >> $APIS_DIR/standard/mod.rs |
59 | 61 | done |
@@ -99,7 +101,7 @@ echo "// WARNING! generated file do not edit" > $APIS_DIR/experimental/mod.rs |
99 | 101 | for API in "${EXPERIMENTAL_APIS[@]}" |
100 | 102 | do |
101 | 103 | echo "generating experimental api $API" |
102 | | - curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${VERSION}/config/crd/experimental/gateway.networking.k8s.io_${API}.yaml" | kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f - > $APIS_DIR/experimental/${API}.rs |
| 104 | + curl -sSL "https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/${GATEWAY_API_VERSION}/config/crd/experimental/gateway.networking.k8s.io_${API}.yaml" | kopium --schema=derived --derive=JsonSchema --derive=Default --derive=PartialEq --docs -f - > $APIS_DIR/experimental/${API}.rs |
103 | 105 | sed -i 's/pub use kube::CustomResource;/pub use kube_derive::CustomResource;/g' $APIS_DIR/experimental/${API}.rs |
104 | 106 | echo "pub mod ${API};" >> $APIS_DIR/experimental/mod.rs |
105 | 107 | done |
|
0 commit comments