Commit Graph

32 Commits (d3816069e60e766858927e3242bb824659c1ce54)

Author SHA1 Message Date
Clayton Coleman a81dc44fc6 Revert "Stream support for k8s client request"
This reverts commit 755b598a7d.
2014-10-01 19:39:08 -04:00
Clayton Coleman 67ef24b410 Merge pull request #1506 from jhadvig/upstream_k8_stream
Stream support for client request
2014-10-01 19:32:27 -04:00
jhadvig 755b598a7d Stream support for k8s client request 2014-10-02 01:07:43 +02:00
Clayton Coleman ff2eca97d9 Refactor the client (again) to better support auth
* Allows consumers to provide their own transports for common cases.
* Supports KUBE_API_VERSION on test cases for controlling which
  api version they test against
* Provides a common flag registration method for CLIs that need
  to connect to an API server (to avoid duplicating flags)
* Ensures errors are properly returned by the server
* Add a Context field to client.Config
2014-10-01 15:23:37 -04: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
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
csrwng 6551f4e0f0 Use codec to encode/decode api objects in client and kubecfg parser 2014-09-09 08:45:53 -04:00
Daniel Smith 0d30a656ef Do interface{} -> runtime.Object rename everywhere 2014-09-07 22:19:24 -07:00
Daniel Smith 1c2b65788d Rename Codec and ResourceVersioner to add Default in front, to allow for types of those names 2014-09-07 22:19:24 -07:00
Daniel Smith a63966e73c Combine pkg/apitools and pkg/api/common and call the result pkg/runtime 2014-09-02 11:15:44 -07:00
Daniel Smith 099c8fd36f Propagate rename; tests pass again. 2014-09-02 10:42:06 -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
Clayton Coleman 818f357128 Client should validate the incoming host value
Convert host:port and URLs passed to client.New() into the proper
values, and return an error if the value is invalid.  Change CLI
to return an error if -master is invalid.  Remove Client.rawRequest
which was not in use, and fix the involved tests. Add NewOrDie

Preserves the behavior of the client to not auth when a non-https
URL is passed (although in the future this should be corrected).
2014-08-28 13:47:36 -04:00
csrwng 938548a9fb Break up API client into per-resource client and common code 2014-08-25 07:54:35 -04:00
Daniel Smith 5dd130a350 Prevent accidental setting of sync or timeout 2014-08-08 14:09:14 -07:00
Daniel Smith 097147545c Allow more general parameters to be made by client. Also fix style and comments. 2014-08-08 14:09:13 -07:00
Clayton Coleman 4f88b778a6 Evolve the api.Status object with Reason/Details
Contains breaking API change on api.Status#Details (type change)

Turn Details from string -> StatusDetails - a general
bucket for keyed error behavior.  Define an open enumeration
ReasonType exposed as Reason on the status object to provide
machine readable subcategorization beyond HTTP Status Code. Define
a human readable field Message which is common convention (previously
this was joined into Details).

Precedence order: HTTP Status Code, Reason, Details. apiserver would
impose restraints on the ReasonTypes defined by the main apiobject,
and ensure their use is consistent.

There are four long term scenarios this change supports:

1. Allow a client access to a machine readable field that can be
   easily switched on for improving or translating the generic
   server Message.

2. Return a 404 when a composite operation on multiple resources
   fails with enough data so that a client can distinguish which
   item does not exist.  E.g. resource Parent and resource Child,
   POST /parents/1/children to create a new Child, but /parents/1
   is deleted.  POST returns 404, ReasonTypeNotFound, and
   Details.ID = "1", Details.Kind = "parent"

3. Allow a client to receive validation data that is keyed by
   attribute for building user facing UIs around field submission.
   Validation is usually expressed as map[string][]string, but
   that type is less appropriate for many other uses.

4. Allow specific API errors to return more granular failure status
   for specific operations.  An example might be a minion proxy,
   where the operation that failed may be both proxying OR the
   minion itself.  In this case a reason may be defined "proxy_failed"
   corresponding to 502, where the Details field may be extended
   to contain a nested error object.

At this time only ID and Kind are exposed
2014-08-05 16:17:53 -04:00
Daniel Smith 91375f4c04 Split httpWatcher into watch.StreamWatcher and tools.APIEventDecoder. 2014-07-21 16:07:58 -07:00
Daniel Smith dbd0d419df Add watch capability to our client.
Next steps: Make an etcd watcher... decide on a state field for pods...
move the scheduler to its own binary.
2014-07-21 16:07:58 -07:00
brendandburns 0748ac39e8 Merge pull request #374 from yugui/feature/show-progress
Periodically shows message while waiting for completion of REST operations
2014-07-09 23:15:05 -07:00
Yuki Yugui Sonoda 602f7d8112 Use glog instead of printing to stderr. 2014-07-10 14:59:56 +09:00
Yuki Yugui Sonoda 325c5cd47e Fixes golint errors in pkg/client 2014-07-08 16:15:41 +09:00
Brendan Burns e3838e1153 Make poll period and timeout configurable.
Make poll period short for integration testing.
2014-07-07 10:13:27 -07:00
Brendan Burns 2f5eeee1f6 Make sync false by default. Works around timeout/retry issues. 2014-07-03 21:23:21 -07:00
Brendan Burns a391b2ff03 Implement sync behavior for controllers. 2014-06-26 19:44:28 -07:00
Daniel Smith fd5e3b0b04 Implement client polling. 2014-06-26 16:10:38 -07:00
Daniel Smith c9246dc130 Implement required sync changes everywhere.
Make requests sync by default, so that usage of them doesn't have to
change.
2014-06-26 10:33:21 -07:00
Brendan Burns 84e5c37f74 Several small fixes. 2014-06-24 15:30:14 -07:00
Brendan Burns 8b50e45dcc Update the proxy server. 2014-06-24 11:25:45 -07:00
Daniel Smith 72809f8e67 catch 202 early 2014-06-24 09:38:22 -07:00
Daniel Smith 5ce54bb77b Use new method. 2014-06-24 09:38:22 -07:00
Daniel Smith 61a494d303 First step of combination. 2014-06-24 09:38:22 -07:00