Commit Graph

1319 Commits (2d6c632de2f9ac15005c188913f779a81b392c81)

Author SHA1 Message Date
k8s-merge-robot 3814809f07 Merge pull request #25736 from andreykurilin/diagram_kubectl_drain
Automatic merge from submit-queue

Add link to diagram of `kubectl drain`
2016-06-29 11:28:21 -07:00
k8s-merge-robot 42a5654383 Merge pull request #25612 from mbohlool/fix_error_msg
Automatic merge from submit-queue

Fixed misleading error message when a resource with no selector or na…

Commit:
- Fixed misleading error message when a resource with no selector or name is provided to kubectl delete or label command

This commit fixes #25541
2016-06-29 10:52:25 -07:00
k8s-merge-robot 90f47644f6 Merge pull request #28012 from sttts/sttts-kubectl-attach-err-non-existing-ctr
Automatic merge from submit-queue

kubectl attach: error out for non-existing containers

Currently, kubectl attach falls back to the first container which is pretty confusing.

Based on https://github.com/kubernetes/kubernetes/pull/27541.
2016-06-29 10:11:03 -07:00
Andrey Kurilin 21b218ce4f Add link to diagram of `kubectl drain`
issue kubernetes/kubernetes.github.io#501
2016-06-29 19:10:01 +03:00
Dmitry Shulyak d81f7a0f22 Use strategic patch to replace changeCause in patch command 2016-06-29 15:20:38 +03:00
k8s-merge-robot 70daa166c2 Merge pull request #23830 from sttts/sttts-bash-completion-override-flags
Automatic merge from submit-queue

Add awareness of more override flags in bash-completion

Add awareness during completion for
- `--kubeconfig`
- `--cluster`
- `--user`
- `--context`
- `--server`

TODO:
- [ ] ~~add completion for the upper flags themselves~~ (out of scope)

<!-- 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/23830)
<!-- Reviewable:end -->
2016-06-28 13:59:13 -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
k8s-merge-robot 13bb931b60 Merge pull request #26761 from matchstick/dedent
Automatic merge from submit-queue

Dedent

Adding the dedent package and then applying it to the kubectl help commands. Also updating the documentation to reflect the use of dedent.
2016-06-28 12:50:59 -07:00
Dr. Stefan Schimanski 0acca44dc1 Error out on non-existing container in kubectl attach 2016-06-28 21:11:29 +02:00
George Tankersley 34506faf97 kubectl: add certificates group 2016-06-28 12:05:40 -07:00
Dr. Stefan Schimanski e78d7749a5 Add awareness of more override flags in bash-completion 2016-06-28 20:56:36 +02: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
Michael Rubin 760b04e294 Use dedent for the kubectl commands
The one side effect is that for the "kubectl help" commands a newline
is prepended to output, which will alter the yaml output.

Here we use dedent to format the code to match the output.

hack/update-generated-docs.sh has been run and the affected files have
been added.

Note: for describe.go we added a period to the end of an output message.
2016-06-26 22:51:14 -07:00
k8s-merge-robot 7fbf4ac625 Merge pull request #27541 from gitfred/attach-init-con
Automatic merge from submit-queue

Fix attach command for InitContainers

Added InitContainers to the things that GetContainer in attach.go has to look for to find a container to attach. Also test case added.

fixes #27540
2016-06-26 00:04:49 -07:00
k8s-merge-robot a6f6a74a9d Merge pull request #27359 from sttts/sttts-kubectl-exec-not-running
Automatic merge from submit-queue

Add not-running check to kubectl-exec

Different cases:
- pod is started, container terminated: 
```
error: error executing remote command: error executing command in container: container not found ("sleep1")
```
- pod has terminated:
```
error: cannot exec into a container in a completed pod; current phase is Succeeded
```
- container does not exist in pod spec:
```
Error from server: container foo is not valid for pod multi-container
```

