Commit Graph

818 Commits (90c09c75d67831ad46cc0c9abb954b6936ca86b3)

Author SHA1 Message Date
Brendan Burns d9d06f6680 Add some checking for the presence of the same key twice. 2016-10-13 21:58:44 -07:00
AdoHe 593d8e0d7c refactor Factory make it interface 2016-10-13 20:57:14 +08:00
AdoHe 219006a277 kubectl get print filter info use verbose 2016-10-11 20:53:30 +08:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
Kubernetes Submit Queue 05192d9d57 Merge pull request #33319 from juanvallejo/jvallejo/add-option-to-set-nodeport
Automatic merge from submit-queue

Add option to set a service nodeport

**Release note**:
```release-note
Add kubectl --node-port option for specifying the service nodeport
```

This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
# create a nodeport service with an invalid port
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

# create a nodeport service with a valid port
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

# create a nodeport service with a port already in use
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid value: 3000: provided port is already allocated

$ kubectl describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```

@fabianofranz
2016-10-05 15:00:32 -07:00
Kubernetes Submit Queue d4088fc47b Merge pull request #34020 from juanvallejo/jvallejo/allow-empty-annotation-values
Automatic merge from submit-queue

Allow empty annotation values

Related downstream issue: https://github.com/openshift/origin/issues/11175

**Release note**:
```release-note
release-note-none
```

Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```

@fabianofranz @liggitt
2016-10-05 11:48:02 -07:00
juanvallejo a872657371
Allow empty annotation values
Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```
2016-10-05 13:17:08 -04:00
Kubernetes Submit Queue 33103e576e Merge pull request #33639 from guangxuli/k8s_test_helper
Automatic merge from submit-queue

if test succ remove the tmp file
2016-10-05 01:56:18 -07:00
juanvallejo 7d1461be8e remove unused GetFlagInt32 func 2016-10-04 13:19:24 -04:00
juanvallejo 6b83f89d47 Add option to set a service nodeport
This patch adds the option to set a nodeport when creating a NodePort
service. In case of a port allocation error due to a specified port
being out of the valid range, the error now includes the valid
range. If a `--node-port` value is not specified, it defaults to zero, in
which case the allocator will default to its current behavior of
assigning an available port.

This patch also adds a new helper function in `cmd/util/helpers.go` to
retrieve `Int32` cobra flags.

**Example**
```
$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=1
The Service "mynodeport" is invalid: spec.ports[0].nodePort: Invalid
value: 1: provided port is not in the valid range. Valid ports range
from 30000-32767

$ kubectl create service nodeport mynodeport --tcp=8080:7777 --node-port=30000
service "mynodeport" created

$ oc describe service mynodeport
Name:                   mynodeport
Namespace:              default
Labels:                 app=mynodeport
Selector:               app=mynodeport
Type:                   NodePort
IP:                     172.30.81.254
Port:                   8080-7777       8080/TCP
NodePort:               8080-7777       30000/TCP
Endpoints:              <none>
Session Affinity:       None
No events.
```
2016-10-04 13:19:24 -04:00
Ilya Dmitrichenko abc0a98d25
Replace references to http://releases.k8s.io/HEAD/docs/user-guide/ 2016-10-02 11:44:40 +01:00
juanvallejo 0988f967f0 add check to NewCmdExec before printing suggestion
checks that the "describe" command and a parent command path exist
before printing suggestion to use the describe command to list
containers in a pod.
2016-09-28 18:02:33 -04:00
guangxuli 010bca6323 if test succ remove the tmp file 2016-09-28 16:52:55 +08:00
Kubernetes Submit Queue 8ce107cbff Merge pull request #33263 from wu8685/flag_string_array
Automatic merge from submit-queue

Update godep for github.com/spf13/pflag and replace StringSlice with String Array in configMap

Update godep for pkg `github.com/spf13/pflag`, because the new flag type `StringArray` within it is needed in issue #27454
2016-09-28 00:20:43 -07:00
wu8685 f4a95ff3d9 fix issue #27454: replace flag type StringSlice with StringArray in configMap 2016-09-27 19:21:46 +08:00
Kubernetes Submit Queue 4d9581345e Merge pull request #32449 from smarterclayton/defend_get
Automatic merge from submit-queue

Unwrap aggregates of size 1 when writing errors

Our special error logic was being defeated by aggregates.

Also, only use aggregate in get when we actually are dealing with
multiple errors.

@kubernetes/kubectl

For other kubectl reviewers - no one should use an aggregate unless you are ranging over a list, and even then ask yourself whether you really care about returning all errors.
2016-09-27 03:09:00 -07:00
Kubernetes Submit Queue ea688f5e44 Merge pull request #31276 from juanvallejo/jvallejo_update-dry-run-create
Automatic merge from submit-queue

Update kubectl create message when using --dry-run

`kubectl create <resource> <name> --dry-run` provides a misleading success
message.

When commands such as `kubectl new-app node` are run with a
`--dry-run` flag, they make this clear by appending a "(DRY RUN)"
string to the final output. `kubectl create <resource>  <name> --dry-run`
does not do this, providing a potentially misleading output.

This patch appends a "(DRY RUN)" string to the end of a successful
message of `kubectl create` subcommands that support the `--dry-run` flag.

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created
```

`kubectl create quota quota --dry-run`
```
resourcequota "quota" created (DRY RUN)
```

**Release note**:
```release-note
release-note-none
```
2016-09-26 16:01:17 -07:00
Clayton Coleman 9bfa63dbba
Unwrap aggregates of size 1 when writing errors
Also, only use aggregate in get when we actually are dealing with
multiple errors.
2016-09-26 15:56:38 -04:00
Kubernetes Submit Queue b95fa62fe1 Merge pull request #31163 from juanvallejo/jvallejo_filter-resources-before-printing
Automatic merge from submit-queue

add resource filter handling before printing

**Release note**:
```release-note
release-note-none
```

Resources are currently filtered (in order to prevent printing) at print
time in their HumanReadablePrinter handlers. This design makes it not
possible to filter objects when they are printed using any other
printer, such as YAML, JSON, or the NamePrinter.

This patch removes any filters previously added at the printer level for
pods and adds a way to define resource-specific filters before they are
sent to a printer handler. A woking filter handler for pods has also been
implemented.

Filters affect resources being printed through the HumanReadablePrinter,
YAML, JSON, and `--template` printers.

cc @smarterclayton
2016-09-23 10:45:57 -07:00
juanvallejo 7000e2cf4f
add resource handling before printing
Resources are currently filtered (in order to prevent printing) at print
time in their HumanReadablePrinter handlers. This design makes it not
possible to filter objects when they are printed using any other
printer, such as YAML, JSON, or the NamePrinter.

This patch removes any filters previously added at the printer level for
pods and adds a way to define resource-specific filters before they are
sent to a printer handler. A woking filter handler for pods has also
been
implemented.

Filters affect resources being printed through the HumanReadablePrinter,
YAML, JSON, and `--template` printers.
2016-09-21 10:03:59 -04:00
deads2k e9c1b87b80 move extensions registry packages 2016-09-21 09:14:38 -04:00
Kubernetes Submit Queue 313ef63993 Merge pull request #32680 from sttts/sttts-gracefully-kubectl-without-version
Automatic merge from submit-queue

Behave gracefully in kubectl if /version returns 404

Fixes https://github.com/kubernetes/kubernetes/issues/32679. 

It's only about caching the swagger spec here. So it's safe to fall back to non-caching mode and continue.
2016-09-21 04:59:16 -07:00
Clayton Coleman 07f079216e
Make clientcmd defaulting a function of ConfigOverrides and LoadingRules
This commit moves away from using a global variable for default
configuration checking, and instead exposes a method on LoadingRules to
determine whether a particular restclient.Config should be considered
"default". This allows kubectl to provide its own defaults (the same
as before, KUBERNETES_MASTER and the static localhost:8080 values) while
allowing other clients to avoid defining them.

In-cluster config defaulting is now easier to read.
2016-09-21 01:28:06 -04:00
Kubernetes Submit Queue c97246247a Merge pull request #30199 from dims/re-add-roadmap-extend-all
Automatic merge from submit-queue

Extend all to more resources

Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Update the devel/kubectl-conventions.md with the rules mentioned by
a few folks on which resources could be added to the special 'all' alias
2016-09-20 01:49:45 -07:00
Kubernetes Submit Queue 8d0518d4d2 Merge pull request #32897 from deads2k/api-07-remove-dead-mapper
Automatic merge from submit-queue

remove dead mapper

Removing a write-only field I found looking at the registration code.
2016-09-19 23:12:06 -07:00
Kubernetes Submit Queue 2941069307 Merge pull request #32894 from deads2k/cli-01-remove-arg
Automatic merge from submit-queue

make --include-extended-apis deprecated and remove plumbing

Marks a dead CLI parameter as deprecated and removes the plumbing for it.
2016-09-19 21:11:04 -07:00
Davanum Srinivas e1373cf516 Extend all to more resources
Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Update the devel/kubectl-conventions.md with the rules mentioned by
a few folks on which resources could be added to the special 'all' alias
2016-09-19 13:01:59 -04:00
deads2k 4aa61ddcb2 remove dead mapper 2016-09-19 09:57:19 -04:00
Yanqiang Miao ed3b3ad47d delete a unused function in the 'pkg/kubectl/cmd/util/helpers.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2016-09-17 12:43:59 +08:00
Kubernetes Submit Queue 051ee17094 Merge pull request #30815 from ymqytw/refactoring
Automatic merge from submit-queue

Fixes #30562: Refactor kubectl command options to use common struct for common file params

