Commit Graph

62 Commits (ec6181d5d3cae2238d485ee75332ab9c09b619d9)

Author SHA1 Message Date
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 93e3df8e55 Merge pull request #24789 from wojtek-t/use_proper_codec_in_client
Automatic merge from submit-queue

Use proper codec in client
2016-05-04 11:00:04 -07:00
Wojciech Tyczynski 3aadafd411 Use NegotiatedSerializer in client 2016-05-04 10:57:36 +02:00
Clayton Coleman 99430cf5de
Strip side-effect imports from generated protobuf 2016-05-02 18:12:20 -04:00
Clayton Coleman 3111985564 Handle streaming serializers more consistently
Add tests to watch behavior in both protocols (http and websocket)
against all 3 media types. Adopt the
`application/vnd.kubernetes.protobuf;stream=watch` media type for the
content that comes back from a watch call so that it can be
distinguished from a Status result.
2016-04-22 11:07:24 -04:00
Clayton Coleman e16a7f2421 Initial protobuf generated files 2016-04-20 12:13:05 -04:00
Clayton Coleman f89bde1415 Add watch.Until, a conditional watch mechanism
Also add helpers for collecting the events that happen during a watch
and a helper that makes it easy to start a watch from any object with
ObjectMeta.
2016-04-15 11:49:07 -04:00
Clayton Coleman 3474911736 Implement a streaming serializer for watch
Changeover watch to use streaming serialization. Properly version the
watch objects. Implement simple framing for JSON and Protobuf (but not
YAML).
2016-04-11 11:22:05 -04:00
Wojciech Tyczynski 89585237cd Rename RawJSON to Raw in runtime.RawExtension and add ContentType & ContentEncoding. 2016-03-18 12:35:27 +01:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Clayton Coleman 4a6935b31f Remaining codec change refactors 2016-01-22 13:27:27 -05:00
Clayton Coleman 33085c0cf2 Update tests to handle codec changes 2016-01-22 13:27:26 -05:00
Harry Zhang 936a11e775 Use networking to hold network related pkgs
Change names of unclear methods

Use net as pkg name for short
2016-01-15 13:46:16 +08:00
Clayton Coleman 8f203a28f1 Change runtime.Object signature 2015-12-15 13:36:25 -05:00
Clayton Coleman 1e21054134 Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of
Encode and Decode to be more complicated. Create a stub helper
with the exact semantics of today and do the simple mechanical
refactor here to reduce the cost of that change.
2015-12-09 21:15:02 -05:00
Daniel Smith 4bdb1259a7 fix delta fifo & various fakes for go1.5.1 2015-10-14 16:07:46 -07:00
Brendan Burns 77fd388485 Increase a bunch of timeouts to reduce flakes 2015-09-23 11:09:03 -07:00
jhadvig 7582e90d01 Minor typos fix 2015-09-12 21:16:22 +02:00
Daniel Martí ad243edaa3 Fix race condition in watch
The Shutdown() call returned immediately, without waiting for all event
distributions to be completed. Even worse, it would close all the watcher
result channels before all the info was sent to them.

Properly wait for all distributor goroutines - currently only one - to be
finished.

This fixes the flaky test TestBroadcasterDropIfChannelFull. Bonus cleanup on
said test too.
2015-09-10 11:44:14 -07:00
Chao Xu 9fc79e9d99 refactor testapi and test scripts to prepare for multiple API groups. 2015-09-04 18:01:32 -07:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Veres Lajos 9f77e49109 typofix - https://github.com/vlajos/misspell_fixer 2015-08-08 22:31:48 +01:00
Mike Danese 17defc7383 run gofmt on everything we touched 2015-08-05 17:52:56 -07:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Michal Fojtik 1d496a030e Suppress 'use of closed network connection' error in iowatcher
Signed-off-by: Michal Fojtik <mfojtik@redhat.com>
2015-04-24 14:32:00 +02:00
nikhiljindal 08d9e244f7 Removing some references to v1beta1 from test code 2015-04-08 17:28:06 -07:00
Derek Carr 6eb54e73e0 Merge pull request #5270 from lavalamp/fix7
Controller framework
2015-04-07 16:58:09 -04:00
Clayton Coleman 7a6b2ec227 Improve the output of the swagger API for watch events
Stopgap to improve this prior to converting watch resources to
versioned objects.
2015-04-07 10:46:19 -04:00
Alexandr Lurye 952ff24f0b Do not log net.errClosing error when StreamWatcher is stopping. 2015-04-04 05:18:32 +02:00
Daniel Smith 3fe17b93cf Begin a controller framework. 2015-04-02 15:25:58 -07:00
Kris Rousey 6904c4d585 Fixing a lot of string formatting issues with regards to:
* Improper format specifier (e.g. %s for bools or %s for ints)
  * More or less parameters than format specifiers
  * Not calling a formatting function when it should have (e.g. Error() instead of Errorf())
