Use file tags to generate conversions

This drives conversion generation from file tags like:
  // +conversion-gen=k8s.io/my/internal/version
.. rather than hardcoded lists of packages.

The only net change in generated code can be explained as correct.  Previously
it didn't know that conversion was available.
This commit is contained in:
Tim Hockin 2016-06-06 23:42:16 -07:00
parent 3bc5017e01
commit b35f3aa8f5
1 changed files with 4 additions and 3 deletions

View File

@ -79,9 +79,10 @@ cmd/libs/go2idl/ tool.
2. Make sure your pkg/apis/`<group>`/`<version>` directory has a doc.go file 2. Make sure your pkg/apis/`<group>`/`<version>` directory has a doc.go file
with the comment `// +k8s:deepcopy-gen=package,register`, to catch the with the comment `// +k8s:deepcopy-gen=package,register`, to catch the
attention of our generation tools. attention of our generation tools.
3. Make sure your pkg/apis/`<group>`/`<version>` directory has a doc.go file 3. Make sure your `pkg/apis/<group>/<version>` directory has a doc.go file
with the comment `// +genconversion=true`, to catch the attention of our with the comment `// +k8s:conversion-gen=<internal-pkg>`, to catch the
gen-conversion script. attention of our generation tools. For most APIs the only target you
need is `k8s.io/kubernetes/pkg/apis/<group>` (your internal API).
4. Run hack/update-all.sh. 4. Run hack/update-all.sh.
2. Generate files for Ugorji codec: 2. Generate files for Ugorji codec: