Protobuf doc changes

This commit is contained in:
Clayton Coleman
2016-04-22 11:48:58 -04:00
parent bc1756c56c
commit bd1ddd32d8
3 changed files with 27 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ found at [API Conventions](api-conventions.md).
- [Edit types.go](#edit-typesgo)
- [Edit validation.go](#edit-validationgo)
- [Edit version conversions](#edit-version-conversions)
- [Generate protobuf objects](#generate-protobuf-objects)
- [Edit json (un)marshaling code](#edit-json-unmarshaling-code)
- [Making a new API Group](#making-a-new-api-group)
- [Update the fuzzer](#update-the-fuzzer)
@@ -472,6 +473,22 @@ generator to create it from scratch.
Unsurprisingly, adding manually written conversion also requires you to add tests to
`pkg/api/<version>/conversion_test.go`.
## Generate protobuf objects
For any core API object, we also need to generate the Protobuf IDL and marshallers.
That generation is done with
```sh
hack/update-generated-protobuf.sh
```
The vast majority of objects will not need any consideration when converting
to protobuf, but be aware that if you depend on a Golang type in the standard
library there may be additional work requried, although in practice we typically
use our own equivalents for JSON serialization. The `pkg/api/serialization_test.go`
will verify that your protobuf serialization preserves all fields - be sure to
run it several times to ensure there are no incompletely calculated fields.
## Edit json (un)marshaling code
We are auto-generating code for marshaling and unmarshaling json representation