summaryrefslogtreecommitdiff
path: root/api_changes.md
diff options
context:
space:
mode:
authorWojciech Tyczynski <wojtekt@google.com>2015-04-17 14:16:33 +0200
committerWojciech Tyczynski <wojtekt@google.com>2015-04-29 16:32:31 +0200
commitc7f8e8e7f8f037b0e7d94b0e361b75ea5c50676d (patch)
tree6033cc4f43529b5c0a696e06fced7aae784842df /api_changes.md
parent5ccad95c4965ee13a8c4db46045c157939a97730 (diff)
Improvements to conversions generator.
Diffstat (limited to 'api_changes.md')
-rw-r--r--api_changes.md19
1 files changed, 17 insertions, 2 deletions
diff --git a/api_changes.md b/api_changes.md
index 5e648544..6c495c4c 100644
--- a/api_changes.md
+++ b/api_changes.md
@@ -222,9 +222,24 @@ types, structural change in particular - you must add some logic to convert
versioned APIs to and from the internal representation. If you see errors from
the `serialization_test`, it may indicate the need for explicit conversions.
+Performance of conversions very heavily influence performance of apiserver.
+Thus, we are auto-generating conversion functions that are much more efficient
+than the generic ones (which are based on reflections and thus are highly
+inefficient).
+
The conversion code resides with each versioned API -
-`pkg/api/<version>/conversion.go`. Unsurprisingly, this also requires you to
-add tests to `pkg/api/<version>/conversion_test.go`.
+`pkg/api/<version>/conversion.go`. To regenerate conversion functions:
+ - run
+```
+ $ go run cmd/kube-conversion/conversion.go -v <version> -f <file1.txt> -n <file2.txt>
+```
+ - replace all conversion functions (convert\* functions) in the above file
+ with the contents of \<file1.txt\>
+ - replace arguments of `newer.Scheme.AddGeneratedConversionFuncs`
+ with the contents of \<file2.txt\>
+
+Unsurprisingly, this also requires you to add tests to
+`pkg/api/<version>/conversion_test.go`.
## Update the fuzzer