Commit Graph

64 Commits (06cdb02fcacc06bbc36d290ce99720856191ff27)

Author SHA1 Message Date
Dr. Stefan Schimanski 44ea6b3f30 Update generated files 2017-01-29 21:41:45 +01:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
deads2k 7993e7c8aa move openapi types to pkg/openapi 2017-01-16 13:40:14 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Antoine Pelisse 5e26788aba Update OWNERS approvers and reviewers: pkg/api 2016-11-09 10:18:08 -08:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Jess Frazelle db33b491cc
update generated protobuf
Signed-off-by: Jess Frazelle <acidburn@google.com>
2016-10-13 21:22:59 -07:00
mbohlool c25ecc43ab Move openapi common code to genericapiserver/openapi/common 2016-09-21 17:01:54 -07:00
mbohlool 8153267ea8 Update generated proto and swagger docs 2016-09-12 18:47:03 -07:00
mbohlool 702f55e61d Add +k8s:openapi-gen tag to API types 2016-09-12 18:47:03 -07:00
mbohlool 6ba271b9ae Customize OpenAPI definition types
customize intstr, unversioned.time, and quantity OpenAPI definitions.
2016-09-12 18:47:03 -07:00
guangxuli b7a5fc9942 const string testQuantityFlag no longer use 2016-09-04 20:37:32 +08:00
Timothy St. Clair 24993b0343 Update generated files due to dependency shift.
Also minor bug fix in federation api.
2016-08-09 10:41:09 -05:00
Tim Hockin 57c3196914 Add support for manually defined DeepCopy methods
In bringing back Clayton's PR piece-by-piece this was almost as easy to
implement as his version, and is much more like what I think we should be
doing.

Specifically, any time which defines a .DeepCopy() method will have that method
called preferentially.  Otherwise we generate our own functions for
deep-copying.  This affected exactly one type - resource.Quantity.  In applying
this heuristic, several places in the generated code were simplified.

To achieve this I had to convert types.Type.Methods from a slice to a map,
which seems correct anyway (to do by-name lookups).
2016-07-07 16:49:46 -07:00
Tim Hockin e18b2f3a2e Revert Clayton's #26179 so I can recreate it
His PR cam during the middle of this development cycle, and it was easier to
burn it down and recreate it than try to patch it into an existing series and
re-test every assumption.  This behavior will be re-introduced in subsequent
commits.
2016-07-07 16:49:46 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
goltermann 218645b346 Fix several spelling errors in comments. 2016-06-17 10:41:18 -07:00
k8s-merge-robot 54b352ae3a Merge pull request #26907 from smarterclayton/tolerate_quantity
Automatic merge from submit-queue

Resource quantity must support leading and trailing whitespace in JSON for back-compat

For backwards compatibility reasons, we must continue to support leading or trailing whitespace on Quantity values when deserialized from JSON.  We must also support numbers serialized into yaml (`cpu: 1`) and JSON (`"cpu": 1`)

Fixes #26898
2016-06-08 16:16:41 -07:00
Clayton Coleman e1dc3ef933
Remove unused deep_copies 2016-06-06 17:18:22 -04:00
Clayton Coleman 0181ac61da
DeepCopy should only generate types in k8s.io/kubernetes
Also make generation more selective (require opt in) to prevent lots of
unnecessary generated deep copies.
2016-06-06 17:18:22 -04:00
Clayton Coleman 653ddbb01e
Tolerate YAML and JSON numbers
Both YAML and JSON can contain numbers
2016-06-06 17:14:50 -04:00
Clayton Coleman 2ed3246631
Resource quantity must support leading and trailing whitespace
For backwards compatibility reasons, we must continue to support leading
or trailing whitespace on Quantity values when deserialized from JSON.
2016-06-06 16:53:42 -04:00
k8s-merge-robot e6a02ac511 Merge pull request #26060 from jonboulle/asdf
Automatic merge from submit-queue

