The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/hack
Ryan McKinley 439edebcd6
K8s: fix standalone command and add hack scripts (#79052)
1 year ago
..
README.md
boilerplate.go.txt
update-codegen.sh

README.md

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

The current workflow (sorry!) is to:

  1. update the script to point to the group+version you want
  2. run the update-codegen.sh script. This will produce a bunch of new files
  3. move pkg/generated/openapi/zz_generated.openapi.go to pkg/apis/{group/version}/zz_generated.openapi.go.
  4. edit the package name so it is {version} and remove the boilerplate k8s kinds
  5. rm -rf pkg/generated -- we are not yet using most of the generated client stuff

Once we are more comfortable with the outputs and process, we will build these steps into a more standard codegen pattern, but until then... happy hacking!