Commit Graph

355 Commits (3bda6884b83cfe17363e8d62f3df6eb02124ea87)

Author SHA1 Message Date
deads2k 3233ea6df2 fix hack/test-cmd 2016-08-02 10:27:29 -04:00
Jay Vyas 6166083c78 kill repo-root : test/e2e/serviceloadbalancers.go
bindata and yaml, Gobindata automation
bindata utils for generating, go generate
match server version
gitignore for dirty, ca, rbase, KUBE_ROOT, buildfix
(rebased jul-25,29)
2016-07-29 14:35:19 -04:00
Tim Hockin faeef5c4ae Use make as the main build tool
This allows us to start building real dependencies into Makefile.

Leave old hack/* scripts in place but advise to use 'make'.  There are a few
rules that call things like 'go run' or 'build/*' that I left as-is for now.
2016-07-12 21:52:00 -07:00
Cindy Wang fedc513658 Consolidated examples into storage/ and volume/ folders
Search and replace for references to moved examples

Reverted find and replace paths on auto gen docs

Reverting changes to changelog

Fix bugs in test-cmd.sh

Fixed path in examples README

ran update-all successfully

Updated verify-flags exceptions to include renamed files
2016-07-08 13:34:32 -07:00
k8s-merge-robot 1e33d117fe Merge pull request #28294 from ncdc/return-error-for-kubectl-get-singluar
Automatic merge from submit-queue

kubectl: don't display an empty list when trying to get a single resource that isn't found

Return immediately when attempting to get a singular resource that isn't found, so that we avoid
printing out a List if the output format is something like json or yaml.

Before:

```
$ kubectl get pod/foo -o yaml
apiVersion: v1
items: []
kind: List
metadata: {}
pods "foo" not found
```

After:

```
$ kubectl get pod/foo -o yaml
pods "foo" not found
```

Fixes #28243 

@kubernetes/kubectl @kubernetes/rh-ux @smarterclayton @liggitt @deads2k @metral
2016-07-01 13:40:45 -07:00
Jordan Liggitt 993ab1d886 Allow specifying secret data using strings 2016-06-30 16:03:47 -04:00
Andy Goldstein 67d929a3d2 Return immediately for singular get on error
Return immediately when attempting to get a singular resource that isn't found, so that we avoid
printing out a List if the output format is something like json or yaml.

Before:

```
$ kubectl get pod/foo -o yaml
apiVersion: v1
items: []
kind: List
metadata: {}
pods "foo" not found
```

After:

```
$ kubectl get pod/foo -o yaml
pods "foo" not found
```
2016-06-30 12:28:51 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
k8s-merge-robot 337805d1a7 Merge pull request #27816 from spxtr/no-travis
Automatic merge from submit-queue

Remove all traces of travis.
2016-06-28 03:53:34 -07:00
k8s-merge-robot 7d3d784655 Merge pull request #27902 from caesarxuchao/fix-test-cmd
Automatic merge from submit-queue

fix test-cmd multi-resource test

See inline descriptions.
2016-06-25 14:47:30 -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 b4c81a073a Merge pull request #25709 from asalkeld/null-deref
Automatic merge from submit-queue

Check for an empty value in validateField

```release-note
* Fix a panic when args was not supplied with any values.
```

reflect.TypeOf() can take a nil (it then returns a nil), but
Kind() panics on a nil.

Now the user gets the following output:
./kubectl.sh --server=http://localhost:8080 create -f ../../test-files/test-rc.yaml
error validating "../../test-files/test-rc.yaml": error validating data: unexpected nil value for field spec.template.spec.containers[0].args[0]; if you choose to ignore these errors, turn validation off with --validate=false

fixes #20627 and fixes #26927
2016-06-25 02:31:01 -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
Chao Xu 27f4eca5b3 fix test-cmd multi-resource test 2016-06-22 14:58:07 -07:00
Joe Finney ab4a65c10a Remove all traces of travis. 2016-06-21 15:58:34 -07:00
Michail Kargakis f3d2e3ff22 controller: proportionally scale paused and rolling deployments
Enable paused and rolling deployments to be proportionally scaled.
Also have cleanup policy work for paused deployments.
2016-06-20 12:13:35 +02:00
k8s-merge-robot 58eae670b9 Merge pull request #27231 from brendandburns/test-cmd.sh
Automatic merge from submit-queue

Add test-cmd.sh tests for 3rd party resources.

Adding more test coverage, this time of the client side behavior.

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-06-19 17:28:31 -07:00
k8s-merge-robot 6e3d37e314 Merge pull request #26399 from ixdy/jenkins-unittest-build
Automatic merge from submit-queue

Avoid duplicate building in Jenkins unit/integration job

Partially adopts #26392: don't run `hack/build-go.sh` in the unit/integration job, since we do that already for e2e.

We do need to still build kubectl, however, so do that in `hack/test-cmd.sh`.

x-ref #25940
2016-06-16 16:11:01 -07:00
deads2k ac64404d86 let patch use local file content to mutate 2016-06-14 14:38:00 -04:00
Brendan Burns 9ee25545a8 Add test-cmd.sh tests for 3rd party resources. 2016-06-11 20:56:13 -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
Jeff Grafton 65e10cf50c Avoid duplicate building in Jenkins unit/integration job 2016-06-10 16:42:17 -07:00
Piotr Szczesniak 1818b5b3fc Added hpa/v1 generator to kubectl autoscale 2016-06-10 09:26:35 +02:00
Mike Metral 4409eed57f fix recursive & non-recursive kubectl get of generic output format 2016-06-02 21:46:15 -07:00
k8s-merge-robot 6136d4c250 Merge pull request #25981 from liggitt/test-cmd-osx
Automatic merge from submit-queue

Allow running test-cmd on osx
2016-05-30 08:16:46 -07:00
Angus Salkeld 5dcbc7ce5b Check for an empty value in validateField
reflect.TypeOf() can take a nil (it then returns a nil), but
Kind() panics on a nil.

Fixes #20627
2016-05-30 14:12:18 +10:00
k8s-merge-robot 128e7f13af Merge pull request #26243 from metral/fix-pause
Automatic merge from submit-queue

use kubectl-with-retry on pause & resume

attempts to fix https://github.com/kubernetes/kubernetes/issues/25645 by using `kubectl-with-retry` on `rollout {pause,resume}` (`resume` is for safe measures) instead of `kubectl` directly, as is done with other `rollout {pause,resume}` tests in this same script.
2016-05-25 19:49:45 -07:00
Mike Metral 54e6d2356c use kubectl-with-retry on pause & resume 2016-05-25 13:37:57 -07:00
Janet Kuo 89df549016 Add pre-condition before editing pod in test-cmd.sh 2016-05-23 15:04:43 -07:00
Jordan Liggitt 33ae2b856e Allow running test-cmd on osx 2016-05-23 13:01:04 -04:00
Mike Metral 4913481b05 enable recursive processing in kubectl edit 2016-05-22 09:49:11 -07:00
k8s-merge-robot 39f0c6ba25 Merge pull request #24719 from bprashanth/kubectl_tls
Automatic merge from submit-queue

Add a kubectl create secret tls command

A somewhat hasty implementation that enables progress along: https://github.com/kubernetes/kubernetes/issues/20176#issuecomment-177409516, https://github.com/kubernetes/kubernetes/issues/24669, https://github.com/kubernetes/kubernetes/issues/20176#issuecomment-198142836 if associated parties have spare cycles. @kubernetes/kubectl

<!-- 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/24719)
<!-- Reviewable:end -->
2016-05-22 09:40:42 -07:00
Janet Kuo 4332472bde Add 'kubectl set image' 2016-05-18 21:23:17 -07:00
Prashanth Balasubramanian daa8e29c5b Add a kubectl create secret tls command 2016-05-16 22:38:56 -07:00
k8s-merge-robot 9cf6642531 Merge pull request #25110 from metral/recursive-rollout
Automatic merge from submit-queue

enable recursive processing in kubectl rollout

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-diff-61290415

It makes use of the recursive processing of a directory in `kubectl rollout {undo,pause,resume}` which now also conforms to the [command conventions](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/kubectl-conventions.md#command-implementation-conventions).

`kubectl rollout history` is being omitted for the time being as its encountering what appears to be an anomaly of an issue: https://github.com/kubernetes/kubernetes/issues/24606. Once this issue has been resolved I will modify it to be recursive
2016-05-15 06:14:21 -07:00
k8s-merge-robot 5d6c5f5af8 Merge pull request #25022 from zhouhaibing089/sort-fix
Automatic merge from submit-queue

Support struct,array,slice types when sorting kubectl output

Fixes https://github.com/kubernetes/kubernetes/issues/24328.

Briefly, `sorting_printer` only take cares of the following type kinds:

*   `reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64`
*   `reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64`
*   `reflect.Float32, reflect.Float64`
*   `reflect.String`
*   `reflect.Ptr`

This commit aims to add `reflect.Struct, reflect.Slice, reflect.Array`.

/cc @bgrant0607
2016-05-15 04:16:12 -07:00
Mike Metral 30f21fd431 enable recursive processing in kubectl rollout 2016-05-12 01:27:17 -07:00
Mike Metral 1737736960 fix filepath for cert_data 2016-05-11 13:07:45 -07:00
Phillip Wittrock 680b2b9d09 Kubectl support for validating nested objects with different ApiGroups (e.g. Lists containing objects in different api groups). Closes #24089 2016-05-09 19:38:40 -07:00
k8s-merge-robot 41b7b04faf Merge pull request #24554 from ingvagabund/dhodovska-events-flag-for-describers
Automatic merge from submit-queue

Introduce events flag for describers

Printing events for a given object is not always needed. Thus, introducing --show-events=false to ``kubectl describe`` to skip events printing.

Fixes: #24239
2016-05-08 14:41:28 -07:00
k8s-merge-robot 8a04506546 Merge pull request #23009 from uluyol/c-pause
Automatic merge from submit-queue

Reimplement 'pause' in C - smaller footprint all around

Statically links against musl. Size of amd64 binary is 3560 bytes.

I couldn't test the arm binary since I have no hardware to test it on, though I assume we want it to work on a raspberry pi.

This PR also adds the gcc5/musl cross compiling image used to build the binaries.

@thockin
2016-05-08 09:29:32 -07:00
Robert Bailey f0d4437fc7 Merge pull request #24769 from smarterclayton/testcmd_on_mac
Allow test-cmd to run on non-Linux OS
2016-05-06 13:54:43 -07:00
Jan Chaloupka dd2c9c578d Introduce kubectl describe --show-events
Introduce DescriberSettings for Describer display options
Introduce --show-events flag and DescriberSettings in Describer methods
Introduce unit-tests
Regenerated kubectl describe docs
Add events flag tests to test-cmd.sh

Signed-off-by: dhodovsk@redhat.com
Signed-off-by: jchaloup@redhat.com
2016-05-06 11:40:11 +02:00
Clayton Coleman e0ebcf4216
Split the storage and negotiation parts of Codecs
The codec factory should support two distinct interfaces - negotiating
for a serializer with a client, vs reading or writing data to a storage
form (etcd, disk, etc). Make the EncodeForVersion and DecodeToVersion
methods only take Encoder and Decoder, and slight refactoring elsewhere.

In the storage factory, use a content type to control what serializer to
pick, and use the universal deserializer. This ensures that storage can
read JSON (which might be from older objects) while only writing
protobuf. Add exceptions for those resources that may not be able to
write to protobuf (specifically third party resources, but potentially
others in the future).
2016-05-05 12:08:23 -04:00
Piotr Szczesniak caa96f4cf3 Merge pull request #25133 from jayunit100/c2fix
flake fix for cassandra:cassandra
2016-05-05 10:00:00 +02:00
Muhammed Uluyol f3690e2d5e
build/pause: write in C
Builds statically against glibc. References to the old pause
image have been updated.
2016-05-04 21:45:52 -04:00
jay vyas 7a824aaf49 Cassandra de-flake 2016-05-04 21:11:56 -04:00
zhouhaibing089 09d4d5ed78 let type struct,array,slice also being considerred when sorting kubectl output 2016-05-02 23:17:18 +08:00
k8s-merge-robot f500194d92 Merge pull request #23673 from metral/multiple-resources
Automatic merge from submit-queue

allow kubectl subcmds to process multiple resources

~~autoscale, expose & patch~~ Many kubectl subcommands were limited to processing one resource at a time.

This PR allows those subcommands to process multiple resources.

This PR is in reference to https://github.com/kubernetes/kubernetes/pull/23116#issuecomment-202360784 by @deads2k
2016-05-02 07:09:44 -07:00
Mike Metral 999c8e211e allow kubectl subcmds to process multiple resources
- use resource.Visit() to recursively process resources, as well as, aggregate
errors where possible
2016-05-01 20:27:37 -07:00