Fixes #30562 : Refactor common go struct options in pkg/kubectl/cmd/*.go.
@pwittrock
2016-09-16 19:48:22 -07:00
deads2k 862415aaa2 make --include-extended-apis deprecated and remove plumbing 2016-09-16 16:05:52 -04:00
Kubernetes Submit Queue 27c093ea90 Merge pull request #32048 from smarterclayton/consistent_errors
Automatic merge from submit-queue

Handle Stream() errors consistently in restclient

We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.

Related to #32009 but isn't the fix (so far)
2016-09-15 20:13:48 -07:00
deads2k 771915c6c4 make shortcut expanding restmapper handle all 2016-09-15 11:03:51 -04:00
deads2k 4359c79f53 add FirstHitRESTMapper for adding thirdparty resources 2016-09-15 10:26:39 -04:00
deads2k 500cddc5c3 use discovery restmapper for kubectl 2016-09-15 10:26:39 -04:00
juanvallejo 52fc8efa55 update PrintSuccess message when using --dry-run 2016-09-15 10:11:21 -04:00
Dr. Stefan Schimanski 54f5a9b423 Disable swagger spec caching without /version 2016-09-14 18:44:46 +02:00
Kubernetes Submit Queue 630c7532c6 Merge pull request #32274 from ping035627/ping035627-patch-0908
Automatic merge from submit-queue

Change all jsonmerge to strategicpatch

Implement all jsonmerge changed to strategicpatch in edit.go.
2016-09-13 01:15:52 -07:00
ymqytw c67a62da49 Fixes #30562: Refactor kubectl command options to use common struct for common file params 2016-09-12 11:01:37 -07:00
deads2k 519c13745f convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04:00
deads2k f756e43e7f convert rolling updater to generated client 2016-09-12 07:38:34 -04:00
deads2k 9d43f7e52c convert more command to use a generated clientset 2016-09-12 07:38:34 -04:00
Kubernetes Submit Queue 27c5e5dca7 Merge pull request #31110 from AdoHe/rollout_dry_run
Automatic merge from submit-queue

Rollout dry run

**What this PR does / why we need it**: rollout undo add dry-run implementation

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #28219

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```
rollout undo add dry-run option
```
2016-09-11 15:05:16 -07:00
Kubernetes Submit Queue 099d47f0eb Merge pull request #31089 from ping035627/ping035627-patch-0822
Automatic merge from submit-queue

Optimise the DefaultGenerators function

It needn't define all the generators in the "DefaultGenerators" function, it just return the "cmdName" generator, the others is redundant.
2016-09-10 07:43:02 -07:00
Kubernetes Submit Queue 97ec720a19 Merge pull request #32152 from deads2k/client-02-make-clientset
Automatic merge from submit-queue

add ClientSet to factory to remove non-generated client

We should move to using generated clients in the `kubectl` client.  We should really move to generated external clients, but this at least moves away from using manually created clients.

@fabianofranz @mfojtik When I complete this work (move the other commands and eliminate the old API), this will ripple downstream.
2016-09-10 01:59:02 -07:00
Kubernetes Submit Queue 8b5317bf87 Merge pull request #32141 from deads2k/client-01-fix-swagger
Automatic merge from submit-queue

make swaggerschema agnostic about which version to use

`Factory.SwaggerSchema` was reliant on having a non-generated client bits filled in so that it could get the adapted client it wanted.  There's no need since discovery ignores configured GroupVersions.  This eliminates the unneeded dependency.
2016-09-09 22:27:52 -07:00
PingWang 121f6fb289 change all jsonmerge to strategicpatch
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

update preconditions define

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-09-09 08:28:10 +08:00
AdoHe 6a68dbdac4 rollout undo add dry-run implementation 2016-09-08 08:02:04 +08:00
deads2k 1d5e5532ed add ClientSet to factory to remove non-generated client 2016-09-07 09:44:01 -04:00
deads2k aee962c0f2 make swaggerschema agnostic about which version to use 2016-09-06 14:16:02 -04:00
deads2k cd5b6cc491 move StorageClass to its own group 2016-09-06 08:41:17 -04:00
Clayton Coleman 5e6f5fee8a
Handle Stream() errors consistently in restclient
We should be following the same rules for Stream() as the normal body
request flow.

Also add slightly more output on a server error - in the future we may
want to clean this up but it's potentially hiding bad responses.
2016-09-04 14:50:04 -04:00
Clayton Coleman 06cbb29e9e
ClientConfig should not default to http://localhost:8080
This changes clientcmd to skip the default cluster, but preserves the
behavior in kubectl. This prevents the possibility of an administrator
misconfiguration in kubelet or other server component from allowing a
third party who can bind to 8080 on that host from potentially
impersonating an API server and gaining root access.
2016-08-30 10:43:24 -04:00
Kubernetes Submit Queue 2fe56d4bb3 Merge pull request #30863 from ping035627/ping035627-patch-0818
Automatic merge from submit-queue

Optimise the ValidateBytes function

The PR optimise the "ValidateBytes" function in factory.go. Too much "if" branches is poor readability, use "switch" to look better.
2016-08-23 23:59:00 -07:00
Kubernetes Submit Queue 5b5a4145da Merge pull request #30821 from ardnaxelarak/21076_change_isEmpty_to_Empty
Automatic merge from submit-queue

Rename IsEmpty to Empty

addresses #21076
2016-08-22 00:54:28 -07:00
PingWang 0926f7d3f1 Optimise the DefaultGenerators function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-22 10:43:15 +08:00
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
bindata-mockuser 6dcb0c9130 Rectify kubectl error output 2016-08-20 15:58:10 +02:00
Kubernetes Submit Queue 3c65fdc752 Merge pull request #30313 from juanvallejo/jvallejo_kube-remove-duplicate-error-msgs
Automatic merge from submit-queue

remove duplicate errors from aggregate error outputs

release-label-none

Duplicate error messages are sometimes shown when displaying aggregate errors:

`$ kubectl label pod/database-1-fn0r7 qwer1345%$$#=self`
```
* metadata.labels: Invalid value: "qwer1345%5602#": name part must match the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or 'my.name' or '123-abc')
* metadata.labels: Invalid value: "qwer1345%5602#": name part must match the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or 'my.name' or '123-abc')
* metadata.labels: Invalid value: "qwer1345%5602#": name part must match the regex ([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9] (e.g. 'MyName' or 'my.name' or '123-abc')
```

This patch removes any duplicate messages (adjacent or not) that appear in the final list of errors.
2016-08-20 02:18:46 -07:00
Kara Alexandra d12a66a422 Rename IsEmpty to Empty
Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-19 14:19:19 -07:00
PingWang cd158938b9 Optimise the ValidateBytes function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-08-18 19:23:10 +08:00
juanvallejo 4b18f52fc9 add unit test for duplicate errors 2016-08-16 13:09:55 -04:00
juanvallejo 6e7df2c986 remove duplicate errors from aggregate error outputs 2016-08-16 13:09:52 -04:00
Kris 63a512fe47 Add discovery mapper and dynamic typer to kubectl 2016-08-15 22:07:54 -07:00
Kubernetes Submit Queue 6f20321833 Merge pull request #28509 from juanvallejo/jvallejo_update-human-readable-printer-signature
Automatic merge from submit-queue

Update HumanResourcePrinter signature w single PrintOptions param

release-note-none

- Makes [HumanReadablePrinter options field non-exported again](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/resource_printer.go#L346-349)
- Adds test-case for HumanReadablePrinter resource printing with aliases.
- Better formatting for saving resource "kind" aliases

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/28509)
<!-- Reviewable:end -->
2016-08-12 07:27:56 -07:00
lixiaobing10051267 254189a5f2 check validation with no apps client in kubectl util factory 2016-08-10 21:20:50 +08:00
Angus Salkeld bd0b7528b5 Add "create deployment" sub-command 2016-08-08 13:24:30 +10:00
Angus Salkeld 42ca885edb Add "create service" sub-commands
This adds:
 create service clusterip
 create service nodeport
 create service loadbalancer
2016-08-08 12:31:21 +10:00
lixiaobing10051267 11f5ced9d3 Wrong format is used with single quotes in log 2016-08-05 15:23:23 +08:00
Kubernetes Submit Queue 7921a9ce67 Merge pull request #25816 from soltysh/scheduledjob_kubectl
Automatic merge from submit-queue

ScheduledJob kubectl

@erictune the last part (kubectl) of the ScheduledJob, as usual builds on top of previous PRs, so only last 2 commits matter (the kubectl one and storage leftovers).

