Commit Graph

171 Commits (f8288ed1f35d3cb7d3992c2df7fc52d79a4eab91)

Author SHA1 Message Date
Vojtech Vitek (V-Teq) 8969f0df7e Handle nil values in conversion.EnforcePtr()
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-10-28 16:36:04 +01:00
Vojtech Vitek (V-Teq) 6a6f24b126 Fix reflect panic in runtime/conversion
Fixes `panic: reflect: call of reflect.Value.Type on zero Value`
when calling conversion.EnforcePtr() or
runtime.Scheme.ObjectVersionAndKind() from default type switch.

Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-10-27 06:01:14 +01:00
Clayton Coleman 52b582271b Typo in conversion Godoc 2014-10-26 22:21:11 -04:00
Clayton Coleman bc748fadfa Whitespace and old comment removal 2014-10-24 11:22:21 -04:00
Vojtech Vitek (V-Teq) 755d4d441a Fix typos 2014-10-21 18:57:20 +02:00
Daniel Smith 71126e79d1 Don't accept empty input in DecodeInto 2014-10-16 13:38:18 -07:00
Clayton Coleman 13992837ea Use one copy of EnforcePtr 2014-10-13 23:29:39 -04:00
Clayton Coleman d488e238dd Genericize MetaInsertionFactory into a simpler interface
The common path code for MIF goes through a conversion cycle - it
can also be done through reflection. This simplifies the Create/Update
methods into Interpret (return version) and Update (through reflection).

In addition it uses only one MetaFactory implementation across all of
our packages which reduces a bit of duplication.
2014-10-13 23:29:39 -04:00
Clayton Coleman 96f0c37a31 Allow multiple names to resolve to a type in a Scheme
Allows decoding multiple names into a single type, necessary for
v1beta3 (rename of Minion -> Node)
2014-10-09 17:14:55 -04:00
Clayton Coleman 338ee1e458 Add additional debugging output on mistyped conversion 2014-10-07 14:09:01 -04:00
Clayton Coleman 305db35422 Add a Log method on Scheme for better debugging 2014-10-05 17:17:25 -04:00
Clayton Coleman 61e3ce7ddc Make runtime less global for Codec
* Make Codec separate from Scheme
* Move EncodeOrDie off Scheme to take a Codec
* Make Copy work without a Codec
* Create a "latest" package that imports all versions and
  sets global defaults for "most recent encoding"
  * v1beta1 is the current "latest", v1beta2 exists
  * Kill DefaultCodec, replace it with "latest.Codec"
  * This updates the client and etcd to store the latest known version
* EmbeddedObject is per schema and per package now
* Move runtime.DefaultScheme to api.Scheme
* Split out WatchEvent since it's not an API object today, treat it
like a special object in api
* Kill DefaultResourceVersioner, instead place it on "latest" (as the
  package that understands all packages)
* Move objDiff to runtime.ObjectDiff
2014-09-16 16:26:43 -04:00
Daniel Smith b8c955ea17 Fixes:
* Fix kubecfg test, which was writing an internal object straight to yaml
* Address review comments
2014-09-15 13:15:46 -07:00
Daniel Smith 71e547124c Make needed changes in conversion package to support pluggability 2014-09-15 13:15:46 -07:00
Daniel Smith 0c6adde92e Change conversion package so that AddKnownTypes takes pointers. 2014-09-07 22:19:24 -07:00
Daniel Smith 2ba6503511 Add continuation to conversion routines 2014-09-07 22:19:24 -07:00
Vojtech Vitek (V-Teq) 59f58cd043 Unify Godoc formatting, fix various typos
Signed-off-by: Vojtech Vitek (V-Teq) <vvitek@redhat.com>
2014-09-02 13:41:03 +02:00
Paul Morie c69160059b Change CreationTimestamp to a util.Time and set in each storage implementation
Because time.Time doesn't work correctly with our YAML package, it is necessary
to introduce a type, util.Time, which serializes correctly to JSON and YAML.

Eventually we would like timestamping to cut across storage implementations;
for now, we set it in each storage.
2014-08-14 16:26:29 -04:00
Daniel Smith 079c9043bd Switch to new external fuzz package 2014-08-08 15:54:09 -07:00
Daniel Smith 1cc7fce523 Add documentation and tests to conversion. 2014-08-01 14:26:36 -07:00
Daniel Smith a73e4f4623 Separate generic parts of api library into conversion package. 2014-08-01 14:25:42 -07:00