Commit Graph

45 Commits (9a761b16c1558106800222dbc52f6ab03c40c64c)

Author SHA1 Message Date
Cao Shufeng 292b18db1f enhance kubectl run error message
Before this change:
 # kubectl run nginx
 error: Invalid image name "": invalid reference format

After this change:
 # kubectl run nginx
 error: --image is required
2017-07-26 11:24:03 +08:00
Kubernetes Submit Queue 575cbdf7d4 Merge pull request #45012 from xiangpengzhao/fix-delete-svc
Automatic merge from submit-queue

Remove service on termination when exec 'kubectl run' command with flags "--rm" and "--expose"

**What this PR does / why we need it**:
As the title says and issue #40504 mentioned.
cc @tanapoln

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

**Special notes for your reviewer**:
Related to: #44915

**Release note**:

```release-note
NONE
```
2017-07-19 07:59:34 -07:00
Kubernetes Submit Queue 6d69f18f5b Merge pull request #46845 from zhangxiaoyu-zidif/change-fatalf
Automatic merge from submit-queue

Use t.Fatalf instead

**What this PR does / why we need it**:
we can use t.Fatalf to take place of t.Errorf + t.FailNow()


**Release note**:

```release-note
NONE
```
2017-07-13 21:26:07 -07:00
Alexander Campbell 6fd36c10ad kubectl/cmd: many small refactors
* Rename variables and functions to match Go convention.
   For example, UsageError --> UsageErrorf.
 * Remove redundant or unreachable code.
 * Simplify some utility functions (no functionality changes).
 * Fix hanging 'if { return } else { return }' constructs.
 * Fix several incorrect printf verbs.
2017-06-27 16:25:20 -07:00
Alexander Campbell d29560d89a kubectl: rename Run() -> RunRun() to clarify purpose
Run() is too overloaded in the codebase already. The other commands have
a pattern of RunExpose, RunScale, and so on. Since the command name is
"run", the associated function should be called RunRun.
2017-06-23 09:49:30 -07:00
xiangpengzhao aef9f38baf Remove service on termination when exec 'kubectl run' command with flags "--rm" and "--expose" 2017-06-23 11:36:40 +08:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
zhangxiaoyu-zidif 02af4b31a6 Use t.Fatalf instead 2017-06-02 17:35:33 +08:00
Daniel Smith d6e1140b5d Implement dynamic admission webhooks
Also fix a bug in rest client
2017-05-31 16:38:46 -07:00
Brendan Burns 79f51923d3 Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
Maciej Szulik aa4390750c Introduce new generator for apps/v1beta1 deployments 2017-03-10 12:08:01 +01:00
deads2k c9a008dff3 move util/intstr to apimachinery 2017-01-30 12:46:59 -05:00
deads2k 502bfdf944 client/restclient/fake move to client-go 2017-01-25 08:29:48 -05:00
deads2k ee6752ef20 find and replace 2017-01-20 08:04:53 -05:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06: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 fd2fdfba89 move client/unversioned/fake to client/restclient/fake 2016-10-29 14:22:02 -07:00
Fabiano Franz bc1a1d7b30 Better kubectl run validations 2016-10-27 20:05:26 -02:00
Angus Salkeld d58554a647 Move the common test functions from cmd_test.go to cmd/testing/fake.go
This is so that we can use NewAPIFactory() from cmd/set/*test.go
Up until now we would get a import loop error.

This commit also adds a basic unit test case for cmd/set/set_image.go
2016-10-19 08:53:26 +10:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -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 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
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
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Wojciech Tyczynski 5d046fed41 Fix tests for renegotiation 2016-05-12 08:21:11 +02:00
Brendan Burns be6c5b332b Add third party support to kubectl 2016-03-31 10:53:32 -07:00
goltermann 34d4eaea08 Fixing several (but not all) go vet errors. Most are around string formatting, or unreachable code. 2016-03-22 17:26:50 -07:00
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08:00
Janet Kuo 4e8b4871c4 Add e2e test for kubectl run should generate deployment 2016-02-12 12:29:14 -08:00
Janet Kuo 5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -08:00
Clayton Coleman 38c7eded99 Prepare for content-type negotiation
Combine the fields that will be used for content transformation
(content-type, codec, and group version) into a single struct in client,
and then pass that struct into the rest client and request. Set the
content-type when sending requests to the server, and accept the content
type as primary.

Will form the foundation for content-negotiation via the client.
2016-01-26 17:44:30 -05:00
Clayton Coleman 1e21054134 Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of
Encode and Decode to be more complicated. Create a stub helper
with the exact semantics of today and do the simple mechanical
refactor here to reduce the cost of that change.
2015-12-09 21:15:02 -05:00
deads2k a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -05:00
feihujiang 4d2333b7d8 Let kubectl run follow rules for `--` 2015-11-18 14:46:01 +08:00
Tim Hockin ba383bcfeb Refactor IntOrString into a new pkg
pkg/util/intstr is a cleaner encapsulation for this type and supporting
functions.  No behavioral change.
2015-11-16 10:57:52 -08:00
Kris eacf65ddce Renaming HTTPClientFunc to CreateHTTPClient 2015-11-11 11:54:58 -08:00
Janet Kuo a6a64820d7 Make generation of the apply annotation optional 2015-11-06 15:08:50 -08:00
Brendan Burns 54fd60727e add a --expose flag to kubectl run 2015-10-20 20:21:09 -07:00
feihujiang 84e94e39cd Support setting env vars in kubectl run 2015-09-08 14:31:29 +08:00
Brendan Burns e42d6aa255 Add --restart support to kubectl run 2015-08-07 13:20:09 -07:00