Commit Graph

182 Commits

Author SHA1 Message Date
juanvallejo
6e7df2c986 remove duplicate errors from aggregate error outputs 2016-08-16 13:09:52 -04:00
lixiaobing10051267
11f5ced9d3 Wrong format is used with single quotes in log 2016-08-05 15:23:23 +08:00
Mike Dame
cfbf7da75b Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04: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
David McMahon
ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -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
Mike Metral
6b172657b0 clarify recursive flag description 2016-06-17 08:35:44 -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
Brendan Burns
dac09311b8 Add support for labelling 3rd party objects 2016-05-23 13:13:35 -07:00
Janet Kuo
4332472bde Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
Phillip Wittrock
1a3b133077 Delete unused helpers 2016-04-20 13:49:59 -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
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
laushinka
7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07: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
Janet Kuo
5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -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
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
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
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
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
jiangyaoguo
7153ff80ff print absolute time when watch event 2015-12-05 13:52:53 +08:00
Janet Kuo
a6a64820d7 Make generation of the apply annotation optional 2015-11-06 15:08:50 -08: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
jackgr
ef3f64612e Add calls to set annotation for kubectl apply 2015-10-07 17:15:56 -07:00
Brendan Burns
afea127a3e Move the default schema cache to the home directory 2015-09-28 16:26:48 -07: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
Kris
f4ad00d9ae Moving Status object to a common package 2015-09-17 14:09:53 -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
Janet Kuo
5823ef771b Make --validate default on and shows how to turn if off 2015-08-25 03:18:32 -07:00
Kris Rousey
ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
Kris Rousey
565189f5b8 Correcting all go vet errors 2015-08-11 13:55:37 -07: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
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
Marcin Wielgus
866bd7b4e5 Dump stdin to a temporary file in kubectl replace --force 2015-07-23 15:22:23 +02:00
Janet Kuo
682734bcc7 Implement 'kubectl get ... -o wide' 2015-06-30 14:06:47 -07: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
Anastasis Andronidis
b7c485ee9a make CheckErr testable 2015-06-10 16:09:42 +02:00
Anastasis Andronidis
bf87f0ec68 Print multiple validation errors 2015-06-08 14:06:20 +02:00
deads2k
cd817aebd8 tolerate fatals without newlines 2015-05-20 13:15:49 -04: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
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
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
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
Jeff Lowdermilk
cd7d78b696 Make kubectl commands return errors and centralize exit handling 2015-03-10 10:19:43 -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
Mike Danese
25fac68ec4 validate api version in kubectl --patch and --override. 2015-03-02 13:00:45 -08:00
Mike Danese
88e1ab3cbe replace pkg/util/merge with evanphx/json-patch 2015-02-23 20:55:30 -08:00
Clayton Coleman
a8ba77f23b Remove unused flag helpers 2015-02-21 18:25:55 -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
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