Fixes https://github.com/openshift/origin/issues/8472#event-681794952
2016-06-25 21:31:03 -07:00
k8s-merge-robot 84c8158b2a Merge pull request #27263 from sttts/sttts-kubectl-attach-cmdName
Automatic merge from submit-queue

Dynamically derive AttachOptions.CommandName

This PR sets AttachOptions.CommandName dynamically depending on the corba Command
hierarchy. If the root command is named e.g. "oc" (for the OpenShift cli) this
will result in "oc attach" instead of the static "kubectl attach" before this
patch.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1341450
2016-06-25 18:40:56 -07:00
k8s-merge-robot 951b591716 Merge pull request #26722 from deads2k/local-patch
Automatic merge from submit-queue

let patch use --local flag like `kubectl set image`

Adds the concept of a `--local` flag to `kubectl patch`.  This flag is similar to `kubectl set image -f --local` because it will use the content of the file as the input to the patch operation instead of using the file content to file resource/name tuples.  

This pull lets you run something like `kubectl create deployment --dry-run -o yaml | kubectl set volume --local -f - -o yaml | kubectl patch --local -f - --patch {} | kubectl create -f -`

As proof that it works, you can run against a local file just to mess around with it, but `--local -f -` is the most likely case.
```
$kubectl patch --local -f pkg/api/validation/testdata/v1/validPod.yaml --patch='{"spec": {"restartPolicy":"Never"}}'
apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    name: redis-master
  name: name
spec:
  containers:
  - args:
    - this
    - is
    - an
    - ok
    - command
    image: gcr.io/fake_project/fake_image:fake_tag
    name: master
    resources: {}
  restartPolicy: Never
status: {}
```

This is useful for setting rarely used, but immutable fields from `kubectl create` or `kubectl convert` without dropping to an interactive editor.

Some discussion here: https://github.com/kubernetes/kubernetes/issues/21648#issuecomment-218579977

@smarterclayton @kubernetes/kubectl 
 @eparis @soltysh @stevekuznetsov we've talked about this separately
2016-06-25 10:00:41 -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
k8s-merge-robot 7c355e18a7 Merge pull request #25085 from metral/recursive-edit
Automatic merge from submit-queue

enable recursive processing in kubectl edit

This PR was split out of https://github.com/kubernetes/kubernetes/pull/23673 per @deads2k's suggestion: https://github.com/kubernetes/kubernetes/pull/23673#discussion_r61291178

It makes use of the recursive processing of a directory in `kubectl edit`
2016-06-24 23:59:54 -07:00
Sylwester Brzeczkowski a558cadedd Fix attach command for InitContainers 2016-06-24 14:35:02 +02:00
Mike Metral 6b172657b0 clarify recursive flag description 2016-06-17 08:35:44 -07:00
Dr. Stefan Schimanski 734f05057e Add pod-terminated check to kubectl-exec
Fixes https://github.com/openshift/origin/issues/8472#event-681794952
2016-06-16 19:44:47 +02:00
deads2k ac64404d86 let patch use local file content to mutate 2016-06-14 14:38:00 -04:00
k8s-merge-robot 0d02f8c0f6 Merge pull request #26557 from AdoHe/patch_retry
Automatic merge from submit-queue

kubectl apply retry stale resource version

```release-note
kubectl apply: retry applying a patch if a version conflict error is encountered
```

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

fixes #15493 
@pwittrock I just got my original implementation back, ptal.
2016-06-13 10:13:27 -07:00
Dr. Stefan Schimanski 65e2e63170 Set AttachOptions.CommandName from kubectl run using corba CommandPath
This sets AttachOptions.CommandName dynamically depending on the corba Command
hierarchy. If the root command is named e.g. "oc" (for the OpenShift cli) this
will result in "oc attach" instead of the static "kubectl attach" before this
patch.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1341450
2016-06-13 17:16:35 +02:00
k8s-merge-robot 2ef20b41f6 Merge pull request #26686 from metral/fix-get-output
Automatic merge from submit-queue

