Commit Graph

2063 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
k8s-merge-robot 084b598f4d Merge pull request #25876 from dshulyak/patch_change
Automatic merge from submit-queue

Use strategic patch to replace changeCause in patch command

This is partial rework of 11da9a7638
StrategicPatch will be used to update changeCause but failure wont affect command result

fixes: #24858
2016-06-29 08:34:50 -07:00
k8s-merge-robot 7f3da674f7 Merge pull request #26680 from olegshaldybin/fake-clientset-registry
Automatic merge from submit-queue

Track object modifications in fake clientset

Fake clientset is used by unit tests extensively but it has some
shortcomings:

- no filtering on namespace and name: tests that want to test objects in
  multiple namespaces end up getting all objects from this clientset,
  as it doesn't perform any filtering based on name and namespace;

- updates and deletes don't modify the clientset state, so some tests
  can get unexpected results if they modify/delete objects using the
  clientset;

- it's possible to insert multiple objects with the same
  kind/name/namespace, this leads to confusing behavior, as retrieval is
  based on the insertion order, but anchors on the last added object as
  long as no more objects are added.

This change changes core.ObjectRetriever implementation to track object
adds, updates and deletes.

Some unit tests were depending on the previous (and somewhat incorrect)
behavior. These are fixed in the following few commits.
2016-06-29 06:04:33 -07:00
Dmitry Shulyak d81f7a0f22 Use strategic patch to replace changeCause in patch command 2016-06-29 15:20:38 +03:00
k8s-merge-robot de0c033570 Merge pull request #27358 from lukaszo/restarts
Automatic merge from submit-queue

Show restart count for init containers

Coutner is reset for normal containers.
fixes issue: #26892
2016-06-29 03:22:10 -07:00
k8s-merge-robot 1a1a4709b9 Merge pull request #28093 from dubstack/dubstack-refactor-qos2
Automatic merge from submit-queue

[Refactor] Make QoS naming consistent across the codebase

@derekwaynecarr @vishh PTAL. Can one of you please attach a LGTM.
2016-06-29 02:36:22 -07:00
nikhiljindal 88b10b1dc0 Removing unneeded fields from Cluster API object 2016-06-28 17:12:57 -07: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
Oleg Shaldybin 3b15d5be19 Use correct namespace in unit tests that use fake clientset
Fake clientset no longer needs to be prepopulated with records: keeping
them in leads to the name conflict on creates. Also, since fake
clientset now respects namespaces, we need to correctly populate them.
2016-06-28 11:26:34 -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
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
Buddha Prakash 4acb64f8bd Make Qos naming consistent across the codebase 2016-06-26 16:19:47 -07:00
k8s-merge-robot d64333419c Merge pull request #27749 from dubstack/dubstack-refactor-qos
Automatic merge from submit-queue

[Refactor] QOS to have QOS Class type for QoS classes

This PR adds a QOSClass type and initializes QOSclass constants for the three QoS classes.
It would be good to use this in all future QOS related features. 
This would be good to have for the (Pod level cgroups isolation proposal)[https://github.com/kubernetes/kubernetes/pull/26751] that i am working on aswell.
@vishh PTAL
 
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-26 06:23:23 -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
Buddha Prakash c3551ae6cd Refactor qos package
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-24 15:36:04 -07:00
k8s-merge-robot ce0227bb8b Merge pull request #27402 from pwittrock/owners
Automatic merge from submit-queue

Remove bgrant from owners since he has plenty to do.

@bgrant0607 FYI

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-24 13:56:59 -07:00
Sylwester Brzeczkowski a558cadedd Fix attach command for InitContainers 2016-06-24 14:35:02 +02:00
Janet Kuo ee81e5ebfa Retry Pod/RC updates in kubectl rolling-update 2016-06-21 16:08:10 -07:00
k8s-merge-robot 1fd4047961 Merge pull request #27549 from Clarifai/eventorder
Automatic merge from submit-queue

swap FIRSTSEEN/LASTSEEN columns in `kubectl get event -w`

```release-note
Show LASTSEEN, the sorting key, as the first column in `kubectl get event` output
```
Not having LASTSEEN as the first column can confuse users into thinking
that events are not delivered in order.

Fixes #27060
2016-06-21 00:09:53 -07:00
k8s-merge-robot ca76cc0e9f Merge pull request #27566 from metral/clarify-docs
Automatic merge from submit-queue

clarify kubectl recursive flag description

Clarify the description of the recursive flag in `kubectl` so that it's more intuitive to the user

This should make it into v1.3 as the rest of the recursive feature PR's will be available in 1.3
2016-06-20 13:06:40 -07:00
k8s-merge-robot b613908cf2 Merge pull request #27365 from derekwaynecarr/describe_allocatable
Automatic merge from submit-queue

kubectl describe node is allocatable aware

`kubectl describe node` will render node.status.allocatable if present.

in addition, it will report allocated resources relative to node.status.allocatable if present instead of capacity.

old code was confusing if you setup system-reserved and kube-reserved as allocated resource percentages were relative to node capacity and not schedulable amount of resources.

this is a small but valuable usability improvement, so i think it would be good to make 1.3 milestone.

/cc @kubernetes/sig-node @kubernetes/rh-cluster-infra @kubernetes/kubectl @davidopp
2016-06-20 13:06:35 -07:00
k8s-merge-robot 3df228fd76 Merge pull request #27431 from jsafrane/pv-events-print
Automatic merge from submit-queue

'kubectl describe pv' now shows events
2016-06-19 15:31:55 -07:00
goltermann 218645b346 Fix several spelling errors in comments. 2016-06-17 10:41:18 -07:00
Mike Metral 6b172657b0 clarify recursive flag description 2016-06-17 08:35:44 -07:00
Rudi Chiarito bf873df1ee swap FIRSTSEEN/LASTSEEN columns in `kubectl get event`
Not having LASTSEEN as the first column can confuse users into thinking
that events are not delivered in order.

Fixes #27060
2016-06-16 14:39:41 -04: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
Phillip Wittrock 0ed3bd63e4 Remove bgrant from pkg/OWNERS and pkg/kubectl/OWNERS since he has plenty to do. 2016-06-16 08:21:27 -07:00
Jan Safranek e1e9a41757 Show events in 'kubectl describe pv' 2016-06-15 14:17:02 +02:00
deads2k ac64404d86 let patch use local file content to mutate 2016-06-14 14:38:00 -04:00
derekwaynecarr 65764c8ed2 kubectl describe node is allocatable aware 2016-06-14 13:06:47 -04:00
Łukasz Oleś 11e1188dbe Show restart count for init containers
Coutner is reset for normal containers.
fixes issue: #26892
2016-06-14 14:35:37 +02: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 98f0d22bcc Merge pull request #26975 from ericchiang/kubectl-resource-printer-for-rbac-group
Automatic merge from submit-queue

pkg/kubectl: add resource printers for rbac api group

This PR adds the necessary kubectl printers for the rbac api group which we overlooked in previous PRs.

cc @erictune
2016-06-12 17:13:55 -07: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