2015-03-31 16:47:10 -07:00
Clayton Coleman eb0eff69fe Move watch to being a resthandler resource and expose it on LIST
GET /pods?watch=true&resourceVersion=10

will now function equivalent to GET /watch/pods.
2015-03-27 15:03:58 -04:00
Yu-Ju Hong 4a72addaeb Factor out API defaulting from validation logic
Currently, the validation logic validates fields in an object and supply default
values wherever applies. This change factors out defaulting to a set of
defaulting callback functions for decoding (see #1502 for more discussion).

 * This change is based on pull request 2587.

 * Most defaulting has been migrated to defaults.go where the defaulting
   functions are added.

 * validation_test.go and converter_test.go have been adapted to not testing the
   default values.

 * Fixed all tests with that create invalid objects with the absence of
   defaulting logic.
2015-02-03 00:55:42 -08:00
Alex Robinson 90e1d58fa6 Add a unit test for watch.Broadcaster DropIfChannelFull and a couple small fixes 2015-01-14 04:36:29 +00:00
Alex Robinson be6b1cf0e2 Push the full channel logic into the implementation of the broadcaster
in watch/mux.go rather than being in the client event recording code.
2015-01-13 02:22:30 +00:00
Clayton Coleman b2434de777 When connections are broken on Watch, write fewer errors to logs
Watch depends on long running connections, which intervening proxies
may break without the control of the remote server. Specific errors
handled are io.EOF, io.EOF wrapped by *url.Error, http connection
reset errors (caused by race conditions in golang http code), and
connection reset by peer (simply tolerated).
2014-12-18 16:15:51 -05:00
bgrant0607 f95503dc2d Merge pull request #2767 from ironcladlou/watch-error-handling
Log ErrUnexpectedEOF from watches as warnings
2014-12-05 13:43:26 -08:00
Dan Mace 0ad8342a55 Log ErrUnexpectedEOF from watches as warnings
Watches are often established via long-running HTTP GET requests which
will inevitably time out during the normal course of operations. When
the watches time out, an io.EOF or an io.ErrUnexpectedEOF will bubble
up to client components such as StreamWatcher and Reflector. Treat EOF
as a clean watch termination. Treat ErrUnexpectedEOF as a less-clean
but non-fatal watch termination and log the event at the warning level.

This greatly reduces the amount of log noise generated during what is
ultimately normal operation, and adds the flexibility for the operator
to make a distinction between the EOF conditions if so desired (by
adjusting the logging level).
2014-12-05 15:03:07 -05:00
Eric Tune 3f285269cc Rename watch.Mux -> watch.Broadcaster
A few reasons:
- Mux is already widely used in the codebase to refer to a http handler mux.
- Original meaning of Mux was something which sent a chose one of several inputs to
  and output.  This sends one output to all outputs.  Broadcast captures that idea
  better.
- Aligns with similar class config.Broadcaster (see #2747)
2014-12-04 00:30:51 -08:00
Sam Ghods 6399854240 Remove unused YAML tags and GetYAML/SetYAML methods
Unneeded after move to ghodss/yaml.
2014-12-02 16:25:28 -08:00
Tim Hockin ea960711ff Clean up error logs.
Use %v for errors, tidy some messages, make error messages start lowe-case
(as per go guidelines).  Just accumulated nits.
2014-11-21 09:45:26 +08:00
Clayton Coleman 644eb70085 Refactor tests to split ObjectMeta from TypeMeta 2014-10-24 11:22:21 -04:00
Clayton Coleman bb77a5d15f Rename ID -> Name 2014-10-22 15:00:26 -04:00
Daniel Smith 38bf2f30fb fix missing error type in watch decode 2014-10-13 15:03:17 -07:00
Clayton Coleman d3e51a0f24 Rename JSONBase -> TypeMeta in preparation for v1beta3
Will make subsequent refactor much easier
2014-10-07 11:12:16 -04:00
Daniel Smith 8fd1fb4337 update pkg/api documentation 2014-09-22 17:08:57 -07:00
Daniel Smith 05eff2e910 add new watch event type 2014-09-22 17:06:03 -07:00
Clayton Coleman e3da2ba2c8 Cleanup watch encoding (remove dupe Encoding)
Move standard watch encode / decode streams to use
runtime.RawExtension and embed API decoding based on
a provided codec.
2014-09-22 16:03:07 -04:00