Commit Graph

146 Commits (680ce72c07d4a90d54b7110680b116106a391df7)

Author SHA1 Message Date
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Kubernetes Submit Queue b9536688d3 Merge pull request #38429 from duglin/removeDelete
Automatic merge from submit-queue (batch tested with PRs 37860, 38429, 38451, 36050, 38463)

Remove "pod xxx deleted" message from kubectl run --rm

This is a follow-on to https://github.com/kubernetes/kubernetes/issues/28695

Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>

```release-note
kubectl run --rm no longer prints "pod xxx deleted"
```
2016-12-09 13:22:14 -08:00
Kubernetes Submit Queue 5628cde1bd Merge pull request #37164 from duglin/removeWaiting
Automatic merge from submit-queue (batch tested with PRs 38413, 37164)

Remove chatty "waiting for pod" msg from kubectl run

Attacking #28695 one step at a time

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 18:08:55 -08:00
Doug Davis 24fbba393e Remove "pod xxx deleted" message from kubectl run --rm
Its unnecessary to print the message when the user asked for it.
We should only show a msg (error) when we didn't do what they asked.
Also showing this in a "kubectl run" is bad because it then
gets appended to the user's output and they would then have to strip
it off if they want to use the output in some follow-on processing.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-08 17:40:08 -08:00
Dr. Stefan Schimanski 458d2b2fe4 Add verb support for discovery client 2016-12-05 12:36:05 +01:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Doug Davis c5387eebe4 Remove chatty "waiting for pod" msg from kubectl run
Attacking #28695 one step at a time

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-12-01 17:46:04 -08:00
Kubernetes Submit Queue 9ccc291e8a Merge pull request #37263 from smarterclayton/wait_on_immediate
Automatic merge from submit-queue

When --grace-period=0 is provided, wait for deletion

The grace-period is automatically set to 1 unless --force is provided, and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not handle scenarios where the object is deleted and a new object is created with the same name because we don't have the initial object loaded (and that's a larger change for 1.5).

Fixes #37117 by relaxing the guarantees provided.

```release-note
When deleting an object with `--grace-period=0`, the client will begin a graceful deletion and wait until the resource is fully deleted.  To force deletion, use the `--force` flag.
```
2016-11-30 11:15:17 -08:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Clayton Coleman 7cdb6b169d
When --grace-period=0 is provided, wait for deletion
The grace-period is automatically set to 1 unless --force is provided,
and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not
handle scenarios where the object is deleted and a new object is created
with the same name.
2016-11-23 15:02:43 -06:00
Kubernetes Submit Queue 3b31c9f019 Merge pull request #36355 from soltysh/deprecate_extensionsjob
Automatic merge from submit-queue

 Deprecate extensions/v1beta1.Jobs related stuff

This PR supersedes https://github.com/kubernetes/kubernetes/pull/33861, it's a pre-req for removing `extensions/v1beta1.Jobs` (#32763) in the next release. 

@kubernetes/kubectl @kubernetes/api-review-team ptal
@bgrant0607 @erictune @janetkuo fyi

```release-note
Deprecate extensions/v1beta1.Jobs
```
2016-11-08 07:18:40 -08:00
Maciej Szulik ed6ede3715 Deprecate extensions/v1beta1.Jobs related stuff 2016-11-07 12:44:51 +01:00
Maciej Szulik 41d88d30dd Rename ScheduledJob to CronJob 2016-11-07 10:14:12 +01:00
Kubernetes Submit Queue 71ba8a90f0 Merge pull request #35732 from fabianofranz/run_cant_dryrun_with_attach
Automatic merge from submit-queue

Better kubectl run validations

Adds more validations to flags that must be mutually exclusive in `kubectl run`. For example, `--dry-run` must not be used with `--attach`, `--stdin` or `--tty`. Adds unit tests for these new validations and some previously existing ones.

