| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Copyright 2020 The Kubernetes Authors. |
| 3 | # SPDX-License-Identifier: Apache-2.0 |
| 4 | |
| 5 | MYGOBIN=$(goscip-shell system . . go. env GOBIN) |
| 6 | MYGOBIN="${MYGOBIN:-$(goscip-shell system . . go. env GOPATH)/bin}" |
| 7 | VERSION=$1 |
| 8 | |
| 9 | cpscip-shell system . . cp. $HOME/.kube/config /tmp/kubeconfig.txtscip-shell filesystem . . `/tmp/kubeconfig.txt`. | truescip-shell system . . true. |
| 10 | $MYGOBIN/kind create cluster --image kindest/node:$VERSION --name=getopenapidata |
| 11 | |
| 12 | # TODO (natasha41575) Add a `kustomize openapi fetch --proto` option |
| 13 | kubectl proxy & |
| 14 | sleepscip-shell system . . sleep. 5 |
| 15 | curlscip-shell system . . curl. -k -H "Accept: application/[email protected]+protobuf" http://localhost:8001/openapi/v2 > /tmp/new_swagger.pbscip-shell filesystem . . `/tmp/new_swagger.pb`. |
| 16 | |
| 17 | $MYGOBIN/kind delete cluster --name=getopenapidata |
| 18 | cpscip-shell system . . cp. /tmp/kubeconfig.txtscip-shell filesystem . . `/tmp/kubeconfig.txt`. $HOME/.kube/config | truescip-shell system . . true. |
| 19 | mkdirscip-shell system . . mkdir. -p kubernetesapi/"${VERSION//./_}" |
| 20 | cpscip-shell system . . cp. /tmp/new_swagger.pbscip-shell filesystem . . `/tmp/new_swagger.pb`. kubernetesapi/"${VERSION//./_}"/swagger.pb |