Commit Graph

59 Commits (6ef6ff5bc5af247af0b0a53beee0527f3c1c667e)

Author SHA1 Message Date
Daniel Smith 6ef6ff5bc5 Merge pull request #1893 from crhym3/fix-1149-req-body
Replace custom ProxyServer (kubecfg/kubectl -proxy) with httputil.ReverseProxy
2014-10-22 15:29:59 -07:00
alex fb2b15a797 Replace custom proxy with httputil.ReverseProxy for kubecfg/kubectl.
Fixes #1149 - kubecfg proxy "411 Length Required" error on POST/PUT.
2014-10-21 18:52:18 +01:00
Eric Tune 21dae01005 Handle auth files with BearerToken sections. 2014-10-20 17:02:03 -07:00
derekwaynecarr 085ca40291 Enforce unique constraint at namespace boundary in etcd, make client and server namespace aware 2014-10-16 13:02:52 -04:00
Daniel Smith 68a784439b Add event listing and printing to kubecfg 2014-10-15 11:42:06 -07:00
Brendan Burns 227311a05d Add URL opening to kubecfg. 2014-10-09 12:26:24 -07:00
Clayton Coleman 82bcdd3b3b Make ResourceVersion a string internally instead of uint64
Allows us to define different watch versioning regimes in the future
as well as to encode information with the resource version.

This changes /watch/resources?resourceVersion=3 to start the watch at
4 instead of 3, which means clients can read a resource version and
then send it back to the server. Clients should no longer do math on
resource versions.
2014-10-07 19:00:26 -04: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
erictune 0a2e208e8f Merge pull request #1538 from smarterclayton/allow_skip_tls_verify
Allow clients to skip TLS verification
2014-10-02 11:49:40 -07:00
derekwaynecarr fc67d822c6 Add context as parameter to client interface functions 2014-10-02 12:51:36 -04:00
Clayton Coleman 7af3c7d75e Allow clients to skip TLS verification
Adds -skip_tls_verify to any API server client. Also store in auth
2014-10-02 12:08:58 -04:00
Brendan Burns c3d2517371 Re-add the ability to load certs from the config file. 2014-10-01 17:10:07 -07: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
derekwaynecarr b7b1193919 Add context object to kubecfg/client 2014-09-30 14:27:19 -04:00
Brendan Burns 8f1643bc0c Add the ability to print objects that are parsed in, without sending them anywhere. 2014-09-26 20:35:12 -07:00
Tim Hockin 8b6de5af83 Merge pull request #1390 from smarterclayton/allow_stdin
Allow STDIN to kubecfg via `-c -`.
2014-09-22 16:49:55 -07:00
Clayton Coleman b9028753b0 Merge pull request #1387 from lavalamp/fix4
Don't pass empty labels (looks weird to POST with a label set)
2014-09-22 16:41:01 -04:00
Clayton Coleman de9dc08e55 Allow STDIN to kubecfg via `-c -`.
Follows the `tar xvf -` convention (because all the other conventions
are crazier?)
2014-09-20 18:40:00 -04:00
Daniel Smith 4aecdce258 Don't pass empty labels (looks weird to POST with a label set) 2014-09-19 16:04:55 -07:00
Brendan Burns 8dff6f12d7 Add authenticated TLS support to the client. 2014-09-19 15:43:23 -07:00
Clayton Coleman 5483333e29 Allow server and client to take api version as argument
* Defaults to v1beta1
* apiserver takes -storage_version which controls etcd storage version
  and the version of the client used to connect to other apiservers
* Changed signature of client.New to add version parameter
* All controller code and component code prefers the oldest (most common)
  server version
2014-09-18 23:27:28 -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
Clayton Coleman fe614aeda2 Simple refactor for ease of readability
runtime.DefaultCodec -> latest.Codec
2014-09-16 16:12:35 -04:00
brendandburns 4f8536dd80 Merge pull request #1211 from derekwaynecarr/kubecfg_improve_c_option
Add support to fetch config file from network
2014-09-10 13:06:03 -07:00
Filipe Brandenburger b849d65b32 Uniformize handling of -server_version flag of kubecfg to match -version.
In particular, add support for -server_version=raw and use matching
format for the output of -version and -server_version.

The "normal" format is essentially defined by (version.Info) String()
method, so future updates to that method will be reflected on both.

Full version information is still available by using the "raw" flag.

