2023-12-05 16:31:49 -06:00
|
|
|
|
# Kubernetes HACK Alert
|
|
|
|
|
|
|
|
|
|
This is a hack folder for kubernetes codegen scripts. Oddly, a /hack/ folder seems to be standard kubernetes development practice ¯\_(ツ)\_/¯
|
|
|
|
|
|
|
|
|
|
The workflow is a WIP, however we are trying to leverage as many off-the-shelf patterns as possible.
|
|
|
|
|
|
|
|
|
|
For these scripts to work, your local GOROOT/src/grafana/grafana must point to this git checkout. For my setup this is:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
❯ pwd
|
|
|
|
|
/Users/ryan/go/src/github.com/grafana
|
|
|
|
|
❯ ls -l
|
|
|
|
|
total 0
|
|
|
|
|
lrwxr-xr-x 1 ryan staff 37 Oct 5 09:34 grafana -> /Users/ryan/workspace/grafana/grafana
|
|
|
|
|
```
|
|
|
|
|
|
2024-01-25 14:01:09 -06:00
|
|
|
|
The current workflow is to run the following:
|
2024-01-17 23:32:44 -06:00
|
|
|
|
|
2024-01-25 14:01:09 -06:00
|
|
|
|
```shell
|
|
|
|
|
# ensure k8s.io/code-generator pkg is up to date
|
|
|
|
|
go mod download
|
2023-12-05 16:31:49 -06:00
|
|
|
|
|
2024-01-25 14:01:09 -06:00
|
|
|
|
# the happy path
|
|
|
|
|
./hack/update-codegen.sh
|
2023-12-05 16:31:49 -06:00
|
|
|
|
|
2024-01-25 14:01:09 -06:00
|
|
|
|
|
|
|
|
|
Note that the script deletes existing openapi go code and regenerates in place so that you will temporarily see
|
|
|
|
|
deleted files in your `git status`. After a successful run, you should see them restored.
|
2024-02-04 14:37:10 -06:00
|
|
|
|
```
|