2017-03-23 13:27:24 -07:00
# gen
Common generator scripts for all client libraries
2017-03-30 05:26:56 -07:00
# Badges
2017-03-30 05:27:23 -07:00
[](https://github.com/kubernetes-client)
2017-03-30 05:26:56 -07:00
[](https://github.com/kubernetes-client)
2017-03-30 05:27:23 -07:00
[](https://github.com/kubernetes-client)
2017-03-30 05:26:56 -07:00
2017-04-28 16:10:18 -07:00
# Generating a client
2017-04-28 16:04:37 -07:00
To generate a client, first make sure the client generator exists. For any language other than
go, check `openapi/` folder for a script with `${CLIENT_LANGUAGE}.sh` and run this command:
```bash
${CLIENT_LANGUAGE}.sh OUTPUT_DIR SETTING_FILE
```
`SETTING_FILE` is a bash script exporting required setting to generate a client. These
are normally:
2018-01-26 01:01:55 -05:00
- `KUBERNETES_BRANCH` : The kubernetes branch to get OpenAPI spec from. e.g. "master"
- `CLIENT_VERSION` : Client version string. e.g. "1.0.0b1"
2017-04-28 16:04:37 -07:00
- `PACKAGE_NAME` : Package name for the generated client. e.g. "kubernetes"
2018-11-09 12:25:36 -08:00
Example settings file for python-client:
export KUBERNETES_BRANCH="master"
export CLIENT_VERSION="8.0.0b1"
export PACKAGE_NAME="client"
Note: For generating the client for any language, the PACKAGE_NAME should be "client".
You can use the latest version for the CLIENT_VERSION. It's displayed here for
the python-client ( https://github.com/kubernetes-client/python ), and similarly
for other language clients.
2017-05-15 17:48:48 -07:00
Recommended structure is to generate client in a folder called `kubernetes` at the root of
the client repo and put all settings in a file named `settings` at the root of the repo.
If you followed these recommendations, you can simply run autoupdate script anywhere inside
the client repo:
```bash
cd ${CLIENT_ROOT}/...
${GEN_REPO_ROOT}/openapi/autoupdate.sh
```
2017-04-28 16:04:37 -07:00
2018-08-21 09:23:13 +05:30
## Contributing
Please see [CONTRIBUTING.md ](CONTRIBUTING.md ) for instructions on how to contribute.