**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`. 
-->
```release-note
NONE
```
2016-10-30 13:07:28 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Fabiano Franz bc1a1d7b30 Better kubectl run validations 2016-10-27 20:05:26 -02:00
Fabiano Franz f6d1ac72a0 Use our own normalizers for cmd examples and descriptions 2016-10-17 11:49:55 -02:00
Kubernetes Submit Queue c32a05333b Merge pull request #32671 from soltysh/generator_options
Automatic merge from submit-queue

Update run flags to point to generators docs

@janetkuo you've requested that in https://github.com/kubernetes/kubernetes/pull/32484#issuecomment-246840562 I'm opening this PR but like you I don't like the length of the descriptions already. The other problem with this is that there's not clean docs for a user to figure out what the generators are. I've stumbled upon this several times and I always found myself looking into the code :/ How about adding new flag/subcommand that will give you more information about generators and we'd move all those `--restart` and `--generator` information into specific generator info and present at the top level only general information?
2016-10-15 12:17:29 -07:00
AdoHe b2280a646a update various commands to adapt the new Factory interface 2016-10-13 21:01:14 +08:00
Michail Kargakis 40b7fabaf2 kubectl: return exit status appropriately after running watch.Until 2016-10-03 18:54:53 +02:00
bindata-mockuser 5ad518cd2b Switch kubectl to use watch.Until 2016-10-03 17:17:41 +02:00
Kubernetes Submit Queue 9a899b92ae Merge pull request #29605 from lojies/addportvalidate
Automatic merge from submit-queue

add port validate when --port is set or --expose=true

```shell
$ kubectl run nginx --image=nginx --port=88888 --expose=true
The Deployment "nginx" is invalid.
spec.template.spec.containers[0].ports[0].containerPort: Invalid value: 88888: must be between 1 and 65535, inclusive
$ kubectl run nginx --image=nginx --port=0 --expose=true
error: --port must be a positive integer when exposing a service
```

1. when port is greater than 65535, port is required between 1 and 65535 and deployment 'nginx' can not be created.
2. when port is less than 1, port is not validated and deployment 'nginx' can be created. But service will be created failed.

so i add this change:
when --port is set or --expose=true, validate port range so that error reported can be the same when port is greater than 65535 or less than 1.
And this can also find the port  range error before creating the deployment other than during creating the deployment.
2016-09-26 17:25:30 -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
Maciej Szulik cccef68e27 Update run flags to point to generators docs 2016-09-23 15:02:30 +02:00
deads2k 862415aaa2 make --include-extended-apis deprecated and remove plumbing 2016-09-16 16:05:52 -04:00
juanvallejo 52fc8efa55 update PrintSuccess message when using --dry-run 2016-09-15 10:11:21 -04:00
deads2k 519c13745f convert rest of kubectl to generated clients 2016-09-12 08:22:34 -04: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
Michael Fraenkel fb4a466321 Save stderr since it may become nil 2016-09-07 19:01:59 -04:00
deads2k 1d5e5532ed add ClientSet to factory to remove non-generated client 2016-09-07 09:44:01 -04:00
lojies ef87972835 add port validate when --port is set or --expose=true 2016-09-01 17:24:02 +08:00
Janet Kuo 1d620b545c Print to stderr when attach failed 2016-08-24 15:36:52 -07:00
Kubernetes Submit Queue d1ed6f598f Merge pull request #30614 from AdoHe/run_pull_policy
Automatic merge from submit-queue

kubectl run add pull-policy flag to control image pull policy

```release-note
Add support for --image-pull-policy to 'kubectl run'
```

Fix #30493 
@pwittrock @thockin ptal
2016-08-21 14:04:15 -07:00
bindata-mockuser e792d4117d Add return code support to kubectl-exec and -run 2016-08-20 15:58:47 +02:00
AdoHe ca315e317b kubectl run add pull-policy flag to control image pull policy 2016-08-17 11:26:27 +08:00
Kubernetes Submit Queue f0e5dac1f1 Merge pull request #30247 from ardnaxelarak/28695_suppress_noisy_output
Automatic merge from submit-queue

Make more messages respect --quiet flag

Make following two messages respect `--quiet` in `kubectl run`
- `If you don't see a command prompt, try pressing enter.`
- `Pod "name" deleted`

Ref #28695
2016-08-12 21:34:14 -07:00
Kubernetes Submit Queue 2ab58ea519 Merge pull request #30162 from juanvallejo/jvallejo_err-kube-run-on-invalid-image-value
Automatic merge from submit-queue

return err on `kubectl run --image` with invalid value

When running `kubectl run <configname> --image="Invalid$$%ImageValue%%__"`, a configuration is successfully created with an image name that is not a valid value for an image reference.

This patch validates that the image name is a valid image reference, and returns an error before creating a config if an invalid value is passed.

`$ kubectl run test --image="Invalid__%imagename"`
```
error: Invalid image name "Invalid__%imagename": invalid reference format
```

<!-- 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/30162)
<!-- Reviewable:end -->
2016-08-12 06:09:26 -07:00
Maciej Szulik 902ecd85fc Remove seconds from scheduled jobs cron format 2016-08-10 11:15:33 +02:00
juanvallejo af37981812 return err on kubectl run --image with invalid value 2016-08-09 15:05:44 -04:00
Kara Alexandra 4c959c0b23 Make more messages respect --quiet flag
- "If you don't see a command prompt, try pressing enter."
- "Pod "name" deleted"

Signed-off-by: Kara Alexandra <kalexandra@us.ibm.com>
2016-08-08 14:24:44 -07:00
Maciej Szulik b5c68a9015 ScheduledJob kubectl changes 2016-08-03 17:25:37 +02:00
Andy Goldstein 77b0547b3d Fix Windows terminal handling
Fix some issues with Windows terminal handling with respect to TTYs that came up as part of the
code that adds support for terminal resizing.
2016-07-20 13:37:14 -04:00
k8s-merge-robot 47d06dd9c2 Merge pull request #28606 from dims/fix-issues-19636
Automatic merge from submit-queue

Fix kubectl run to print object on dry run

Originally Authored By tnachen in PR:
https://github.com/kubernetes/kubernetes/pull/25842

Fixes #19636
2016-07-12 21:05:58 -07:00
Janet Kuo 268b93ea75 Add --quiet to hide the 'waiting for pods to be running' message in kubectl run 2016-07-12 11:56:58 -07:00
Davanum Srinivas 8b0868b76d
Fix kubectl run to print object on dry run
Originally Authored By tnachen in PR:
https://github.com/kubernetes/kubernetes/pull/25842

Fixes #19636
2016-07-08 11:00:08 -04:00
k8s-merge-robot 569008809f Merge pull request #28375 from duglin/removeContinue
Automatic merge from submit-queue

Remove unneeded continute

very minor but I noticed and it and it bugged me :-)

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-07-07 11:36:13 -07:00
k8s-merge-robot 2da247ffbc Merge pull request #26977 from joe2far/fix-help-strings
Automatic merge from submit-queue

Make kubectl help strings consistent
2016-07-07 00:12:22 -07:00
Doug Davis 507c3f2802 Remove unneeded continute
very minor but I noticed and it and it bugged me :-)

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-07-01 11:30:43 -07:00