```release-note
* Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature).
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-08-04 17:36:07 -07:00
juanvallejo 620758c7e9 format resource printing with aliases 2016-08-04 12:01:25 -04:00
Maciej Szulik b5c68a9015 ScheduledJob kubectl changes 2016-08-03 17:25:37 +02:00
Andrey Kurilin 91cace347d Fix various typos in kubectl 2016-08-02 19:51:51 +03:00
k8s-merge-robot 0fbd60fa30 Merge pull request #29187 from soltysh/multiversion_kubectl
Automatic merge from submit-queue

Create client from API version passed in config or use default

When creating a client read the `GroupVersion` value passed in the `restclient.Config`. If the passed `GroupVersion` does not match current group or is not enabled fallback to default `GroupVersion` for that group.

This PR should allow accessing `ScheduledJob` properly in `batch/v2alpha1`.

@smarterclayton @deads2k @caesarxuchao @lavalamp ptal
2016-08-02 06:10:26 -07:00
Daniel Smith b712bfd7ac Revert "Extend all to more resources" 2016-08-01 21:51:57 -07:00
k8s-merge-robot 95b4572e7c Merge pull request #28955 from dims/roadmap-extend-all
Automatic merge from submit-queue

Extend all to more resources

Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Note, did not add events as it did not seem useful to me. Since
this is just a list of messages generated by the system.

Related to a suggestion in issue #22337
2016-08-01 10:07:01 -07:00
Maciej Szulik 1e496fd8ce Create client from API version passed in config or use default
When creating a client read the GroupVersion value passed in the
restclient.Config. If the passed GroupVersion does not match current
group or is not enabled fallback to default GroupVersion for that group.
2016-07-26 11:54:25 +02:00
maaz khan 5b95524d65 Add support for kubectl create quota command 2016-07-26 11:32:08 +02:00
Davanum Srinivas ccf4e4d61e Extend all to more resources
Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Update the devel/kubectl-conventions.md with the rules mentioned by
a few folks on which resources could be added to the special 'all' alias

Related to a suggestion in issue #22337
2016-07-24 21:14:50 -04:00
Wojciech Tyczynski 4d0d115690 Revert "add tokenreviews endpoint to implement webhook" 2016-07-21 09:40:35 +02:00
deads2k 2c4a9f2e8d interesting changes to add tokenreviews endpoint to implement webhook 2016-07-20 15:11:56 -04:00
Mike Dame cfbf7da75b Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04:00
k8s-merge-robot 423106ccee Merge pull request #28512 from smarterclayton/multirestmapper
Automatic merge from submit-queue

Implement a RESTMappings method

With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.

@deads2k
2016-07-15 05:13:55 -07:00
Ivan Shvedunov 5ed881c6c4 Refactor Printer arguments
Fixes #21260
2016-07-14 16:23:02 +03:00
Clayton Coleman c077bac341
Implement a RESTMappings method
With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.
2016-07-13 21:18:53 -04:00
k8s-merge-robot af1891ca03 Merge pull request #28531 from dims/fix-issues-28314
Automatic merge from submit-queue

Add custom-columns and custom-template-file to --help text
2016-07-13 06:09:25 -07:00
k8s-merge-robot 30c43e63af Merge pull request #26696 from gitfred/no-header-custom-column
Automatic merge from submit-queue

--no-header available now for custom-column

Change `CustomColumnsPrinter` to have `noHeader` boolean, also changed `GetPrinter` to receive this bool and pass it through.
One test `TestNewColumnPrinterFromSpecWithNoHeaders` added for checking if there is no headers in output for sure

fixes #24133
2016-07-11 16:11:23 -07:00
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
Sylwester Brzeczkowski 19434e1b58 24133 fix: --no-headers works with custom columns now 2016-07-07 10:04:09 +02:00
Davanum Srinivas 09fee66783
Add custom-columns and custom-template-file to --help text
Fixes #28314
2016-07-06 09:02:50 -04:00
Angus Salkeld e0ce987f4e Add command "kubectl config get-contexts"
Note: Context is not a runtime object (doesn't have Kind and Version) so
      we can't use the resource_printer
2016-07-05 11:24:00 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 32eccd413f Merge pull request #25562 from gtank/certificates-api-v9
Automatic merge from submit-queue

TLS bootstrap API group (alpha)

This PR only covers the new types and related client/storage code- the vast majority of the line count is codegen. The implementation differs slightly from the current proposal document based on discussions in design thread (#20439). The controller logic and kubelet support mentioned in the proposal are forthcoming in separate requests.

I submit that #18762 ("Creating a new API group is really hard") is, if anything, understating it. I've tried to structure the commits to illustrate the process.

@mikedanese @erictune @smarterclayton @deads2k

```release-note-experimental
An alpha implementation of the the TLS bootstrap API described in docs/proposals/kubelet-tls-bootstrap.md.
```

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-28 13:25:22 -07:00
George Tankersley 34506faf97 kubectl: add certificates group 2016-06-28 12:05:40 -07:00
k8s-merge-robot e32b871637 Merge pull request #26771 from kargakis/use-pod-namespacer
Automatic merge from submit-queue

kubectl: fix sort logic for logs

@kubernetes/kubectl
2016-06-27 21:33:59 -07:00
k8s-merge-robot 81c8fe37e6 Merge pull request #26598 from janetkuo/3rd-party-error-logs
Automatic merge from submit-queue

Add more information when throwing errors in discoverying 3rd party resources

#26425


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-25 09:25:58 -07:00
k8s-merge-robot 99951007ff Merge pull request #26539 from ripcurld00d/fix_json_template_url
Automatic merge from submit-queue

Update the jsonpath template URL

It seems like http://releases.k8s.io/HEAD/docs/user-guide/jsonpath.md redirects to http://kubernetes.io/docs/user-guide/jsonpath/.

Therefore, updating to the new URL where is required.

Relate to https://github.com/openshift/origin/pull/9013
2016-06-25 08:17:31 -07:00
Mike Metral 6b172657b0 clarify recursive flag description 2016-06-17 08:35:44 -07:00
Boaz Shuster d6f69c0f22 Update the jsonpath template URL 2016-06-10 12:22:36 +03:00
Piotr Szczesniak 1818b5b3fc Added hpa/v1 generator to kubectl autoscale 2016-06-10 09:26:35 +02:00
Michail Kargakis 886014b1a3 kubectl: fix sort logic for logs
Use a separate sorting algorithm for kubectl logs that sorts from older
to newer instead of the other way that ActivePods is doing.
2016-06-07 10:52:42 +02:00
k8s-merge-robot 421c16addd Merge pull request #25894 from brendandburns/thirdparty-watch
Automatic merge from submit-queue

Fix third party

Fixes https://github.com/kubernetes/kubernetes/issues/25421
Fixes https://github.com/kubernetes/kubernetes/issues/25422

@AdoHe @sjenning @caesarxuchao @lavalamp 

@kubernetes/sig-api-machinery 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-04 15:42:41 -07:00
Brendan Burns 328a8392b1 Fix third party 2016-06-02 10:24:14 -07:00
Janet Kuo 4615d1e24c Add more information when throwing errors in discoverying 3rd party resources 2016-06-01 13:18:50 -07:00
k8s-merge-robot 0a6a52b19d Merge pull request #26597 from caesarxuchao/fix-26425
Automatic merge from submit-queue

retry GetThirdPartyGroupVersions

GetThirdPartyGroupVersions() may return a "NotFound" error if a thirdparty group is deleted in the interim between the group-discovery and the resource-discovery. This is causing e2e flakes in all tests that run kubectl, because test/e2e/thirdparty.go is creating/deleting thirdparty groups.

Fix #26425

The e2e flakes will have the following pattern:
1. the test is calling kubectl
2. error message is `Error from server: the server could not find the requested resource`
3. in the apiserver log, you should see `GET /apis/company.com/v1: (518.944µs) 404 [[kubectl/v1.3.0 (linux/amd64) kubernetes/ae28564] 104.154.110.118:46043]`

For detail see [here](https://github.com/kubernetes/kubernetes/issues/26425#issuecomment-222844523)

cc @janetkuo @brendanburns
2016-06-01 00:02:43 -07:00
Chao Xu 7cea7ccd8d retry GetThirdPartyGroupVersions 2016-05-31 17:14:24 -07:00
Piotr Szczesniak 22dc21d703 Removed metrics api group 2016-05-31 09:48:39 +02:00
k8s-merge-robot 6a234a2cc2 Merge pull request #24882 from brendandburns/3rdparty
Automatic merge from submit-queue

Add support for 3rd party objects to kubectl label

Fixes https://github.com/kubernetes/kubernetes/issues/24583

@kubernetes/rh-ux
2016-05-30 07:24:51 -07:00
Michail Kargakis 3cbb6b0104 kubectl: move printObjectSpecificMessage in factory 2016-05-28 18:33:58 +02:00
k8s-merge-robot e543bd6452 Merge pull request #26007 from smarterclayton/watch_opt
Automatic merge from submit-queue

Additional optimizations to the encode/decode paths

Builds on top of #25983 with a number of other optimizations.
2016-05-28 06:27:00 -07:00
Eric Chiang 323e804f39 add rbac for tests and kubectl 2016-05-25 14:25:56 -07:00
Brendan Burns dac09311b8 Add support for labelling 3rd party objects 2016-05-23 13:13:35 -07:00
k8s-merge-robot 39f0c6ba25 Merge pull request #24719 from bprashanth/kubectl_tls
Automatic merge from submit-queue

Add a kubectl create secret tls command

A somewhat hasty implementation that enables progress along: https://github.com/kubernetes/kubernetes/issues/20176#issuecomment-177409516, https://github.com/kubernetes/kubernetes/issues/24669, https://github.com/kubernetes/kubernetes/issues/20176#issuecomment-198142836 if associated parties have spare cycles. @kubernetes/kubectl

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24719)
<!-- Reviewable:end -->
2016-05-22 09:40:42 -07:00
Clayton Coleman c6961d6fd6
Remove runtime.Typer, reduce to ObjectKinds(1) (3)
Remove the unnecessary variants, which avoids allocations in several
core paths.
2016-05-21 23:55:42 -04:00
Janet Kuo 4332472bde Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
Prashanth Balasubramanian daa8e29c5b Add a kubectl create secret tls command 2016-05-16 22:38:56 -07:00
jianhuiz 6f8fc60d06 describe for clusters 2016-05-16 16:34:08 -07:00
jianhuiz 586eea0691 add get/create/delete for clusters 2016-05-16 16:34:08 -07:00
k8s-merge-robot b8f1682695 Merge pull request #24090 from AdoHe/expose_rc
Automatic merge from submit-queue

fix expose multi protocols issue

Please refer #23882 for more detail. @bprashanth @bgrant0607 ptal.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24090)
<!-- Reviewable:end -->
2016-05-14 07:15:58 -07:00
Matt Liggett f5e8d41431 Finish implementing policy API.
Registry implementation and addition to the master.
2016-05-13 17:27:58 -07:00
k8s-merge-robot 0c2641d4ea Merge pull request #19946 from janetkuo/kubectl-rollout-status
Automatic merge from submit-queue

Add `kubectl rollout status`

## Pull Request Guidelines

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
1. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
1. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.

```release-note
Implement `kubectl rollout status` that can be used to watch a deployment's rollout status
```

Addresses #17168; depends on #19882 (the "Add kubectl rollout" commit).
See [proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/deploy.md#deployment-version). 

cc @bgrant0607 @nikhiljindal @ironcladlou @kargakis @kubernetes/sig-config @kubernetes/kubectl  @madhusudancs

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/19946)
<!-- Reviewable:end -->
2016-05-12 06:28:49 -07:00
Wojciech Tyczynski 2706df102b Merge pull request #25465 from wojtek-t/client_renegotiation
Support renegotiation in client based on response ContentType
2016-05-12 10:21:10 +02:00
Wojciech Tyczynski 5d046fed41 Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
AdoHe ad97cddb3e fix expose multi protocols issue 2016-05-12 00:07:07 -04:00
k8s-merge-robot ac50a70992 Merge pull request #25459 from errm/misspell
Automatic merge from submit-queue

Corrects some misspellings in comments

This should help to make
https://goreportcard.com/report/k8s.io/kubernetes#misspell
look a little nicer.
2016-05-11 19:18:30 -07:00
Ed Robinson afdbad078a
Corrects some misspellings in comments
This should help to make
https://goreportcard.com/report/k8s.io/kubernetes#misspell
look a little nicer.
2016-05-11 08:16:13 +01:00
Janet Kuo 67becccda0 Add kubectl rollout status 2016-05-10 13:49:39 -07:00
Phillip Wittrock 680b2b9d09 Kubectl support for validating nested objects with different ApiGroups (e.g. Lists containing objects in different api groups). Closes #24089 2016-05-09 19:38:40 -07:00
k8s-merge-robot 601e09852c Merge pull request #23590 from kargakis/timeout-logs-attach
Automatic merge from submit-queue

kubectl: more sophisticated pod selection for logs and attach

Trying to get the logs or attach to an object other than a pod
will poll forever if that object has no replicas. This commit adds
a 20s timeout for polling.

@kubernetes/kubectl @deads2k @fabianofranz
2016-05-08 10:51:00 -07:00
Robert Bailey 76912008b4 Merge pull request #25035 from kargakis/remove-dead-factory-code
kubectl: remove dead factory code
2016-05-06 14:12:26 -07:00
k8s-merge-robot c66250dd0d Merge pull request #24548 from pwittrock/kubectl
Automatic merge from submit-queue

Delete unused helpers
2016-05-03 11:26:25 -07:00
Michail Kargakis a25088fe15 kubectl: more sophisticated pod selection for logs and attach 2016-05-02 15:56:36 +02:00
Michail Kargakis dbc1e356d3 kubectl: remove dead factory code 2016-05-02 11:03:44 +02:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
k8s-merge-robot ae5065a2c2 Merge pull request #24365 from janetkuo/remove-t-for-tty
Automatic merge from submit-queue

Add flag -t as shorthand for --tty

`-t` was deprecated in #12813 (Aug. 2015, about 6+ months ago). 

Now remove `--template`'s shorthand `-t` and create a shorthand `-t` for `--tty` in `kubectl run`. 

@kubernetes/kubectl
2016-04-28 00:23:11 -07:00
Maciej Szulik a3b4447305 Move internal types of job from pkg/apis/extensions to pkg/apis/batch 2016-04-25 11:03:54 +02:00
Prashanth Balasubramanian 0ac10c6cc2 PetSet type, apps apigroup 2016-04-20 18:49:31 -07:00
Phillip Wittrock 1a3b133077 Delete unused helpers 2016-04-20 13:49:59 -07:00
Janet Kuo aa2ac9b1d1 -t shorthand for --tty instead of --template 2016-04-15 17:12:42 -07:00
k8s-merge-robot acf9492cb1 Merge pull request #23660 from goltermann/vetclean
Automatic merge from submit-queue

Additional go vet fixes

Mostly:
- pass lock by value
- bad syntax for struct tag value
- example functions not formatted properly
2016-04-12 06:22:16 -07:00
goltermann 696423e044 Vet fixes, mostly pass lock by value errors. 2016-04-06 11:27:40 -07:00
k8s-merge-robot f5c93c8ddc Merge pull request #23472 from wojtek-t/fix_object_meta_for
Automatic merge from submit-queue

Switch from api.ObjectMetaFor to meta.Accessor in most of places

Fix #23278

@smarterclayton @lavalamp
2016-04-02 02:33:40 -07:00
Fabiano Franz 9ddacfa25f Mark filename flags for completions 2016-04-01 16:14:36 -03:00
Brendan Burns be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
Wojciech Tyczynski 2699be2e7e Switch api.ObjetaMetaFor to meta.Accessor 2016-03-31 17:52:31 +02:00
Mike Metral 7403878ac0 allow kubectl cmd to process dirs recursively
reqs:
    - the kubectl cmd must support the -f | --filename flag
    - the kubectl cmd must support visiting a dir one level deep,
    or using more than one resource
2016-03-28 12:44:21 -07:00
k8s-merge-robot 76369c42be Merge pull request #22939 from resouer/util-sub-dir
Auto commit by PR queue bot
2016-03-23 03:34:33 -07:00
Clayton Coleman 3a29e3971b Improve terminal reuse and attach
Currently attach and the editor do not share the same logic for saving
and restoring the terminal, and are not suitable for nesting (when the
caller wants to create something, attach, and then delete something when
the attach is over).  This commit moves the interrupt protection logic
to a util package and supports nesting interrupt handlers.
2016-03-21 23:59:58 -04:00
k8s-merge-robot 41c85d1113 Merge pull request #22999 from smarterclayton/better_auth_error
Auto commit by PR queue bot
2016-03-16 09:59:20 -07:00
Clayton Coleman dccf114fdd Display a better error on unauthorized
Not being logged in is a common user error, and the message we display
can be more specific to an end user. Provide a friendly message with the
server message in parethesis (in case this is a more complex server
error).
2016-03-15 12:51:23 -04:00
Kris 4d404ded1a Moving adapters to their own packages 2016-03-14 14:22:34 -07:00
harry f19d59cf35 Move flag into sub pkg 2016-03-14 21:30:38 +08:00
Jordan Liggitt d008283942 Tolerate multiple registered versions in a single group 2016-03-12 12:49:41 -05:00
nikhiljindal 593b78f925 Deprecating --api-version flag 2016-03-11 10:12:44 -08:00
Madhusudan.C.S dfc62b56cc Enable kubectl autoscale for replica sets.
Also add some tests for it.
2016-03-10 15:05:54 -08:00
Maciej Szulik de83631768 Added job/v1 generator to kubectl run 2016-03-10 19:56:57 +01:00
k8s-merge-robot f046d6c83e Merge pull request #22420 from AdoHe/kubectl_swagger_cache
Auto commit by PR queue bot
2016-03-07 15:18:56 -08:00
AdoHe 893e36c61d fix kubectl swagger cache bug 2016-03-04 18:59:40 -05:00
deads2k f8f45df578 make kubectl logs work for replication controllers 2016-03-03 11:17:50 -05:00
k8s-merge-robot 739285b146 Merge pull request #21265 from stevekuznetsov/skuznets/new-sa
Auto commit by PR queue bot
2016-03-01 01:14:06 -08:00
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
k8s-merge-robot e089e841b1 Merge pull request #21593 from fabianofranz/split_bind_flags
Auto commit by PR queue bot
2016-02-27 16:10:19 -08:00
Steve Kuznetsov e5b696ee43 added 'kubectl create sa' to create serviceaccounts 2016-02-26 10:27:37 -05:00
deads2k 2b84d58b6d add a PriorityRESTMapper that can choose particular group/version of a resource 2016-02-25 07:35:23 -05:00
k8s-merge-robot 95354490c1 Merge pull request #21318 from kargakis/record-command-factory-method-tweak
Auto commit by PR queue bot
2016-02-22 08:11:57 -08:00
Fabiano Franz 59ea2b1e59 Split factory#BindFlags 2016-02-19 20:41:16 -02:00
Eric Tune 175addf2a3 Implemented Batch client 2016-02-19 09:20:56 -08:00
Paul Morie 51a9c2c9ba Add kubectl create configmap 2016-02-18 21:24:21 -05:00
k8s-merge-robot 5acdb92126 Merge pull request #21177 from laushinka/spelling-fixes
Auto commit by PR queue bot
2016-02-18 10:29:49 -08:00
k8s-merge-robot 17325ef6ef Merge pull request #20501 from piosz/hpa-ga
Auto commit by PR queue bot
2016-02-18 06:52:39 -08:00
laushinka 7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
Michail Kargakis 55f402c5a6 kubectl: use the factory properly for recording commands 2016-02-17 12:16:19 +01:00
Piotr Szczesniak d2f11521cb Implemented Autoscaling client 2016-02-15 21:39:00 +01:00
AdoHe 81103a07c2 fix --sort-by help bug 2016-02-14 22:31:13 -05:00
k8s-merge-robot ee33ed2cf5 Merge pull request #20981 from madhusudancs/labelselector-error-string-fix
Auto commit by PR queue bot
2016-02-14 03:14:46 -08:00
k8s-merge-robot 53d9f9ecab Merge pull request #20814 from deads2k/restmapper-errors
Auto commit by PR queue bot
2016-02-13 15:53:22 -08:00
derekwaynecarr 06f26189f0 Update kubectl create subcommand to use printer flags 2016-02-11 15:37:47 -05:00
deads2k deb4d3ccca type RESTMapper errors to better handle MultiRESTMapper errors 2016-02-11 11:45:05 -05:00
Madhusudan.C.S 293793cf0d Allow replica set to be exposed as a service and add kubectl command tests for replica sets. 2016-02-10 16:20:08 -08:00
Madhusudan.C.S 525d7a7732 Fix the label selector to selector conversion error string.
The message as it is framed right now does not make any sense for the
end users of our system. It might even lead to confusion. So this is
attempt to make the error message less confusing.
2016-02-10 09:43:30 -08:00
Madhusudan.C.S ed7ad6dcf3 Make deployments work. 2016-02-08 21:27:49 -08:00
Madhusudan.C.S 518f08aa7c Move Deployments to ReplicaSets and switch the Deployment selector to the new LabelSelector.
Update the Deployments' API types, defaulting code, conversions, helpers
and validation to use ReplicaSets instead of ReplicationControllers and
LabelSelector instead of map[string]string for selectors.

Also update the Deployment controller, registry, kubectl subcommands,
client listers package and e2e tests to use ReplicaSets and
LabelSelector for Deployments.
2016-02-08 21:27:38 -08:00
Clayton Coleman 664d25ba5a Take GVK in SwaggerSchema()
This is needed for the legacy OpenShift API group (oapi) which is also
group: "", version: "v1", but needs to return a different swagger
schema.  Will in the future be replaced by group defaulting.
2016-02-06 21:24:33 -05:00
Daniel Smith f973af25fa Merge pull request #20747 from caesarxuchao/internalclientset
rename release_1_2 to internalclientset
2016-02-05 15:49:08 -08:00
Chao Xu 184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
AdoHe 714d12cf72 kubectl add show-labels flag to make it more readable 2016-02-04 02:08:44 -05:00
k8s-merge-robot 16aa40cc33 Merge pull request #20035 from janetkuo/record-command
Auto commit by PR queue bot
2016-02-03 20:19:08 -08:00
k8s-merge-robot 65ebe19164 Merge pull request #20584 from caesarxuchao/release_1_2
Auto commit by PR queue bot
2016-02-03 19:46:27 -08:00
Chao Xu f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Janet Kuo 5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -08:00
Janet Kuo 442c75045a Add kubectl rollout undo 2016-02-02 14:20:01 -08:00
Michail Kargakis 21c2b836ed kubectl: add rollout pause/resume subcommands 2016-02-02 10:33:55 +01:00
Janet Kuo 8fb86a3d3b Add kubectl rollout history 2016-02-01 15:32:43 -08:00
k8s-merge-robot 9e7a0e2a03 Merge pull request #20053 from smarterclayton/dont_duplicate_prefix
Auto commit by PR queue bot
2016-01-30 04:50:07 -08:00
Clayton Coleman f9c48c864d Don't add 'error: ' to messages if already there 2016-01-23 00:41:36 -05:00
Clayton Coleman 2fd38a7dc0 Break kubectl from assuming details of codecs
Most of the logic related to type and kind retrieval belongs in the
codec, not in the various classes. Make it explicit that the codec
should handle these details.

Factory now returns a universal Decoder and a JSONEncoder to assist code
in kubectl that needs to specifically deal with JSON serialization
(apply, merge, patch, edit, jsonpath). Add comments to indicate the
serialization is explicit in those places. These methods decode to
internal and encode to the preferred API version as previous, although
in the future they may be changed.

React to removing Codec from version interfaces and RESTMapping by
passing it in to all the places that it is needed.
2016-01-22 13:27:26 -05:00
nikhiljindal 2ad642d370 Merge registered and latest and move to apimachinery 2016-01-21 14:42:21 -08:00
Michail Kargakis 08d8843a9c kubectl: Support exposing deployments 2016-01-15 17:02:24 +01:00
k8s-merge-robot 36dc6eab34 Merge pull request #19300 from caesarxuchao/move-SwaggerSchema-to-disocovery
Auto commit by PR queue bot
2016-01-13 23:20:08 -08:00
Chao Xu 6a104ee46c move SwaggerSchema to DiscoveryClient 2016-01-13 10:11:53 -08:00
David Oppenheimer 8ac484793d Comment out calls to httptest.Server.Close() to work around
https://github.com/golang/go/issues/12262 . See #19254 for
more details. This change should be reverted when we upgrade
to Go 1.6.
2016-01-11 23:02:11 -08:00
Matt Liggett c6e9ad066e Initial node drain implementation for #3885.
It cordons (marks unschedulable) the given node, and then deletes every
pod on it, optionally using a grace period.  It will not delete pods
managed by neither a ReplicationController nor a DaemonSet without the
use of --force.

Also add cordon/uncordon, which just toggle node schedulability.
2016-01-06 17:28:18 -08:00
Chao Xu 2b5b708b70 Refactor the API registration and installation 2015-12-23 22:44:25 -08:00
k8s-merge-robot 6815cbf742 Merge pull request #15210 from brendandburns/docs
Auto commit by PR queue bot
2015-12-21 07:58:46 -08:00
k8s-merge-robot 7c43797e61 Merge pull request #17516 from kargakis/tighten-generator-validation
Auto commit by PR queue bot
2015-12-19 18:36:18 -08:00
k8s-merge-robot b12f6b341f Merge pull request #18599 from smarterclayton/abstract_explain
Auto commit by PR queue bot
2015-12-19 04:34:32 -08:00
k8s-merge-robot 3c3a24e1d4 Merge pull request #18694 from thockin/airplane_validation_pt7
Auto commit by PR queue bot
2015-12-19 03:57:53 -08:00
k8s-merge-robot 649855128d Merge pull request #18627 from caesarxuchao/oneline-fix
Auto commit by PR queue bot
2015-12-19 00:50:31 -08:00
Tim Hockin 0fecf965b4 Change how one-of blocks are validated
I took a hard look at error output and played until I was happier.  This now
prints JSON for structs in the error, rather than go's format.

Also made the error message easier to read.

Fixed tests.
2015-12-18 09:42:14 -08:00
Michail Kargakis 71934b7643 kubectl: Validate flag usage against generators
This commit moves the generators into separate buckets and creates
separate calls for each one group. This helps in providing just the
necessary generators to each generator command.

Validation of flags against generators is also added so that flags
that are not meant to be used with a specific generator will result
in error.
2015-12-18 15:09:53 +01:00
Clayton Coleman 151b4e5958 Tweak explain messages and abstract client 2015-12-18 00:27:22 -05:00
Abhishek Shah 6f63875165 Reverting 18442 2015-12-17 16:57:29 -08:00
deads2k 9fda7f1812 update StatusDetails to handle Groups 2015-12-17 09:14:12 -05:00
k8s-merge-robot 5c4479f542 Merge pull request #18442 from deads2k/gv-restmapper-10
Auto commit by PR queue bot
2015-12-17 06:06:43 -08:00
k8s-merge-robot 8ceb947b63 Merge pull request #18346 from soltysh/issue17363
Auto commit by PR queue bot
2015-12-16 21:25:52 -08:00
k8s-merge-robot 5a579a2555 Merge pull request #16028 from derekwaynecarr/make_cmd
Auto commit by PR queue bot
2015-12-16 08:41:59 -08:00
deads2k 41b78ad2b6 find partial resource matches 2015-12-16 10:19:31 -05:00
Chao Xu 5ba4f836f8 some small fix 2015-12-15 12:00:48 -08:00
k8s-merge-robot 3680268c52 Merge pull request #18353 from deads2k/gv-use-constants
Auto commit by PR queue bot
2015-12-15 03:25:09 -08:00
k8s-merge-robot 414ebd2ddb Merge pull request #17991 from krousey/errorstatus
Auto commit by PR queue bot
2015-12-14 20:18:19 -08:00
derekwaynecarr 5e0948586c Add kubectl create [SUBCOMMAND] pattern 2015-12-14 13:43:45 -05:00
deads2k d0aaf13920 use constants for group names 2015-12-14 10:04:10 -05:00
Wojciech Tyczynski 960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
k8s-merge-robot 7e942bf9b3 Merge pull request #18384 from deads2k/gv-clientcache
Auto commit by PR queue bot
2015-12-14 02:25:49 -08:00
k8s-merge-robot 47d2f41680 Merge pull request #18370 from deads2k/gv-interfacesfor
Auto commit by PR queue bot
2015-12-13 10:27:17 -08:00
deads2k ec87d74ecb update InterfacesFor to use GroupVersion 2015-12-11 13:45:41 -05:00
Kris ca7c765f0a Remove APIStatus from the client
Everything that used it also depended on pkg/api/errors. It was a
needless abstraction since it was always an *errors.StatusError.
2015-12-10 13:12:21 -08:00
Tim Hockin 7fb8f60735 Shorten names for better reading 2015-12-10 11:48:19 -08:00
Tim Hockin 87a35047dd Move FieldPath and errors to a sub-package
This makes the naming and reading a lot simpler.
2015-12-10 11:48:16 -08:00
Maciej Szulik 34c72552a5 Updated kubectl help info with resource names 2015-12-10 16:04:44 +01:00
deads2k cf58201ff4 update client cache to key on groupversion 2015-12-10 07:41:34 -05:00
k8s-merge-robot 637a33924c Merge pull request #18004 from jiangyaoguo/print-absolute-time-when-watch-event
Auto commit by PR queue bot
2015-12-08 22:58:12 -08:00
deads2k 2ee3dfe415 update testapi to eliminate redundant fields 2015-12-07 15:54:26 -05:00
k8s-merge-robot ec1ba7438f Merge pull request #17796 from deads2k/gv-object-typer
Auto commit by PR queue bot
2015-12-07 12:34:55 -08:00
deads2k 66eecb963a update more kubectl bits for groupversion 2015-12-07 09:01:44 -05:00
deads2k f764e0099c Update ObjectTyper to GroupVersion 2015-12-07 08:35:05 -05:00
jiangyaoguo 7153ff80ff print absolute time when watch event 2015-12-05 13:52:53 +08:00
Tim Hockin e6df0b1a24 Convert validation to use FieldPath
Before this change we have a mish-mash of ways to pass field names around for
error generation.  Sometimes string fieldnames, sometimes .Prefix(), sometimes
neither, often wrong names or not indexed when it should be.

Instead of that mess, this is part one of a couple of commits that will make it
more strongly typed and hopefully encourage correct behavior.  At least you
will have to think about field names, which is better than nothing.

It turned out to be really hard to do this incrementally.
2015-12-03 08:19:44 -08:00
Wojciech Tyczynski 6dcb689d4e Simplify List() signature in clients. 2015-12-03 09:54:07 +01:00
Brendan Burns 601faebfe3 Add custom-columns to the template flag 2015-12-02 10:40:32 -08:00
Wojciech Tyczynski 8343c8ce6c Pass ListOptions to List() methods. 2015-12-01 15:00:36 +01:00
deads2k 1ac6d8afd3 update reaper, scaler, describer for GroupKind 2015-11-30 09:22:39 -05:00
k8s-merge-robot 5f8743ea7b Merge pull request #17108 from kargakis/fix-editor-env
Auto commit by PR queue bot
2015-11-26 03:53:53 -08:00
deads2k 8679925847 update RESTMapping API to be properly typed 2015-11-25 14:02:37 -05:00
deads2k 5c4fb5bcbe make RESTMapper.KindFor 2015-11-25 14:02:37 -05:00
kargakis 523b6ec7e3 edit: Make environment variables composable
It also adds support for KUBE_EDITOR and GIT_EDITOR which were already
advertised in the edit usage message.
2015-11-25 11:23:23 +01:00
k8s-merge-robot 3e56ce6490 Merge pull request #17327 from deads2k/gv-restmapper
Auto commit by PR queue bot
2015-11-24 19:08:49 -08:00
k8s-merge-robot 431c67710b Merge pull request #17247 from thockin/airplane_validation_pt3
Auto commit by PR queue bot
2015-11-24 18:37:09 -08:00
Janet Kuo c0c02c95c4 kubectl run to produce deployment and job 2015-11-24 10:21:31 -08:00
deads2k 5077e9b644 make register.GroupVersion use GroupVersion 2015-11-24 09:45:36 -05:00
k8s-merge-robot 4fd6b6df06 Merge pull request #17316 from deads2k/gv-ClientForVersion
Auto commit by PR queue bot
2015-11-24 06:24:28 -08:00
Tim Hockin ceee678b29 Rename validation 'New' funcs 2015-11-23 10:01:43 -08:00
Tim Hockin 48b49a5cae s/ValidationErrorList/ErrorList/ 2015-11-22 20:13:20 -08:00
Tim Hockin 0ff66da346 Move fielderrors into validation 2015-11-22 20:12:20 -08:00
k8s-merge-robot 6d2b92a0be Merge pull request #17269 from janetkuo/autoscale-deployments
Auto commit by PR queue bot
2015-11-21 22:23:23 -08:00
deads2k a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
deads2k afbcfc7cc6 fix client cache for different versions 2015-11-17 08:26:56 -05:00
deads2k 303bcad398 use groupversion in RESTMapping 2015-11-16 09:22:11 -05:00
Janet Kuo 8e99bae7ec Support autoscale deployments 2015-11-13 23:33:55 -08:00
Kris eacf65ddce Renaming HTTPClientFunc to CreateHTTPClient 2015-11-11 11:54:58 -08:00
Wojciech Tyczynski d80e0e837c Merge pull request #10707 from kargakis/logs-with-resource-builder
logs: Use resource builder
2015-11-09 16:40:10 +01:00
Janet Kuo a6a64820d7 Make generation of the apply annotation optional 2015-11-06 15:08:50 -08:00
kargakis 4fdb6d1331 logs: Use resource builder 2015-11-05 14:54:55 +01:00
k8s-merge-robot a9534bfd33 Merge pull request #16441 from liggitt/helper_codec
Auto commit by PR queue bot
2015-10-30 11:29:17 -07:00
Clayton Coleman 6f688c3df8 Improve the message for UsageError
Capitalize, also indicate that we have examples
2015-10-28 13:33:37 -04:00
Jordan Liggitt b58e62e7d4 Pass runtime.Object to Helper.Create/Replace 2015-10-28 12:43:21 -04:00
Daniel Smith 6219b50280 Merge pull request #16160 from kargakis/windows-fixes-for-edit
edit: Windows fixes
2015-10-27 15:44:26 -07:00
kargakis 4befdf5b49 Make CanBeExposed and CanBeAutoscaled composable 2015-10-24 20:07:35 +02:00
kargakis 73713ce268 edit: Windows fixes
Contains the following fixes for Windows users of kubectl edit:
* Defaults to notepad as the default Windows editor
* Uses CRLF line endings
* Ensures a file lock is freed
2015-10-24 17:06:49 +02:00
Fabiano Franz 312d53d9c9 Expose attachable pod discovery to factory 2015-10-23 17:28:41 -02:00
deads2k 2ea025aedd fix missing error handling 2015-10-21 14:37:47 -04:00
Janet Kuo 8105aa44a0 Implement kubectl autoscale 2015-10-19 09:59:22 -07:00
Chao Xu 9a812bd0c5 grep sed ExperimentalClient 2015-10-13 13:22:22 -07:00
Chao Xu 80f213c376 "experimental" -> "extensions" 2015-10-09 15:14:03 -07:00
hurf e1b88c6942 Integrate convertion tool to kubectl
Added 'convert' subcommand to kubectl to convert config files
between different API versions.
2015-10-09 10:15:30 +08:00
jackgr ef3f64612e Add calls to set annotation for kubectl apply 2015-10-07 17:15:56 -07:00
Paul Morie 227dd82119 Add PodSecurityContext and backward compatibility tests 2015-10-05 21:05:27 -04:00
deads2k 05e84fafbe move HasConflicts to shareable location 2015-10-05 14:37:57 -04:00
Timothy St. Clair 7955d428de Fix for unit test failures 'unexpected error: user: Current not implemented on linux/amd64'
running on Fedora 20 'go version go1.4.2 linux/amd64'
2015-09-30 20:33:34 -05:00
Brendan Burns afea127a3e Move the default schema cache to the home directory 2015-09-28 16:26:48 -07:00
Chao Xu ae1293418b move experimental/v1 to experimental/v1alpha1;
use "group/version" in many places where used to expect "version" only.
2015-09-24 15:32:11 -07:00
Eric Tune 43b37204ec Merge pull request #14502 from deads2k/tolerate-missing-sortby
don't fatal on missing sorting flag
2015-09-24 14:09:42 -07:00
deads2k dd7ed11fc1 don't fatal on missing sorting flag 2015-09-24 12:53:33 -04:00
Maciej Szulik 48775319d9 Reaper and scaler for jobs 2015-09-23 13:06:34 +02:00
Clayton Coleman c2e90cd154 Support extended pod logging options
Increase the supported controls on pod logging. Add validaiton to pod
log options. Ensure the Kubelet is using a consistent, structured way to
process pod log arguments.

Add ?sinceSeconds=<durationInSeconds>, &sinceTime=<RFC3339>, ?timestamps=<bool>,
?tailLines=<number>, and ?limitBytes=<number>
2015-09-21 15:39:32 -04:00
Muhammed Uluyol f855e75805 Correctly do swagger validation with experimental.
Before we tried both groups, first api then experimental. If
experimental failed, the error message would be discarded and the
message for api would be shown. This commit changes this behavior so
that we detect which api group we should be using and only show the
error for that group.
2015-09-17 22:54:56 -04:00
Kris f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -07:00
k8s-merge-robot b342591032 Merge pull request #13604 from JanetKuo/kubectl-edit
Auto commit by PR queue bot
2015-09-17 03:00:33 -07:00
k8s-merge-robot 426d4a2477 Merge pull request #13945 from caesarxuchao/kube-api-prefix
Auto commit by PR queue bot
2015-09-16 18:43:55 -07:00
Janet Kuo 5a608446ba pull "kubectl edit" from openshift upstream 2015-09-15 19:16:23 -07:00
Chao Xu 9bef5ff99d register experimental apis as apis/experimental/..
mark --api-version as deprecated
2015-09-15 11:25:01 -07:00
feihujiang 98689a99ec Limit the type for kubectl expose command 2015-09-15 11:17:04 +08:00
Chao Xu f5023929d8 fix broken files after rebase 2015-09-12 15:45:12 -07:00
Chao Xu dd6c121d7f massive changes 2015-09-11 17:31:47 -07:00
Brendan Burns 9ba13ff361 Address comments 2015-09-11 13:55:16 -07:00
Brendan Burns d9e1a00a14 Add caching for swagger schemas 2015-09-10 21:18:52 -07:00
Michal Fojtik fb14c8cdf3 Allow to replace os.Exit() with panic when CLI command fatal error 2015-09-10 09:42:22 +02:00
Dai Zuozhuo 2e2ef3e830 change -o template to -o go-template=... 2015-09-05 22:30:47 +08:00
Chao Xu 9fc79e9d99 refactor testapi and test scripts to prepare for multiple API groups. 2015-09-04 18:01:32 -07:00
Timothy St. Clair 2b7e758c3c Fixes the experimental api, which appeared to be completely broken.
Fix for rebase with nikhiljindal/deploymentController
2015-09-03 21:56:45 -05:00
Yu-Ju Hong b00c04c497 Merge pull request #12845 from hurf/o_name
Add -o name for commands which use printer to output results
2015-08-26 13:03:52 -07:00
Marcin Wielgus 55cd0d565e Kubectl describe for experimental HorizontalPodAutoscaler 2015-08-26 16:28:50 +02:00
hurf d2d96ff6e1 Add -o name for commands which use printer to output results
Added a new printer which prints 'resource/name' pair of a given
object.
2015-08-26 17:04:23 +08:00
Janet Kuo 5823ef771b Make --validate default on and shows how to turn if off 2015-08-25 03:18:32 -07:00
Janet Kuo 0bcb3147f6 Deprecated -t for --template to make it --tty 2015-08-24 02:16:01 -07:00
k8s-merge-robot 44c76d5319 Merge pull request #12957 from smarterclayton/handle_terminating_pods
Auto commit by PR queue bot
2015-08-20 21:47:00 -07:00
Eric Paris 7162baa4b8 Drop some of our flag stuff which isn't needed 2015-08-20 15:01:36 -07:00
Eric Paris bcf912667b Use pflag functions instead of ours. 2015-08-20 15:00:55 -07:00
Clayton Coleman 02dbb95447 Add TerminationGracePeriodSeconds to API
Set defaulting for pod spec
2015-08-20 11:03:38 -04:00
Dai Zuozhuo 85972c44a4 jsonpath user guide docs 2015-08-20 09:11:04 +08:00
Dai Zuozhuo b61a905b19 add jsonpath to kubectl 2015-08-20 08:57:24 +08:00
Saad Ali d42864b0ad Merge pull request #12112 from JanetKuo/update-kubectl-get-pods-running
Hide terminated pods in 'kubectl' Printer by default
2015-08-19 12:51:18 -07:00
Piotr Szczesniak 86e0c386d7 Merge pull request #12875 from uluyol/fix-exp-client
Create an experimental client cache.
2015-08-19 15:02:07 +02:00
Robert Bailey 08e6a43c1d Revert "Merge pull request #9165 from smarterclayton/graceful"
This reverts commit 4f856b595d, reversing
changes made to d78525a83b.

Conflicts:
	pkg/kubelet/status_manager.go
2015-08-18 17:34:49 -07:00
Muhammed Uluyol 7c58f94edc Create an experimental client cache.
Previously, we would initialize the experimental client at factory creation
time. This is problematic because the clientConfig loader has values populated
from the command-line flag parsing, and these are not populated until after
Factory creation. Introduce an ExperimentalClientCache to create (and reuse)
ExperimentalClients.
2015-08-18 14:25:38 -07:00
Janet Kuo 44a7a52a94 Hide failed/succeeded pods in 'kubectl get pods' by default 2015-08-18 13:47:19 -07:00
Robert Bailey 5000252e46 Merge pull request #12669 from deads2k/tolerate-missing-template-flag
tolerate output without template file
2015-08-18 11:49:53 -07:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
deads2k 969d526ca5 tolerate output without template file 2015-08-18 08:58:04 -04:00
Clayton Coleman b842a7dd15 Revert "Revert "Gracefully delete pods from the Kubelet""
This reverts commit 98115facfd.
2015-08-18 08:57:02 -04:00
Brendan Burns 99b8df1812 Add field based sorting to the kubectl command line. 2015-08-12 16:51:36 -07:00
Muhammed Uluyol fab367230f Add experimental API support to kubectl 2015-08-11 16:49:55 -07:00
Muhammed Uluyol 01807c1fac Make ClientCache public 2015-08-11 16:47:57 -07:00
Kris Rousey 565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07:00
Marek Grabowski 5f9cefc1d8 Merge pull request #12441 from vlajos/typofixes-vlajos-20150807
typofix - https://github.com/vlajos/misspell_fixer
2015-08-10 16:33:52 +02:00
Marek Grabowski e27787c9d3 Merge pull request #12292 from brendandburns/stdin3
Add support for `--restart`
2015-08-10 14:54:54 +02:00
Clayton Coleman c46165de19 Extra newlines in error output
StandardErrorMessage does not have a newline by default, other
error messages should not end with a newline.
2015-08-09 11:41:52 -04:00
Veres Lajos 9f77e49109 typofix - https://github.com/vlajos/misspell_fixer 2015-08-08 22:31:48 +01:00
Brendan Burns e42d6aa255 Add --restart support to kubectl run 2015-08-07 13:20:09 -07:00
Eric Paris 7cbb52ce04 Use the pflag StringSlice instead of implementing it ourselves
Saves code and makes our code easier to read because we just use normal
[]string instead of custom type.
2015-08-06 19:16:13 -04: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
Alex Mohr 0e8020f9bb Merge pull request #11779 from JanetKuo/add-kubectl-annotation
Auto commit by PR queue bot
2015-08-04 18:28:12 -07:00
Janet Kuo 7e63213478 Implement kubectl annotation update command. Refactor kubectl annotate to decouple command framework from business logic. 2015-08-03 14:35:56 -07:00
Chao Xu 18d32751fd improve the error message of update pod 2015-08-02 13:41:53 -07:00
Janet Kuo 0e42d0699a Add '-o name' to mutations 2015-07-27 14:06:53 -07:00
nikhiljindal 242910e57c kubectl expose should extract ports from service 2015-07-24 15:17:48 -07:00
Mike Danese 52282b1a36 Merge pull request #11300 from mwielgus/kubectl_replace_tempfile
Dump stdin to a temporary file in kubectl replace --force
2015-07-24 11:23:25 -07:00
Marcin Wielgus 866bd7b4e5 Dump stdin to a temporary file in kubectl replace --force 2015-07-23 15:22:23 +02:00
nikhiljindal c849730116 Fixing the error message 2015-07-16 23:33:16 -07:00
nikhiljindal 496f30a92f Introduce a new service generator that leaves service port unnamed 2015-07-16 20:40:40 -07:00
Zach Loafman 5dbe90f0ba Merge pull request #10493 from krousey/namespace
Unify command line namespace resolution
2015-07-01 19:33:44 -07:00
nikhiljindal 274792d7bb Stop exposing v1beta3 by default 2015-07-01 14:38:02 -07:00
Kris Rousey ffa764d60b Unify command line namespace resolution
This change allows the namespace in kubeconfig to be overridden by
specifying the namespace in the spec file. If namespace is explicitly
provided in the command line flags and the spec file has a different
namespace, this will cause an error.
2015-07-01 12:59:17 -07:00
Janet Kuo 682734bcc7 Implement 'kubectl get ... -o wide' 2015-06-30 14:06:47 -07:00
Alex Robinson 68bbf6c129 Merge pull request #10447 from feihujiang/helpfulErrorForUnsupportedVersion
Provide more helpful error when using unsupported api version
2015-06-29 15:00:58 -07:00
Alex Robinson 10a0dc9aae Merge pull request #9928 from jlowdermilk/version-negotiate-tests
Unittest for #9762
2015-06-29 13:34:13 -07:00
feihujiang 878a72228f Provide more helpful error when using unsupported api version 2015-06-29 15:32:54 +08:00
feihujiang b41b53122a Add source in “error from server” message when using kubectl 2015-06-25 14:20:09 +08:00
Anastasis Andronidis b06ef70057 Print resource labels as columns 2015-06-22 00:44:51 +02:00
Satnam Singh d69e0b5eb6 Improve error output of kubectl update 2015-06-17 15:55:03 -07:00
Jeff Lowdermilk 57a6355807 Unittest for #9762
Started looking at refactoring of the kubectl Factory, which
caused me to experience all 5 stages of grief. There are some options
for improving, but it probably warrants a proposal with some discussion/
feedback. In the meantime this tests `NegotiateVersion` in isolation.
2015-06-16 20:04:51 -07:00
Jeff Lowdermilk f31191224b kubectl negotiates apiversion to use based on client,server supported 2015-06-16 10:12:39 -07:00
Anastasis Andronidis 62c766d58d Add tests 2015-06-10 16:09:43 +02:00
Anastasis Andronidis b7c485ee9a make CheckErr testable 2015-06-10 16:09:42 +02:00
krousey ff474e5d7e Merge pull request #9376 from feihujiang/createValidateCrash
kubetcl create --validate crashes when no apiVersion or kind is provided
2015-06-09 09:59:42 -07:00
feihujiang 37abe11f8a kubetcl create --validate crashes when no apiVersion or kind is provided 2015-06-09 10:38:43 +08:00
Anastasis Andronidis bf87f0ec68 Print multiple validation errors 2015-06-08 14:06:20 +02:00
Chao Xu 080da97e1c fix a comment 2015-06-04 10:35:10 -07:00
Brian Grant 656fa7bea1 Merge pull request #9225 from caesarxuchao/add-v1-tests-general
Add v1 tests
2015-06-03 22:18:21 -07:00
Brian Grant c92b4255b3 Merge pull request #9217 from caesarxuchao/add-v1-tests-to-pkg/kubectl/cmd
add v1 tests to kubectl/cmd/*
2015-06-03 22:16:44 -07:00
Chao Xu 6b81c064ed change v1beta3 to v1 in test cases 2015-06-03 17:50:22 -07:00
Chao Xu 8885025d25 add v1 tests to tests in kubectl/cmd/* 2015-06-03 13:57:54 -07:00
Daniel Smith 67f53d2eff Make kubectl work inside a container in k8s 2015-06-03 12:48:07 -07:00
Filip Grzadkowski 98115facfd Revert "Gracefully delete pods from the Kubelet" 2015-06-02 23:40:05 +02:00
Clayton Coleman 72ee028cab Gracefully delete pods from the Kubelet
This commit wires together the graceful delete option for pods
on the Kubelet.  When a pod is deleted on the API server, a
grace period is calculated that is based on the
Pod.Spec.TerminationGracePeriodInSeconds, the user's provided grace
period, or a default.  The grace period can only shrink once set.
The value provided by the user (or the default) is set onto metadata
as DeletionGracePeriod.

When the Kubelet sees a pod with DeletionTimestamp set, it uses the
value of ObjectMeta.GracePeriodSeconds as the grace period
sent to Docker.  When updating status, if the pod has DeletionTimestamp
set and all containers are terminated, the Kubelet will update the
status one last time and then invoke Delete(pod, grace: 0) to
clean up the pod immediately.
2015-06-01 19:23:59 -04:00
Kris f4e2c738f6 Delete deprecated API versions
pkg/service:

There were a couple of references here just as a reminder to change the
behavior of findPort. As of v1beta3, TargetPort was always defaulted, so
we could remove findDefaultPort and related tests.

pkg/apiserver:

The tests were using versioned API codecs for some of their encoding
tests. Necessary API types had to be written and registered with the
fake versioned codecs.

pkg/kubectl:

Some tests were converted to current versions where it made sense.
2015-05-29 17:17:35 -07:00
Jeff Lowdermilk 90a5b8c845 Disable --patch for kubectl update 2015-05-29 09:31:49 -07:00
Chao Xu 9c1153322e update PodSpec.Host to PodSpec.NodeName in /pkg/api/types.go and /pkg/api/v1beta3/types.go 2015-05-28 14:10:06 -07:00
Anastasis Andronidis 9e3a540940 rename resize to scale 2015-05-27 19:08:06 +02:00
Anastasis Andronidis d4a47bdb9e rename run-container to run in kubectl 2015-05-27 19:07:17 +02:00
Anastasis Andronidis 5eae2378d6 Warn for every _ flag user or cmd defined
also renames all global _ flags to -
2015-05-27 11:23:52 +02:00
Justin Santa Barbara 973c2e4819 Add Type to ServiceSpec: ClusterIP or LoadBalancer 2015-05-22 19:14:21 -04:00
Masahiro Sano 8ce64ec69e add --all-namespaces flag to request across all namespaces 2015-05-22 23:25:12 +09:00
deads2k cd817aebd8 tolerate fatals without newlines 2015-05-20 13:15:49 -04:00
Jeff Lowdermilk 46bd6f298a Merge pull request #8237 from smarterclayton/continue_on_error
Make ContinueOnError actually work
2015-05-15 12:57:29 -07:00
Clayton Coleman a47716e66d Make ContinueOnError actually work
In resource.Builder ContinueOnError() should actually do so.

Reorganized util.CheckErr() to make it display bulk errors more
effectively and be more reusable. Clarified that CheckErr is not
specific to kubectl in Godoc. Changed the "Error: " prefix to
"error: " to more closely match Unix conventions.
2015-05-15 14:26:14 -04:00
kargakis ac652d16e6 expose: Re-use labels in case none was specified 2015-05-15 11:54:41 +02:00
Jeff Lowdermilk ac87ed6516 Merge pull request #8064 from deads2k/death-to-auth-path
eliminate auth-path
2015-05-11 15:41:41 -07:00
deads2k 19784dbc4f remove auth-path from kubeconfig 2015-05-11 10:40:23 -04:00
kargakis 93dc839b19 Load input object for increased safety 2015-05-08 03:17:54 +02:00
kargakis c9e79a3c28 Setup generators in factory 2015-05-05 12:00:13 +02: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
Eric Paris a17a26643b Update kube to support new pflag/cobra 2015-04-29 11:26:30 -04:00
kargakis e6ee32a6c6 Fix getting services in expose cmd 2015-04-28 14:45:05 +03:00
Tim Hockin 6694eff020 Use pflags word separators to make - and _ equiv. 2015-04-27 15:10:52 -07:00
Jeff Lowdermilk 97e4549170 Merge pull request #6680 from deads2k/deads-change-kubeconfig-chain
change kubeconfig loading chain
2015-04-16 13:57:31 -07:00
deads2k de4be5422c change kubeconfig loading order 2015-04-16 13:05:09 -04:00
Dan Mace bd7b719944 Make default impls private 2015-04-15 16:50:08 -04:00
Dan Mace 312ccad3c1 Use narrowly scoped interfaces for client access
Use custom narrowly scoped interfaces for client access from the
RollingUpdater and Resizer. This allows for more flexible downstream
integration and unit testing without imposing a burden to implement
the entire client.Interface for just a handful of methods.
2015-04-15 14:28:59 -04:00
Dawn Chen fb25f9e12c Merge pull request #6768 from deads2k/deads-allow-flag-elimination
allow selective removal of kubeconfig override flags
2015-04-13 16:00:23 -07:00
deads2k e7baa94404 allow selective removal of kubeconfig override flags 2015-04-13 13:14:23 -04:00
kargakis ae960552c8 Remove deprecated call to ResourceFromArgs
Continuing from #6571
2015-04-11 08:14:25 +02:00
Clayton Coleman 92a68ad7bf The versioned printer should be initialized with the mapping apiversion
VersionedPrinter handles fallback when multiple different APIVersions
are present if multiple arguments are passed (for instance, both Kube
resources at v1beta3 and a third party's API objects which are only
at v1). The cmd PrinterForMapping should always include the current
object's "mapping version" as a fallback in the event the preferred
API version does not map to the actual object.
2015-04-09 15:45:06 -04:00
deads2k 6344cf3c3a refactor to move kubectl.cmd.Factory to kubect/cmd/util 2015-04-07 14:43:50 -04:00
Clayton Coleman 323a44e54a Make kubectl errors even more user-friendly
Omit glog prefix when v < 2, show multiline errors for configuration
problems, add new generic messages for server errors that hide some
complexity that is not relevant for users.
2015-04-02 01:40:15 -04:00
Tim Hockin 186818d787 WIP: Implement multi-port Services 2015-03-30 19:28:11 -07:00
Jeff Lowdermilk 243de3a472 Fix kubectl log for single-container pods 2015-03-27 12:26:00 -07:00
Clayton Coleman 581d7cd789 Allow resource.Builder commands to take arguments by type/name
Will allow xarg behavior to fetch resources across multiple types.
Changes 'create', 'get', 'update', 'stop', and 'delete' to output
<resourceType>/<name>.
2015-03-25 20:39:22 -04:00
Clayton Coleman 022c103699 Update RollingUpdater to use resource.Builder
Remove last usage of ResourceFromFile
2015-03-20 00:03:54 -04:00
Dawn Chen 34e9c82c70 Convert RestartPolicy to string for v1beta3.
Fixed #3607 and spiritually support #5475
2015-03-13 18:38:07 -07:00
Jeff Lowdermilk cd7d78b696 Make kubectl commands return errors and centralize exit handling 2015-03-10 10:19:43 -07:00
Brendan Burns 0ad6e5b48c Fix the test by using an even more bogus tld. 2015-03-09 14:31:39 -07:00
Alex Mohr 37bfb0d7cf Merge pull request #5159 from brendandburns/coverage
Expand test coverage in master.
2015-03-09 13:26:37 -07:00
Brendan Burns 7c654a3d1b Expand test coverage in master, kubectl/cmd/util, pkg/registry/resourcequota, and api/rest. 2015-03-07 15:24:39 -08:00
Brendan Burns f505a33998 Differentiate between server error messages and client error messages in kubectl 2015-03-07 11:39:23 +01:00
Brendan Burns fb90b56bf6 Embed VolumeSource in v1beta3 and internal. 2015-03-04 02:25:40 -08:00
Mike Danese 25fac68ec4 validate api version in kubectl --patch and --override. 2015-03-02 13:00:45 -08:00
Brian Grant 3f69112e02 Merge pull request #4766 from mikedanese/remove-util-merge
Remove pkg/util/merge and replace with evanphx/json-patch
2015-02-25 09:22:01 -08:00
Mike Danese 88e1ab3cbe replace pkg/util/merge with evanphx/json-patch 2015-02-23 20:55:30 -08:00
Tim Hockin 607b736a3f Rename volume source types to be consistent. 2015-02-23 12:39:57 -08:00
Clayton Coleman a8ba77f23b Remove unused flag helpers 2015-02-21 18:25:55 -05:00
Clayton Coleman 35cc1b0c15 Mark old kubectl/resource.go methods as deprecated
Every command should use resource.Builder instead to have consistent
behavior.
2015-02-21 18:22:07 -05:00
Mike Danese a4eca69e6c added previously failing unit test and fix using pkg/util/merge.go instead of mergo to apply patch. 2015-02-17 07:43:21 -08:00
Brendan Burns f63cf05d21 Add some docs to the template format. 2015-02-12 18:29:11 -08:00
MikeJeffrey e5459c8802 Clean up kubectl help for auto-gen'd kubectl.md 2015-02-10 12:02:05 -08:00
Jeff Lowdermilk aff7f63d7f Explicitly send error string to Fatal log 2 2015-02-10 10:02:16 -08:00
Jeff Lowdermilk d46ae5d841 Refactor kubectl/cmd helpers into pkg/kubectl/cmd/util
Allows helpers to be used by config commands.
2015-02-05 09:39:42 -08:00