fix recursive & non-recursive kubectl get of generic output format

This PR fixes the issues with `kubectl get` in https://github.com/kubernetes/kubernetes/issues/26466

Changes made:
- fix printing when using the generic output format in both non-recursive & recurvise settings to ensure that errors are being shown
- add tests to check printing generic output in a **non-recursive** setting with non-existent pods
- clean up the **recursive** `kubectl get` tests

/cc @janetkuo
2016-06-11 14:26:31 -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
k8s-merge-robot 5a5c490a43 Merge pull request #27057 from janetkuo/kubectl-run-server-discovery
Automatic merge from submit-queue

Don't ignore error when Discovery().ServerResources() in kubectl run

Ref #27014
This doesn't fix the flake directly, but expose the error happened when the flake happens. 

@kubernetes/kubectl @caesarxuchao 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-08 23:49:04 -07:00
AdoHe 69bcdc20ff kubectl apply retry stale resource version 2016-06-09 00:14:17 -04:00
Matt Liggett d09af4a1d6 Stop 'drain' deleting pods with local storage.
Unless forced with --delete-local-data.  Also a refactoring of the
kubectl drain logic that selects/rejects pods and produces error/warning
messages.
2016-06-08 14:59:03 -07:00
Janet Kuo 75c3cbcbfb Don't ignore error when Discovery().ServerResources() in kubectl run 2016-06-08 10:34:09 -07: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
k8s-merge-robot 525140a278 Merge pull request #26693 from AdoHe/init_containers
Automatic merge from submit-queue

exec support init containers

Partially fixes #25818 
@smarterclayton ptal.
2016-06-03 10:13:49 -07:00
AdoHe 1cfcb24f37 exec support init container 2016-06-03 02:05:15 -04:00
Mike Metral 4409eed57f fix recursive & non-recursive kubectl get of generic output format 2016-06-02 21:46:15 -07:00
Brendan Burns 328a8392b1 Fix third party 2016-06-02 10:24:14 -07:00
k8s-merge-robot 8c66ffbddc Merge pull request #26581 from caesarxuchao/continue-25746
Automatic merge from submit-queue

fix kubectl patch example

Based on https://github.com/kubernetes/kubernetes/pull/25746, fix the kubectl example.

cc @tobstarr
2016-06-02 07:48:07 -07:00
Janet Kuo 4615d1e24c Add more information when throwing errors in discoverying 3rd party resources 2016-06-01 13:18:50 -07:00
Dr. Stefan Schimanski 026804c2be Fix kubectl --attach decription with deprecated --interactive 2016-06-01 13:21:39 +02: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
Chao Xu 216649b822 fix kubectl patch example 2016-05-31 11:45:12 -07:00
k8s-merge-robot d957e78a41 Merge pull request #25253 from soltysh/issue24533
Automatic merge from submit-queue

kubectl run --restart=Never creates pods

Fixes #24533.

@bgrant0607 @janetkuo ptal
/fyi @thockin

```release-note
* kubectl run --restart=Never creates pods
```
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-31 11:44:05 -07:00
k8s-merge-robot ae1fb82cfc Merge pull request #26073 from piosz/remove-metrics-group
Automatic merge from submit-queue

Removed metrics api group

```release-note
Removed metrics api group
```
The group is empty and unused. Kubelet Metrics API is defined in Kubelet code. Master Metrics API is defined in Heapster. Removing to avoid the confusion.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-05-31 03:50:24 -07:00
k8s-merge-robot c805303644 Merge pull request #26162 from jszczepkowski/kubectl-fix2
Automatic merge from submit-queue

Fixed check in kubectl autoscale.

```release-note
Fixed check in kubectl autoscale: cpu consumption can be higher than 100%.
```

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

Fixed check in kubectl autoscale: cpu consumption can be higher than 100%. Fixes #25815.
2016-05-31 03:00:05 -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