address timstclair's comments
This commit is contained in:
parent
1b6810322d
commit
f16e8cbc0f
@ -44,9 +44,9 @@ We plan on improving the way the types are factored in the future; see [#16062](
|
||||
|
||||
1. Create a folder in pkg/apis to hold you group. Create types.go in pkg/apis/`<group>`/ and pkg/apis/`<group>`/`<version>`/ to define API objects in your group;
|
||||
|
||||
2. Create pkg/apis/`<group>`/{register.go, `<version>`/register.go} to register this group's API objects to the encoding/decoding scheme;
|
||||
2. Create pkg/apis/`<group>`/{register.go, `<version>`/register.go} to register this group's API objects to the encoding/decoding scheme (e.g., [pkg/apis/extensions/register.go](../../pkg/apis/extensions/register.go) and [pkg/apis/extensions/v1beta1/register.go](../../pkg/apis/extensions/v1beta1/register.go);
|
||||
|
||||
3. Add a pkg/apis/`<group>`/install/install.go, which is responsible for adding the group to the `latest` package, so that other packages can access the group's meta through `latest.Group`. You need to import this `install` package in {pkg/master, pkg/client/unversioned, cmd/kube-version-change}/import_known_versions.go, if you want to make your group accessible to other packages in the kube-apiserver binary, binaries that uses the client package, or the kube-version-change tool.
|
||||
3. Add a pkg/apis/`<group>`/install/install.go, which is responsible for adding the group to the `latest` package, so that other packages can access the group's meta through `latest.Group`. You probably only need to change the name of group and version in the [example](../../pkg/apis/extensions/install/install.go)). You need to import this `install` package in {pkg/master, pkg/client/unversioned, cmd/kube-version-change}/import_known_versions.go, if you want to make your group accessible to other packages in the kube-apiserver binary, binaries that uses the client package, or the kube-version-change tool.
|
||||
|
||||
Step 2 and 3 are mechanical, we plan on autogenerate these using the cmd/libs/go2idl/ tool.
|
||||
|
||||
@ -59,7 +59,8 @@ Step 2 and 3 are mechanical, we plan on autogenerate these using the cmd/libs/go
|
||||
|
||||
2. Generate files for Ugorji codec:
|
||||
|
||||
1. Touch types.generated.go in pkg/apis/`<group>`{/, `<version>`}, and run hack/update-codecgen.sh.
|
||||
1. Touch types.generated.go in pkg/apis/`<group>`{/, `<version>`};
|
||||
2. Run hack/update-codecgen.sh.
|
||||
|
||||
### Client (optional):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user