Tested:
- Used cluster/kubecfg.sh to query local build and the server.

    $ cluster/kubecfg.sh -version
    Kubernetes version 0.2+, build 9316edfc0d2b28923fbb6eafa38458350859f926
    $ cluster/kubecfg.sh -server_version
    Server: Kubernetes version 0.2, build a0abb38157
    $ cluster/kubecfg.sh -version=raw
    version.Info{Major:"0", Minor:"2+", GitVersion:"v0.2-25-g9316edfc0d2b28", GitCommit:"9316edfc0d2b28923fbb6eafa38458350859f926", GitTreeState:"clean"}
    $ cluster/kubecfg.sh -server_version=raw
    version.Info{Major:"0", Minor:"2", GitVersion:"v0.2", GitCommit:"a0abb3815755d6a77eed2d07bb0aa7d255e4e769", GitTreeState:"clean"}

Fixes: #1092

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-09-09 15:25:41 -07:00
derekwaynecarr 35a50a94da Add support to fetch config file from network 2014-09-09 17:50:38 -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 fc09f988b4 Make tests pass again 2014-09-07 22:26:42 -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
Joe Beda e5fe8270a1 Improve 'Usage' for kubecfg 2014-09-04 13:25:39 -07:00
Joe Beda f8e2f927f6 Pretty up the demo a little.
Use images and some better formatting.  Also add scripts to help prevent typos.

This based on an improved version done by Julia Ferraioli.  She came up with the cool images.
2014-09-04 13:25:39 -07:00
Joe Beda 45aaff9993 Add template update to rollingUpdate 2014-09-04 13:25:38 -07:00
Tim Hockin 8ad98db773 Merge pull request #1121 from filbranden/rawversion2
Add support for -version=raw
2014-09-02 13:53:13 -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
Filipe Brandenburger 1d8067450c Rename `pkg/version/flag` to `pkg/version/verflag`
This avoids some conflict with the built-in `flag` module in Go. The
module was already being renamed to `verflag` on import anyways, so we
might as well just call it that.

Tested:
- hack/build-go.sh and ran the resulting binaries with -version args.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-08-29 23:19:32 -07: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
Daniel Smith 025ba881b1 Don't shadow important variables. 2014-08-21 17:55:48 -07:00
csrwng 14714f2638 Allow kubecfg to print custom types 2014-08-20 12:23:02 -04:00
csrwng 5538bfca01 Allow kubecfg to parse other types via initialization map 2014-08-14 18:14:12 -04:00
Daniel Smith 85ff1d3e7f Add fake client to make testing easier. 2014-08-08 14:09:13 -07:00
Brendan Burns 1101c00014 Make updates atomic from the client side. 2014-08-01 16:47:25 -07:00
Yuki Yugui Sonoda 331fd0d986 Extract "pkg/version".PrintAndExitIfRequested() to its own package
because it causes a runtime panic if a binary which has its own implementation
of "-version" flag tries to reuse a package library which indirectly depend on
"pkg/version".

e.g. If such an user-defined binary tires to link "pkg/api" or "pkg/client",
the binary fails with a runtime panic "flag redefined: version".
2014-08-01 15:05:27 +09:00
Filipe Brandenburger 7e56609139 Handle -version flag on all commands
Tested: Passed -version argument to kubelet (and all other binaries):
  $ output/go/bin/kubecfg -version
  Kubernetes version 0.1, build 6454a541fd56

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2014-07-30 18:48:56 -07:00
Daniel Smith 3b8488028d Add /version to server and check it in client.
Will help detect client/version skew and prevent e2e test from passing
while running a version other than the one you think it's running.
2014-07-28 15:45:25 -07:00
Kelsey Hightower 1ca199379f kubecfg: improve tests around authentication
This change adds additional test coverage for the kubecfg
command. There is now a test for the case when the auth info
file does not exist. LoadAuthInfo tests have been refactored
to use table testing.
2014-07-26 22:21:17 -07:00
Jonathan Boulle c43035088b assorted formatting and typo fixes 2014-07-24 15:10:36 -07:00
Clayton Coleman 586a9f4356 Restore behavior of trimming / from kubecfg url
Also make the output and validation of input better for kubecfg api calls.
Kubecfg will now display a usage argument if the URL is incorrect or an
unrecognized storage type is passed.
2014-07-23 11:16:41 -04:00
Brendan Burns cf486a53b6 Change a != to a < to fix kubecfg. 2014-07-22 22:45:17 -07:00
Clayton Coleman fbd7bc375f kubecfg doesn't allow updates because of path checks
Check for 1 path segment on create/list, 2 on update/delete, and
allow any number of path segments on get (for now).

Also pretty prints the list of actual types that are supported for
create/update, which today corresponds to the list of types that
are supported period.
2014-07-22 20:25:06 -04:00