Commit Graph

20 Commits

Author SHA1 Message Date
Clayton Coleman
d1ab27762b Create should be able to accept multiple resources 2015-01-09 13:30:31 -05:00
Clayton Coleman
2151afe334 Allow kubectl get to fetch multiple resource types
Like Delete, which can now run over multiple types:

    kubectl delete pods,services -l name=foo

Get should be able to span items for label selection

    kubectl get pods,services -l name=foo
2015-01-09 13:30:14 -05:00
Clayton Coleman
8a4f225941 Make expandResourceShortcuts part of RESTMapper on client 2015-01-09 11:59:11 -05:00
Clayton Coleman
a1ee782df5 Use resource package, delete older code 2015-01-09 11:59:11 -05:00
Clayton Coleman
158f322301 Use preferred resource version 2014-12-22 14:46:31 -05:00
Clayton Coleman
8bef68d475 RESTMapper should take into account multiple versions
When a CLI command `kubectl get rc --api-version=v1beta3` is called,
the API resource name should match v1beta3, not whatever the default
RESTMapper version is.  This allows the correct resource name to be
returned ("replicationcontrollers", instead of "replicationControllers").
2014-12-22 14:46:31 -05:00
Salvatore Dario MINONNE
61ac2f7437 kubectl delete command: adding labelSelector
Add a Visitor pattern on top of ResourcesFromArgs

Allows ResourcesFromArgs to return an opaque list of items and have client
commands react to them.

Change request.go to return apiserver errors for arbitrary status codes to
better respond to generic actions that don't make sense (kubectl delete operations foo)
2014-12-17 18:15:03 +00:00
Brendan Burns
c29f5db81c Revert "Revert "Add optional validation to kubecfg/kubectl.""
This reverts commit 6590c66dd4.
2014-12-09 12:37:48 -08:00
Michal Fojtik
17e24aed47 Export GetKubeNamespace function from kubectl 2014-12-03 13:15:48 +01:00
Eric Tune
585afa1bae Merge pull request #2610 from ddysher/node-namespace
Fix node namespace.
2014-11-26 13:02:21 -08:00
Joe Beda
6590c66dd4 Revert "Add optional validation to kubecfg/kubectl."
This reverts commit acf6d82800.
2014-11-25 14:45:00 -08:00
Deyuan Deng
c8c7a13ac6 Fix node namespace. 2014-11-25 16:30:55 -05:00
Brendan Burns
acf6d82800 Add optional validation to kubecfg/kubectl. 2014-11-24 22:25:22 -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
Haney Maxwell
bc29903146 Improve kubectl "get" error message
Previous behavior:
$ kubectl get hosts
F1119 11:47:44.787154   29017 resource.go:111] no resource "hosts" has been defined
2014-11-19 14:33:41 -08:00
fabianofranz
c43637b73c Extract several kubectl helpers from cmd/cmd.go 2014-11-10 15:09:32 -02:00
Daniel Smith
0b924ed9d9 Add events to kubectl (still need search function) 2014-11-05 13:59:32 -08:00
Clayton Coleman
e46adc4cd0 kubectl should error when namespace doesn't match file for update
A user who runs `kubectl update -f foo.json` where foo.json is a
resource in a namespace that does not match $(kubectl namespace)
may not intend to update the resource in that other namespace.

For now, return an error when the user does not explicitly set
the namespace via the CLI:

    # foo.json in 'one', current is 'two'
    $ kubectl update -f foo.json # FAILS

    $ kubectl update --namespace=one -f foo.json # SUCCEEDS
2014-11-04 10:44:56 -05:00
Clayton Coleman
09cfa364c5 Refactor Get and Describe to allow extension of types
Get should use ResourceMapper, allow Printer to be abstracted,
and extract Describe as *Describer types.
2014-11-04 10:44:56 -05:00
Clayton Coleman
39882a3555 Allow Create/Update/Delete kubectl commands to handle arbitrary objects
* Ensure kubectl uses abstractions from other parts of Kube
* Begin adding abstractions that allow arbitrary objects
* Refactor "update" to more closely match allowed behavior
2014-11-04 10:44:56 -05:00