Fix quantity.CanonicalizeBytes docstring name
2016-05-29 03:07:03 -07:00
Clayton Coleman b1310216bf
Round should avoid clearing s, save a string
Instead of saving bytes, save a string, which makes String() faster
and does not unduly penalize marshal. During parse, save the string
if it is in canonical form.
2016-05-24 22:32:45 -04:00
Jonathan Boulle f05b5cf2c5 Fix quantity.CanonicalizeBytes docstring name 2016-05-23 12:17:06 +02:00
Clayton Coleman b2a01d4d94
Add an int64 quantity implementation
Provides fast transformations of int64 scaled values with overflow to
inf.Dec as needed. Attempts to reduce allocations and expensive
operations in the critical path.

Alters the public signature of Quantity to encourage more efficient use
2016-05-19 08:41:39 -04:00
saadali 666da0ccdc Run codegen and codecgen 2016-05-11 17:15:55 -07:00
saadali b83af3d481 Change "speter.net/go/exp/math/dec/inf" dependency
to "https://gopkg.in/inf.v0"
2016-05-11 17:01:28 -07:00
Clayton Coleman cb3a479ed7
Add quantity benchmarks 2016-05-05 18:06:19 -04:00
Clayton Coleman 99430cf5de
Strip side-effect imports from generated protobuf 2016-05-02 18:12:20 -04:00
Clayton Coleman 86fb71aba7 Generated deep copies for new proto types 2016-04-20 12:13:09 -04:00
Clayton Coleman e16a7f2421 Initial protobuf generated files 2016-04-20 12:13:05 -04:00
Clayton Coleman cea4c010a6 Strip the proto build guard 2016-04-20 12:12:29 -04:00
Wojciech Tyczynski e610c137c0 Regenerate auto-generated files 2016-03-17 09:30:02 +01:00
derekwaynecarr 2ad322f295 Add or subtract from zero should not lose format 2016-02-04 13:16:47 -05:00
Tim St. Clair 40e90886e6 Add micro- and nano- suffixes 2016-01-04 14:08:24 -08:00
Tim St. Clair b4116eb718 Handle `nil` Amount in resource.Quantity.{Add,Sub}
Treat `nil` Amount as 0 in `resource.Quantity.Add` and
`resource.Quantity.Sub`. Also, allow adding/subtracting resources with
different Formats (since Format has no effect on the underlying value).
2015-12-10 19:24:23 -08:00
Wojciech Tyczynski 029d906074 Merge pull request #18170 from xiang90/scale
api/resource: optimize scale function
2015-12-09 16:18:28 +01:00
Clayton Coleman 9fea762917 Add protobuf preparation objects, guarded by proto tag 2015-12-05 18:15:48 -05:00
Xiang Li cf82d6b004 resource: optimize scale function
The original scale function takes around 800ns/op with more
than 10 allocations. It significantly slow down scheduler
and other components that heavily relys on resource pkg.
For more information see #18126.

This pull request tries to optimize scale function. It takes
two approach:

1. when the value is small, only use normal math ops.
2. when the value is large, use math.Big with buffer pool.

The final result is:

BenchmarkScaledValueSmall-4	20000000	        66.9 ns/op	       0 B/op	       0 allocs/op
BenchmarkScaledValueLarge-4	 2000000	       711 ns/op	      48 B/op	       1 allocs/op

I also run the scheduler benchmark again. It doubles the throughput of
scheduler for 1000 nodes case.
2015-12-03 17:00:13 -08:00
hurf 5cc909afe7 Remove type validation in resource.Quantity.Add
The type validation is unnecessary for add and will cause problem.
Type will always keep unchanged after new amount is added.
2015-09-22 21:07:31 +08:00
derekwaynecarr ea919f6d1e Fix precision handling in validating LimitRange 2015-09-09 15:52:29 -04:00
derekwaynecarr 2e76842eb7 Update resource quota for requests 2015-09-03 14:24:59 -04:00
Jian Huang c350d325e9 Solve Static Check Error 2015-08-19 13:38:56 +08:00
Janet Kuo 0ac6dba3f4 Make kubectl describe node include allocated resource 2015-08-10 13:25:59 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00