Commit Graph

481 Commits (5b214bbac5468b377437788b49a042adc4e97898)

Author SHA1 Message Date
Janet Kuo d0b5de855f Add a test for semantically equal DaemonSet updates 2017-03-21 16:06:34 -07:00
deads2k 36cb9ed640 add singular resource names to discovery 2017-03-21 11:04:08 -04:00
shashidharatd 7943ed7585 Use CoreDNS provider for starting federation controller manager in kubectl tests 2017-03-18 23:00:30 +05:30
Jordan Liggitt 9cd791e83c
Retry kubectl test replace on conflict 2017-03-16 08:39:47 -04:00
Maciej Szulik aa4390750c Introduce new generator for apps/v1beta1 deployments 2017-03-10 12:08:01 +01:00
nikhiljindal 3b8ba56e7d Enable secret tests 2017-03-07 15:40:20 -08:00
nikhiljindal ded881db20 Set wait for deletion for federation apiserver kubectl tests 2017-03-07 15:40:20 -08:00
Anthony Yeh cec3899b96 Deployment: Remove Overlap and SelectorUpdate annotations.
These are not used anymore since ControllerRef now protects against
fighting between controllers with overlapping selectors.
2017-03-06 15:12:08 -08:00
Kubernetes Submit Queue db4fbf5958 Merge pull request #42369 from smarterclayton/get_warning
Automatic merge from submit-queue

Output of `kubectl get` is inconsistent for pods

Builds on top of fixes from #42283, only the last two commits are new. Reverts behavior of #39042 which was inconsistent and confusing.

Fixes #15853
2017-03-03 23:12:38 -08:00
Kubernetes Submit Queue f7c07a121d Merge pull request #42285 from liggitt/get-watch
Automatic merge from submit-queue (batch tested with PRs 41919, 41149, 42350, 42351, 42285)

Fix error printing objects from kubectl get -w

Fixes #42276
2017-03-03 16:44:45 -08:00
Kubernetes Submit Queue 66a0311fd3 Merge pull request #42429 from kargakis/sts-observed-generation-fix
Automatic merge from submit-queue (batch tested with PRs 42365, 42429, 41770, 42018, 35055)

controller: statefulsets respect observed generation

StatefulSets do not update ObservedGeneration even though the API field is in place. This means that clients can never be sure whether the StatefulSet controller has observed the latest spec of a StatefulSet.

@kubernetes/sig-apps-bugs
2017-03-03 09:24:42 -08:00
Clayton Coleman 34e4337e57
Don't print the "filtered" message on generic output
Unify the various output displays and make them simpler. Don't write to
glog, but only output the info when `-v 2` to stderr.
2017-03-02 15:58:25 -05:00
Michail Kargakis dbab67aa32 controller: statefulsets respect observed generation 2017-03-02 19:43:06 +01:00
Clayton Coleman b78321c67f
Fix test cases with more details 2017-03-02 08:28:54 -05:00
Jan Safranek 584b57b8b4 Add storage.k8s.io/v1 2017-03-02 08:55:25 +01:00
Maciej Szulik c272630b1b Deployments under apps/v1beta1 with new defaults 2017-03-01 15:14:41 +01:00
Jordan Liggitt 31b3e01f1e
Fix error printing objects from kubectl get -w 2017-02-28 22:36:26 -05:00
Kubernetes Submit Queue 0bc16d8966 Merge pull request #40576 from nikhiljindal/kubectlcascDel
Automatic merge from submit-queue (batch tested with PRs 41994, 41969, 41997, 40952, 40576)

Updating kubectl to send delete requests with orphanDependents=false if --cascade is true

Ref https://github.com/kubernetes/kubernetes/issues/40568 #38897

Updating kubectl to always set `DeleteOptions.orphanDependents=false` when deleting a resource with `--cascade=true`.
This is primarily for federation where we want to use server side cascading deletion.

Impact on kubernetes: kubectl will do another GET after sending a DELETE and wait till the resource is actually deleted. This can have an impact if the resource has a finalizer. kubectl will wait till the finalizer is removed and then the resource is deleted, which is the right thing to do but a notable change in behavior.

cc @caesarxuchao @lavalamp @smarterclayton @kubernetes/sig-federation-pr-reviews @kubernetes/sig-cli-pr-reviews
2017-02-26 12:58:01 -08:00
Jordan Liggitt 41c88e0455
Revert "Merge pull request #40088 from jsafrane/storage-ga-v1"
This reverts commit 5984607cb9, reversing
changes made to 067f92e789.
2017-02-25 22:35:15 -05:00
Kubernetes Submit Queue 5984607cb9 Merge pull request #40088 from jsafrane/storage-ga-v1
Automatic merge from submit-queue (batch tested with PRs 41854, 41801, 40088, 41590, 41911)

Add storage.k8s.io/v1 API

v1 API is direct copy of v1beta1 API. This v1 API gets installed and exposed in this PR, I tested that kubectl can create both v1beta1 and v1 StorageClass.

~~Rest of Kubernetes (controllers, examples,. tests, ...) still use v1beta1 API, I will update it when this PR gets merged as these changes would get lost among generated code.~~ Most parts use v1 API now, it would not compile / run tests without it.

**Release note**:
```
Kubernetes API storage.k8s.io for storage objects is now fully supported and is available as storage.k8s.io/v1. Beta version of the API storage.k8s.io/v1beta1 is still available in this release, however it will be removed in a future Kubernetes release.

Together with the API endpoint, StorageClass annotation "storageclass.beta.kubernetes.io/is-default-class" is deprecated and  "storageclass.kubernetes.io/is-default-class" should be used instead to mark a default storage class. The beta annotation is still working in this release, however it won't be supported in the next one.
```

@kubernetes/sig-storage-misc
2017-02-25 05:02:55 -08:00
Kubernetes Submit Queue e40b55f8b4 Merge pull request #41843 from yujuhong/do-not-run-kubelet
Automatic merge from submit-queue (batch tested with PRs 40665, 41094, 41351, 41721, 41843)

Do not run kubelet in test-cmd.sh

The tests are intended to test only `kubectl` commands and do not
require kubelet.

This fixes #41834

/cc @Random-Liu @dchen1107 @nikhiljindal
2017-02-25 03:56:59 -08:00
Jan Safranek 3f6caca97a Add storage.k8s.io/v1 2017-02-24 13:34:18 +01:00
nikhiljindal b6e2a09c2b Add cascading deletion test cases to kubectl tests 2017-02-23 12:04:13 -08:00
Xing Zhou 433941f1fd Added `kubectl create clusterrole` command.
Added `kubectl create clusterrole` command.
2017-02-22 10:30:41 +08:00
Yu-Ju Hong 84d46cc477 Do not run kubelet in test-cmd.sh
The tests are intended to test only `kubectl` commands and do not
require kubelet.
2017-02-21 14:53:44 -08:00
Jeff Grafton 3dc0c748c8 Ignore bazel-* directories when looking for tests to run 2017-02-17 14:03:56 -08:00
Maru Newby 98f5c362ff test-federation.sh: Make use of WHAT consistent with make test
test-integration.sh was using the first positional arg passed to WHAT
to filter the list of integration test packages.  This change switches
to passing WHAT verbatim to be consistent with how make test works.
2017-02-16 10:53:58 -08:00
Kubernetes Submit Queue 92360ffc5f Merge pull request #41439 from deads2k/apiserver-12-sample-fuzz
Automatic merge from submit-queue (batch tested with PRs 41104, 41245, 40722, 41439, 41502)

add sample fuzzing tests

Make fuzzing tests as simple as possible from both the API installer and the scheme, so its easy to add for api groups and so that I can build a scheme and then make sure I got it right.

@kubernetes/sig-api-machinery-pr-reviews @sttts @mikedanese
2017-02-15 16:28:11 -08:00
Maru Newby c762057a7c test-integration.sh: Exit after running a test case 2017-02-15 15:23:32 -08:00
Maru Newby ae91e0452f test-integration.sh: Avoid unnecessary etcd cleanup 2017-02-15 15:21:44 -08:00
Kubernetes Submit Queue fbc94c0896 Merge pull request #41343 from p0lyn0mial/kubectl_get_short_names_from_discovery_api
Automatic merge from submit-queue

shortcut expander will take the list of short names from the api ser…

**What this PR does / why we need it**: the shortcut expander will take the list of short names for resources from the API server during the discovery. For backward compatibility a hardcoded list of short names will always be appended while evaluating a short name.
2017-02-15 09:07:51 -08:00
deads2k 2d5fe9d855 add sample fuzzing tests 2017-02-15 10:34:44 -05:00
p0lyn0mial 98068b6367 shortcut expander will take the list of short names from the api server. 2017-02-15 09:06:47 +01:00
deads2k 1d40c3ff76 update scripts for new kube-aggregator location 2017-02-14 14:16:59 -05:00
Kubernetes Submit Queue beaf5ffacc Merge pull request #39852 from xingzhou/kube-39596
Automatic merge from submit-queue

Added kubectl create role command

Added `kubectl create role` command.

Fixed part of #39596 

**Release note**:
```
   Added one new command `kubectl create role` to help user create a single role from command line.
```
2017-02-13 08:40:50 -08:00
Kubernetes Submit Queue 899ddbcfc6 Merge pull request #41259 from alejandroEsc/ae/make_help/ansi
Automatic merge from submit-queue (batch tested with PRs 41259, 41260)

remove hardcoded ansi color coding for `make help` 

to tput so that color coding works in multiple platforms including osx.

**What this PR does / why we need it**: 
should try not to use hardcoded ansi escape characters.

**Release note**:
```NONE
```
2017-02-10 16:53:38 -08:00
Alejandro Escobar 0314bcdbba remove hardcoded ansi to tput so that color coding works in multiple platforms including osx. 2017-02-10 10:25:43 -08:00
Kubernetes Submit Queue f9215e8fb3 Merge pull request #41058 from liggitt/v1-tokenreview
Automatic merge from submit-queue (batch tested with PRs 41112, 41201, 41058, 40650, 40926)

Promote TokenReview to v1

Peer to https://github.com/kubernetes/kubernetes/pull/40709

We have multiple features that depend on this API:

- [webhook authentication](https://kubernetes.io/docs/admin/authentication/#webhook-token-authentication)
- [kubelet delegated authentication](https://kubernetes.io/docs/admin/kubelet-authentication-authorization/#kubelet-authentication)
- add-on API server delegated authentication

The API has been in use since 1.3 in beta status (v1beta1) with negligible changes:
- Added a status field for reporting errors evaluating the token

This PR promotes the existing v1beta1 API to v1 with no changes

Because the API does not persist data (it is a query/response-style API), there are no data migration concerns.

This positions us to promote the features that depend on this API to stable in 1.7

cc @kubernetes/sig-auth-api-reviews @kubernetes/sig-auth-misc

```release-note
The authentication.k8s.io API group was promoted to v1
```
2017-02-10 01:40:44 -08:00
Kubernetes Submit Queue 45d122dd6b Merge pull request #36033 from DirectXMan12/feature/hpa-v2
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)

HPA v2 (API Changes)

**Release note**:
```release-note
Introduces an new alpha version of the Horizontal Pod Autoscaler including expanded support for specifying metrics.
```

Implements the API changes for kubernetes/features#117.

This implements #34754, which is the new design for the Horizontal Pod Autoscaler.  It includes improved support for custom metrics (and/or arbitrary metrics) as well as expanded support for resource metrics.  The new HPA object is introduces in the API group "autoscaling/v1alpha1".

Note that the improved custom metric support currently is limited to per pod metrics from Heapster -- attempting to use the new "object metrics" will simply result in an error.  This will change once #34586 is merged and implemented.
2017-02-10 00:04:48 -08:00
Kubernetes Submit Queue 2b2af10a50 Merge pull request #41181 from tanshanshan/fix-wrong-shell
Automatic merge from submit-queue (batch tested with PRs 40917, 41181, 41123, 36592, 41183)

fix scheduler performance test script 

**What this PR does / why we need it**:

 

 `test-performance.sh` is  in  dir `kubernetes/test/integration/scheduler_perf`

the  dir `kubernetes/test/component/scheduler/perf`  does not exist

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-09 23:10:44 -08:00
tanshanshan 94b8c43b84 fix the wrong test path 2017-02-09 15:16:11 +08:00
Kubernetes Submit Queue a326735ea0 Merge pull request #40175 from apprenda/kubeadm-40155-test-skip
Automatic merge from submit-queue (batch tested with PRs 40175, 41107, 41111, 40893, 40919)

kubeadm: skip integration tests if kubeadm-cmd-skip flag passed

Will skip integration tests for token generation if it can't find a file by the given --kubeadm-path or default value.

**What this PR does / why we need it**: Tests would fail if just running `go test` in the dir because it expects to have more values. This won't change the behavior of `make test-cmd` which gets run here:
https://github.com/kubernetes/kubernetes/blob/master/Makefile#L258

**Which issue this PR fixes**: fixes #40155 

**Special notes for your reviewer**: /cc @pires @pipejakob @liggitt 

```release-note
NONE
```
2017-02-08 01:47:37 -08:00
Xing Zhou b9c6fb52ab Added unit tests for kubectl create role command.
Added unit tests for kubectl create role command.
2017-02-08 13:30:10 +08:00
Solly Ross 86c430b881 Introduce HPA v2 API Objects
This commit introduces the autoscaling/v2alpha1 API group, which
currently contains the first alpha of the new HorizontalPodAutoscaler
object.
2017-02-07 17:20:14 -05:00
Derek McQuay 1459bbade4
kubeadm: updated cmd tests as discussed in SIG
After today's SIG meeting, it was discussed how to proceed with these
types of test-cmd tests.  They will live in kubeamd/test/cmd and will
provide a flag that will allow you to skip them (--kubeadm-cmd-skip) and
by default will fail if kubeadm binary is not present
2017-02-07 12:47:07 -08:00
Kubernetes Submit Queue 3f6dd889f3 Merge pull request #40985 from p0lyn0mial/add_shortnames_to_discovery_api
Automatic merge from submit-queue (batch tested with PRs 40980, 40985)

added short names for resources which are exposed during discovery

**What this PR does / why we need it**:
The changes add short names for resources. The short names will be delivered to kubectl during discovery.
2017-02-07 06:21:10 -08:00
Jordan Liggitt 09b5d7279f
install authentication.k8s.io/v1, add tests 2017-02-07 01:44:56 -05:00
Jordan Liggitt 8706bc9617
install authorization.k8s.io/v1, add tests
Use specific v1beta1 Authorization client

Add client expansions
2017-02-06 18:16:51 -05:00
p0lyn0mial b2cce0ac8e added short names for resources which are exposed during discovery 2017-02-06 23:35:07 +01:00
ymqytw 710d904998 add apply cmd tests for TPR 2017-02-02 15:20:45 -08:00
Kubernetes Submit Queue 9805b0bdfb Merge pull request #40729 from sttts/sttts-client-go-examples
Automatic merge from submit-queue (batch tested with PRs 40812, 39903, 40525, 40729)

Add CI coverage for client-go and staging/copy.sh

Client-go master and `staging/copy.sh` keep breaking, leading to frustration of users outside of the inner refactoring circle. This PR adds minimal smoke testing for both.

**Note**: this enforces the split of PRs which change apimachinery and client-go in parallel (via some local "temporary commit" hacking).

- [x] @caesarxuchao ~~do we have to delete the example directory from the upstream repo?~~ merge https://github.com/kubernetes/test-infra/issues/1765
2017-02-02 13:57:50 -08:00
Kubernetes Submit Queue 8a8f6ca849 Merge pull request #40525 from lucab/to-k8s/node-e2e-local-cri
Automatic merge from submit-queue (batch tested with PRs 40812, 39903, 40525, 40729)

test/node_e2e: wire-in cri-enabled local testing

This commit wires-in the pre-existing `--container-runtime` flag for
local node_e2e testing.
This is needed in order to further skip docker specific testing
and validation.

Local CRI node_e2e can now be performed via
`make test-e2e-node RUNTIME=remote REMOTE=false`
which will also take care of passing the appropriate argument to
the kubelet.
2017-02-02 13:57:48 -08:00
Dr. Stefan Schimanski 880cbd5d7b client-go: enable smoke compile test for examples 2017-02-02 20:28:32 +01:00
Piotr Szczesniak a35ad8f6ba Removed HPA objects from extensions api group 2017-02-02 14:09:54 +01:00
Luca Bruno 42bdbe5c82
test/node_e2e: wire-in "container-runtime" for local tests
This commit wires-in the pre-existing `--container-runtime` flag for
local node_e2e testing.
This is needed in order to further skip docker specific testing
and validation.

Local CRI node_e2e can now be performed via
`make test-e2e-node RUNTIME=remote REMOTE=false`
which will also take care of passing the appropriate arguments to
the kubelet.
2017-02-01 20:34:51 +00:00
Jordan Liggitt cf74abd892
fixup apply null tests 2017-01-31 15:00:23 -05:00
Anastasis Andronidis 4bdcc03c0b
test for explicit null value propagation in apply 2017-01-31 14:22:24 -05:00
Kubernetes Submit Queue 25de8ef641 Merge pull request #40551 from juanvallejo/jvallejo/only-output-no-resources-found-for-human-readable-printer
Automatic merge from submit-queue (batch tested with PRs 40691, 40551, 40683, 40700, 40702)

only output "No resources found." for human readable printers

**Release note**:
```release-note
release note none
```

This patch removes the message `No resources found` (currently printed through stderr) when printing through a generic / non-human-readable printer (json, yaml, jsonpath, custom-columns).

**Before***
```
$ kubectl get pods -o json
No resources found.
{
    "apiVersion": "v1",
    "items": [],
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
}
```

**After**
```
$ kubectl get pods -o json
{
    "apiVersion": "v1",
    "items": [],
    "kind": "List",
    "metadata": {},
    "resourceVersion": "",
    "selfLink": ""
}
```

cc @fabianofranz @stevekuznetsov
2017-01-30 19:14:41 -08:00
Kubernetes Submit Queue 2623f7c456 Merge pull request #40549 from jessfraz/40433-reenable-cascading-deployment
Automatic merge from submit-queue

re-enable cascading deployment

I couldn't reproduce #40433 locally sooo trying on the test infra to make sure I'm not crazy
2017-01-29 23:51:27 -08:00
juanvallejo 5ec2a4c3ca only output "No resources found." for human readable printers 2017-01-27 13:30:23 -05:00
Kubernetes Submit Queue d718e40594 Merge pull request #40567 from nikhiljindal/secretDel
Automatic merge from submit-queue

Temporary disable federation kubectl tests for secrets to unblock merge queue

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

cc @kubernetes/sig-federation-misc @deads2k
2017-01-27 08:34:50 -08:00
Jordan Liggitt 17168aaacc
Test generic operations with thirdpartyresources 2017-01-26 19:59:27 -05:00
nikhiljindal f4d4b2c578 Temporary disable federation kubectl tests for secrets to unblock merge queue 2017-01-26 15:43:56 -08:00
Jess Frazelle 00cdc06103
re-enable cascading deployment
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-26 12:51:11 -08:00
Jordan Liggitt 5676b9a252
Temporarily disable cascading deployment delete in test-cmd-util.sh
Re-enabling tracked in https://github.com/kubernetes/kubernetes/issues/40433
2017-01-25 13:34:16 -05:00
Jordan Liggitt 903787ab2c
Tolerate existing kubernetes service in test-cmd.sh 2017-01-25 13:34:16 -05:00
Jordan Liggitt d47f898500
Re-enable test-cmd.sh tests 2017-01-25 13:34:16 -05:00
Kubernetes Submit Queue f545d6ad47 Merge pull request #40057 from MrHohn/kubectl-create-seletor
Automatic merge from submit-queue (batch tested with PRs 40328, 40057)

Allows kubectl create -f to filter by selector.

From #32544.

The underlying `seletor` infrastructrue was implemented by #32599. The test is basically copy-paste of the corresponding test for `kubectl apply -f -l`.

```release-note
kubectl create now accepts the label selector flag for filtering objects to create
```
2017-01-23 22:19:11 -08:00
deads2k 4f915039e4 move pkg/client/transport to client-go 2017-01-18 07:56:01 -05:00
Zihong Zheng 6b9860cf54 Allows kubectl create -f to filter by selector. 2017-01-17 19:18:51 -08:00
Kubernetes Submit Queue 3aa29bca4f Merge pull request #40009 from kargakis/fix-dryrun-for-rollout
Automatic merge from submit-queue (batch tested with PRs 39911, 40002, 39969, 40012, 40009)

kubectl: fix rollback dryrun when version is not specified

@kubernetes/sig-cli-misc
2017-01-17 06:47:00 -08:00
Michail Kargakis 9c820a5793 kubectl: fix rollback dryrun when version is not specified 2017-01-17 12:01:09 +01:00
Clayton Coleman 62d1ae96c1
Generate for staging directories that are not client-go 2017-01-16 16:13:29 -05:00
Kubernetes Submit Queue 17a6f41367 Merge pull request #39859 from k82cn/test_script
Automatic merge from submit-queue (batch tested with PRs 39947, 39936, 39902, 39859, 39915)

Moved _pkg to embeded script.

fixes #39840
2017-01-16 09:26:17 -08:00
Andy Goldstein cb39d0d811 Fix expected error text 2017-01-13 16:58:16 -05:00
Klaus Ma c1f4565293 Moved _pkg to embeded script. 2017-01-13 16:03:19 +08:00
Kubernetes Submit Queue 6e5b455b77 Merge pull request #39038 from ncdc/fix-kubectl-get-list
Automatic merge from submit-queue

Fix kubectl get -f <file> -o <nondefault printer> so it prints all items in the file

**What this PR does / why we need it**: Fix kubectl get -f <file> -o <nondefault printer> so it prints all the objects in the file, instead of just the first one. Also add a test for this feature.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```

cc @AdoHe @deads2k @liggitt @fabianofranz @kubernetes/kubectl @kubernetes/sig-cli-misc
2017-01-11 09:58:38 -08:00
Andy Goldstein 613ada4cd7 Fix kubectl get -f <file> -o <nondefault printer>
Fix kubectl get -f <file> -o <nondefault printer> so it prints all the
objects in the file, instead of just the first one. Also add a test for
this feature.
2017-01-11 10:30:13 -05:00
deads2k 70778cccfe k8s.io/apimachinery scripts 2017-01-11 08:15:34 -05:00
Andy Goldstein 80c5cd8b88 Allow missing keys in templates by default
Switch to allowing missing keys in jsonpath templates by default.

Add support for allowing/disallowing missing keys in go templates
(default=allow).

Add --allow-missing-template-keys flag to control this behavior
(default=true / allow missing keys).
2017-01-09 10:35:46 -05:00
deads2k a672b501df add apiserver to list of unit tested packages 2017-01-05 11:09:42 -05:00
Kubernetes Submit Queue 6b70211568 Merge pull request #38844 from nikhiljindal/fednewkubectlTests
Automatic merge from submit-queue

Adding test-federation-cmd.sh to test kubectl with federation apiserver

There are 2 parts to the PR:
* Adding ability to run kubectl tests for a subset of resources.
* Adding test-federation-cmd.sh that runs kubectl tests for resources that are supported by federation-apiserver.

cc @kubernetes/sig-federation @kubernetes/sig-api-machinery 

```release-note
Adding kubectl tests for federation
```
2017-01-04 13:07:17 -08:00
nikhiljindal 5424d50c03 Adding test-federation-cmd.sh to test kubectl with federation apiserver 2017-01-04 11:17:05 -08:00
deads2k 442d2c1404 move pkg/auth/user to staging 2017-01-04 10:27:04 -05:00
Kubernetes Submit Queue 34ea3a17af Merge pull request #39001 from xilabao/fix-group-in-create-clusterrolebinding
Automatic merge from submit-queue

fix group in create clusterrolebinding

group lost.

```
#kubectl create clusterrolebinding test --clusterrole=a --group=b
clusterrolebinding "test" created

#kubectl get clusterrolebinding test -o yaml
apiVersion: rbac.authorization.k8s.io/v1alpha1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: 2016-12-20T03:13:24Z
  name: test
  resourceVersion: "284"
  selfLink: /apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindingstest
  uid: 44d3476d-c662-11e6-a439-7427ea6f0fe3
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: a
subjects: null
```
2017-01-03 16:49:24 -08:00
Kubernetes Submit Queue 9a0a724313 Merge pull request #39067 from xilabao/fix-newconfig-file-in-test-cmd
Automatic merge from submit-queue (batch tested with PRs 39076, 39068, 39067)

fix the newconfig.yaml in test-cmd.sh

fix #39066
2016-12-22 00:54:22 -08:00
xilabao 6b19a711ec fix group in create clusterrolebinding 2016-12-22 10:14:11 +08:00
Jeff Grafton 05c09b1aa3 Disable verify-test-owners.sh and make `go vet` more obvious 2016-12-21 11:44:04 -08:00
deads2k 8b25c21e79 add create rolebinding 2016-12-21 09:03:27 -05:00
Angus Salkeld 17a711d8fd Add new command "kubectl set selector" 2016-12-21 12:30:56 +01:00
xilabao 695e5ddb24 fix the newconfig.yaml in test-cmd.sh 2016-12-21 15:11:35 +08:00
Brendan Burns ab0e245bc6 Add a KUBERNETES_NODE_* section to build kubelet/kube-proxy for windows 2016-12-17 21:07:18 -08:00
Kubernetes Submit Queue 6c9a4139f3 Merge pull request #38614 from soltysh/remove_ext_jobs
Automatic merge from submit-queue (batch tested with PRs 37468, 36546, 38713, 38902, 38614)

Remove extensions/v1beta1 Job

Fixes https://github.com/kubernetes/kubernetes/issues/32763. This endpoint was deprecated in 1.5 and was planned to be removed in 1.6. 

**Release note**:
```release-note
Remove extensions/v1beta1 Jobs resource, and job/v1beta1 generator.
```
2016-12-16 18:55:37 -08:00
Matt Liggett 69cd805532 Merge pull request #38804 from Random-Liu/disable-au
Node E2E: Disable AU in node e2e test.
2016-12-16 15:32:23 -08:00
Maciej Szulik 9f064c57ce Remove extensions/v1beta1 Job 2016-12-17 00:07:24 +01:00
Kubernetes Submit Queue 0d80ee0b8d Merge pull request #38767 from kargakis/fix-setting-container-name-in-create-deployment
Automatic merge from submit-queue

kubectl: fix 'create deployment' to set container name correctly

@kubernetes/kubectl @kubernetes/sig-cli
2016-12-16 04:38:22 -08:00
Random-Liu e5efc21de6 Disable AU in node e2e test. 2016-12-15 01:33:09 -08:00
Kubernetes Submit Queue 4d467de5c5 Merge pull request #37708 from juanvallejo/jvallejo/add-restclient-config-helper-for-parsing-global-timeout
Automatic merge from submit-queue (batch tested with PRs 37708, 34410)

Add restclientconfig helper fn for parsing timeout

Related downstream PR: https://github.com/openshift/origin/pull/12062 (example of use-case for this patch)

**Release note**:
```release-note
release-note-none
```

This patch adds a package `pkg/client/unversioned/clientcmd/util` and
defines a `ParseTimeout` helper function for parsing time from a
user-defined string. This allows code re-use in other packages that
require the creation of a new restclient (and therefore must set the
`--global-timeout` flag value manually).

@fabianofranz @kubernetes/cli-review
2016-12-14 15:09:50 -08:00
Michail Kargakis bf78c00a96 kubectl: fix 'create deployment' to set container name correctly 2016-12-14 17:32:33 +01:00
Dr. Stefan Schimanski 399da6d176 make: avoid dirname process per go file 2016-12-13 13:41:32 +01:00
Kubernetes Submit Queue b4d09bf672 Merge pull request #38544 from ConnorDoyle/coverage-bsd-2
Automatic merge from submit-queue (batch tested with PRs 38315, 38624, 38572, 38544)

Fix code coverage in build script on OS X.

Fixes #20223

- Fixes code coverage in build script on BSD systems (including OS X).
- Supersedes #38536.

Successfully tested on two platforms:

```
Darwin <hostname> 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
```

```
Linux <hostname> 4.4.14-040414-generic #201606241434 SMP Fri Jun 24 18:36:45 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
```

cc @ixdy @mfanjie @balajismaniam @smarterclayton @soltysh

**Release note**:
```release-note
```
2016-12-12 19:42:37 -08:00
Connor Doyle 6a7ac2331b Fix code coverage in build script on OS X. 2016-12-12 14:38:54 -08:00
Random-Liu 486ddae35a `make test-e2e-node` runs the same test with pr builder by default. 2016-12-09 16:06:18 -08:00
Kubernetes Submit Queue 23d7615e7f Merge pull request #29683 from xiangpengzhao/add-make-help
Automatic merge from submit-queue

Add "make help" to list all make targets and help info

As discussed in [PR#29320comment](https://github.com/kubernetes/kubernetes/pull/29320#issuecomment-234420145), add a `make help` to make the use of `make` easy. Though it works well on my Ubuntu now (see the output as below, not sure if it still works on other systems), I believe the scripts are somewhat ugly, so, any suggestion for optimization is welcome.

BTW, I intended to list targets by groups, but it's hard to do that automatically. So I just list them in alphabetical order. I think this may be enough.

There are still some TODOs (also mentioned in the Makefile):
1. make EXCLUDE_TARGET auto-generated when there are other files in cmd/
2. should we exclude the target "cmd/libs" but include "cmd/libs/go2idl/*"?
3. should we let `help` be the first/default target? It will show the help when we just type `make`.

1 and 2 are to exclude the invalid targets generated by `$(notdir $(abspath $(wildcard cmd/*/)))`:
- OWNERS is just a file, it can't be a target
- libs itself cannot be built

/cc @thockin @jfrazelle @MHBauer @dims 

Output:

```
root@vm:/home/paas/zxp/code/k8s/fork/kubernetes# make help
--------------------------------------------------------------------------------
all
# Build code.
#
# Args:
#   WHAT: Directory names to build.  If any of these directories has a 'main'
#     package, the build will produce executable files under _output/go/bin.
#     If not specified, "everything" will be built.
#   GOFLAGS: Extra flags to pass to 'go' when building.
#   GOLDFLAGS: Extra linking flags passed to 'go' when building.
#   GOGCFLAGS: Additional go compile flags passed to 'go' when building.
#
# Example:
#   make
#   make all
#   make all WHAT=cmd/kubelet GOFLAGS=-v
#   make all GOGCFLAGS="-N -l"
#     Note: Use the -N -l options to disable compiler optimizations an inlining.
#           Using these build options allows you to subsequently use source
#           debugging tools like delve.
---------------------------------------------------------------------------------
check
# Build and run tests.
#
# Args:
#   WHAT: Directory names to test.  All *_test.go files under these
#     directories will be run.  If not specified, "everything" will be tested.
#   TESTS: Same as WHAT.
#   GOFLAGS: Extra flags to pass to 'go' when building.
#   GOLDFLAGS: Extra linking flags to pass to 'go' when building.
#   GOGCFLAGS: Additional go compile flags passed to 'go' when building.
#
# Example:
#   make check
#   make test
#   make check WHAT=pkg/kubelet GOFLAGS=-v
---------------------------------------------------------------------------------
clean
# Remove all build artifacts.
#
# Example:
#   make clean
#
# TODO(thockin): call clean_generated when we stop committing generated code.
---------------------------------------------------------------------------------
clean_generated
# Remove all auto-generated artifacts.
#
# Example:
#   make clean_generated
---------------------------------------------------------------------------------
clean_meta
# Remove make-related metadata files.
#
# Example:
#   make clean_meta
---------------------------------------------------------------------------------
cross
# Cross-compile for all platforms
#
# Example:
#   make cross
---------------------------------------------------------------------------------
federation-apiserver
federation-controller-manager
genfeddocs
# Add rules for all directories in federation/cmd/
#
# Example:
#   make federation-apiserver federation-controller-manager
---------------------------------------------------------------------------------
gendocs
genkubedocs
genman
genswaggertypedocs
genutils
genyaml
hyperkube
kube-apiserver
kube-controller-manager
kubectl
kube-dns
kubelet
kubemark
kube-proxy
kubernetes-discovery
libs
linkcheck
mungedocs
# Add rules for all directories in cmd/
#
# Example:
#   make kubectl kube-proxy
---------------------------------------------------------------------------------
generated_files
# Produce auto-generated files needed for the build.
#
# Example:
#   make generated_files
---------------------------------------------------------------------------------
ginkgo
# Build ginkgo
#
# Example:
# make ginkgo
---------------------------------------------------------------------------------
help
# Print make targets and help info
#
# Example:
# make help
---------------------------------------------------------------------------------
quick-release
# Build a release, but skip tests
#
# Example:
#   make release-skip-tests
---------------------------------------------------------------------------------
release
# Build a release
#
# Example:
#   make release
---------------------------------------------------------------------------------
release-skip-tests
# Build a release, but skip tests
#
# Example:
#   make release-skip-tests
---------------------------------------------------------------------------------
test
# Build and run tests.
#
# Args:
#   WHAT: Directory names to test.  All *_test.go files under these
#     directories will be run.  If not specified, "everything" will be tested.
#   TESTS: Same as WHAT.
#   GOFLAGS: Extra flags to pass to 'go' when building.
#   GOLDFLAGS: Extra linking flags to pass to 'go' when building.
#   GOGCFLAGS: Additional go compile flags passed to 'go' when building.
#
# Example:
#   make check
#   make test
#   make check WHAT=pkg/kubelet GOFLAGS=-v
---------------------------------------------------------------------------------
test-cmd
# Build and run cmdline tests.
#
# Example:
#   make test-cmd
---------------------------------------------------------------------------------
test-e2e
# Build and run end-to-end tests.
#
# Example:
#   make test-e2e
---------------------------------------------------------------------------------
test-e2e-node
# Build and run node end-to-end tests.
#
# Args:
#  FOCUS: Regexp that matches the tests to be run.  Defaults to "".
#  SKIP: Regexp that matches the tests that needs to be skipped.  Defaults
#    to "".
#  RUN_UNTIL_FAILURE: If true, pass --untilItFails to ginkgo so tests are run
#    repeatedly until they fail.  Defaults to false.
#  REMOTE: If true, run the tests on a remote host instance on GCE.  Defaults
#    to false.
#  IMAGES: For REMOTE=true only.  Comma delimited list of images for creating
#    remote hosts to run tests against.  Defaults to a recent image.
#  LIST_IMAGES: If true, don't run tests.  Just output the list of available
#    images for testing.  Defaults to false.
#  HOSTS: For REMOTE=true only.  Comma delimited list of running gce hosts to
#    run tests against.  Defaults to "".
#  DELETE_INSTANCES: For REMOTE=true only.  Delete any instances created as
#    part of this test run.  Defaults to false.
#  ARTIFACTS: For REMOTE=true only.  Local directory to scp test artifacts into
#    from the remote hosts.  Defaults to ""/tmp/_artifacts".
#  REPORT: For REMOTE=false only.  Local directory to write juntil xml results
#    to.  Defaults to "/tmp/".
#  CLEANUP: For REMOTE=true only.  If false, do not stop processes or delete
#    test files on remote hosts.  Defaults to true.
#  IMAGE_PROJECT: For REMOTE=true only.  Project containing images provided to
#  IMAGES.  Defaults to "kubernetes-node-e2e-images".
#  INSTANCE_PREFIX: For REMOTE=true only.  Instances created from images will
#    have the name "-".  Defaults to "test".
#  INSTANCE_METADATA: For REMOTE=true and running on GCE only.
#
# Example:
#   make test-e2e-node FOCUS=Kubelet SKIP=container
#   make test-e2e-node REMOTE=true DELETE_INSTANCES=true
#   make test-e2e-node TEST_ARGS="--cgroups-per-qos=true"
# Build and run tests.
---------------------------------------------------------------------------------
test-integration
# Build and run integration tests.
#
# Example:
#   make test-integration
---------------------------------------------------------------------------------
verify
# Runs all the presubmission verifications.
#
# Args:
#   BRANCH: Branch to be passed to verify-godeps.sh script.
#
# Example:
#   make verify
#   make verify BRANCH=branch_x
---------------------------------------------------------------------------------
vet
# Run 'go vet'.
#
# Args:
#   WHAT: Directory names to vet.  All *.go files under these
#     directories will be vetted.  If not specified, "everything" will be
#     vetted.
#
# Example:
#   make vet
#   make vet WHAT=pkg/kubelet
---------------------------------------------------------------------------------
```
2016-12-06 13:00:31 -08:00
Random-Liu 7c2b1f4752 Remove setup-node, which is not needed after we run the whole test as
root.
2016-12-05 16:16:08 -08:00
Kubernetes Submit Queue 708b1f3d06 Merge pull request #37446 from CaoShuFeng/test-integration
Automatic merge from submit-queue (batch tested with PRs 37208, 37446, 37420)

Move "-short" to KUBE_TEST_ARGS

fixes #37445

**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
```

"-short" is a argument of "go test", it should be moved to
"KUBE_TEST_ARGS".
2016-12-05 04:47:41 -08:00
xiangpengzhao a86697991f Add "make help" to list all make targets and help info 2016-12-05 02:00:46 -05:00
juanvallejo 885b7a6da8 Add restclientconfig helper fn for parsing timeout
This patch adds a package `pkg/client/unversioned/clientcmd/util` and
defines a `ParseTimeout` helper function for parsing time from a
user-defined string. This allows code re-use in other packages that
require the creation of a new restclient (and therefore must set the
`--global-timeout` flag value manually).
2016-12-02 13:25:03 -05:00
Michail Kargakis 065b652961 kubectl: add create pdb subcommand 2016-12-02 18:42:25 +01:00
Kubernetes Submit Queue 74066816b6 Merge pull request #37098 from deads2k/cli-12-create-cbinding
Automatic merge from submit-queue

add create clusterrolebinding command

Adds `kubectl create clusterrolebinding`.

@kubernetes/sig-cli
2016-12-02 08:44:58 -08:00
Kubernetes Submit Queue bbd447f555 Merge pull request #34789 from AdoHe/external_service
Automatic merge from submit-queue

create service add create ExternalName service implementation

@kubernetes/kubectl create service add ExternalName support, refer #34731 for more detail.

```release-note
kubectl create service externalname
```
2016-12-02 07:29:06 -08:00
Kubernetes Submit Queue 9ccc291e8a Merge pull request #37263 from smarterclayton/wait_on_immediate
Automatic merge from submit-queue

When --grace-period=0 is provided, wait for deletion

The grace-period is automatically set to 1 unless --force is provided, and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not handle scenarios where the object is deleted and a new object is created with the same name because we don't have the initial object loaded (and that's a larger change for 1.5).

Fixes #37117 by relaxing the guarantees provided.

```release-note
When deleting an object with `--grace-period=0`, the client will begin a graceful deletion and wait until the resource is fully deleted.  To force deletion, use the `--force` flag.
```
2016-11-30 11:15:17 -08:00
Kubernetes Submit Queue 00aae980e8 Merge pull request #37301 from Random-Liu/fix-remote-node-e2e-focus
Automatic merge from submit-queue

Node E2E: Fix remote node e2e focus.

Before, we use `'focus'` and `'skip'` in `hack/make-rules/test-e2e-node.sh`.

When we run `make test-e2e-node REMOTE=true FOCUS="Some Thing"`, it will eventually be translated to `-focus='Some Thing'` [here](https://github.com/kubernetes/kubernetes/blob/master/test/e2e_node/remote/remote.go#L284-L285).

However, golang `exec.Command` wraps each argument with single quote, the argument will become `'xx -focus='Some Thing' xx'`, and cause error because of the 2 layer single quote.
2016-11-29 07:32:57 -08:00
Kubernetes Submit Queue 93f6736daf Merge pull request #37345 from MrHohn/kubectl-apply-remove-w
Automatic merge from submit-queue

Removes shorthand flag -w from kubectl apply

Fixes #37342.

A shorthand flag `-w` was introduced as flag `--prune-whitelist` for kubectl apply two weeks ago. Turned out it is not what we should do. Removing this shorthand flag before 1.5 release to prevent further issues.

@ymqytw @pwittrock
2016-11-29 07:31:38 -08:00
Cao Shufeng 9c01e87cdb Move "-short" to KUBE_TEST_ARGS
"-short" is a argument of "go test", it should be moved to
"KUBE_TEST_ARGS".
2016-11-24 10:18:09 -05:00
Chao Xu aad6831aa7 fix test-cmd.sh 2016-11-23 15:53:09 -08:00
Clayton Coleman 7cdb6b169d
When --grace-period=0 is provided, wait for deletion
The grace-period is automatically set to 1 unless --force is provided,
and the client waits until the object is deleted.

This preserves backwards compatibility with 1.4 and earlier. It does not
handle scenarios where the object is deleted and a new object is created
with the same name.
2016-11-23 15:02:43 -06:00
Zihong Zheng f57c9c70f9 Removes shorthand flag from kubectl apply 2016-11-22 22:24:50 -08:00
Random-Liu 1bef014c2a Fix remote node e2e focus. 2016-11-22 10:10:02 -08:00
deads2k e300f01a1b add create clusterrolebinding command 2016-11-21 08:50:06 -05:00
Random-Liu edf7608c51 Remove kubelet related flags from node e2e. Add a single flag `kubelet-flags` to pass kubelet flags all together. 2016-11-17 10:17:32 -08:00
Kubernetes Submit Queue 424286996a Merge pull request #36764 from ymqytw/make_edit_before_create_iterate
Automatic merge from submit-queue

make kubectl create --edit iterate

`kubectl create --edit` is broken after #36148 merged.
`kubectl create --edit` will fail when a manifest that contains multiple resources.
I guess the root cause is that dynamic typer doesn't support a list of resources currently.

This PR makes `kubectl create --edit` iterate again as `kubectl create`.
2016-11-17 01:25:34 -08:00
AdoHe d66bcbfa61 create service add create ExternalName service implementation 2016-11-16 04:47:10 -05:00
Kubernetes Submit Queue fac05d9c81 Merge pull request #36174 from JacobTanenbaum/v2resource_fixes
Automatic merge from submit-queue

V2resource fixes

when using kubectl set resources it resets all resource fields that are not being set.

for example
$ kubectl set resources deployments nginx --limits=cpu=100m

followed by

$ kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

you must specify an update to requests or limits or (in the form of --requests/--limits)

corrected to

you must specify an update to requests or limits (in the form of --requests/--limits)

Implemented both the dry run and local flags.

Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112

The original PR associated with these fixes where reverted due to causing a flake in hack/make-rules/test-cmd.sh, I gave the 'kubectl set resources' tests there own deployment and set the terminationGracePeriodSeconds to 0 and have run test-cmd.sh for hours without hitting the flake
2016-11-15 21:03:06 -08:00
ymqytw 2aa8ed3fa2 add tests for kubectl create --edit 2016-11-14 14:12:57 -08:00
Kubernetes Submit Queue 467a1cd23b Merge pull request #35868 from Random-Liu/cleanup-node-e2e-output-dir
Automatic merge from submit-queue

Node E2E: Reorganize node e2e output directories.

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

This PR cleans up the result directory and workspace directory of node e2e test.

Local result directory:

```
/tmp/_artifacts/
        |----- build-log.txt  (build log)
        |----- *.xml  (junit xml file)
        |----- local/  (local run *.log)
        |----- hostname1/  (remote run *.log)
        |----- hostname2/
```

Workspace directory on test node:

```
/tmp/node-e2e-yyyy-mm-ddThh-mm-ss/
        |----- cluster/  (gci mounter)
        |----- cni/  (cni binary)
        |----- e2e_node.test  (test binary)
        |----- e2e_node_test.tar.gz  (test tar)
        |----- etcd060429031/  (etcd data directory)
        |----- ginkgo  (ginkgo binary)
        |----- kubelet (kubelet binary)
        |----- pod-manifest365096781/  (mirror pod directory)
        |----- results/  (test result directory)
```

@mtaufen 
/cc @kubernetes/sig-node
2016-11-10 01:58:58 -08:00
Mike Danese 584689f182 implement kubectl procelain csr commands 2016-11-08 06:33:46 -08:00
Random-Liu f6029fb995 Handle interrupt properly, wrap focus and skip with quote. 2016-11-08 00:12:14 -08:00
Random-Liu d9ddd64c9c Reorganize node e2e output directories. 2016-11-08 00:12:14 -08:00
Kubernetes Submit Queue 9534c4f563 Merge pull request #32427 from Random-Liu/system-verification
Automatic merge from submit-queue

Node Conformance Test: Add system verification

For #30122 and #29081.

This PR introduces system verification test in node e2e and conformance test. It will run before the real test. Once the system verification fails, the test will just fail. The output of the system verification is like this:

```
I0909 23:33:20.622122    2717 validators.go:45] Validating os...
OS: Linux
I0909 23:33:20.623274    2717 validators.go:45] Validating kernel...
I0909 23:33:20.624037    2717 kernel_validator.go:79] Validating kernel version
KERNEL_VERSION: 3.16.0-4-amd64
I0909 23:33:20.624146    2717 kernel_validator.go:93] Validating kernel config
CONFIG_NAMESPACES: enabled
CONFIG_NET_NS: enabled
CONFIG_PID_NS: enabled
CONFIG_IPC_NS: enabled
CONFIG_UTS_NS: enabled
CONFIG_CGROUPS: enabled
CONFIG_CGROUP_CPUACCT: enabled
CONFIG_CGROUP_DEVICE: enabled
CONFIG_CGROUP_FREEZER: enabled
CONFIG_CGROUP_SCHED: enabled
CONFIG_CPUSETS: enabled
CONFIG_MEMCG: enabled
I0909 23:33:20.679328    2717 validators.go:45] Validating cgroups...
CGROUPS_CPU: enabled
CGROUPS_CPUACCT: enabled
CGROUPS_CPUSET: enabled
CGROUPS_DEVICES: enabled
CGROUPS_FREEZER: enabled
CGROUPS_MEMORY: enabled
I0909 23:33:20.679454    2717 validators.go:45] Validating docker...
DOCKER_GRAPH_DRIVER: aufs
```

It verifies the system following a predefined `SysSpec`:

``` go
// DefaultSysSpec is the default SysSpec.
 var DefaultSysSpec = SysSpec{
    OS:            "Linux",
    KernelVersion: []string{`3\.[1-9][0-9].*`, `4\..*`}, // Requires 3.10+ or 4+
    // TODO(random-liu): Add more config
    KernelConfig: KernelConfig{
        Required: []string{
            "NAMESPACES", "NET_NS", "PID_NS", "IPC_NS", "UTS_NS",
            "CGROUPS", "CGROUP_CPUACCT", "CGROUP_DEVICE", "CGROUP_FREEZER",
            "CGROUP_SCHED", "CPUSETS", "MEMCG",
        },
        Forbidden: []string{},
    },
    Cgroups: []string{"cpu", "cpuacct", "cpuset", "devices", "freezer", "memory"},
    RuntimeSpec: RuntimeSpec{
        DockerSpec: &DockerSpec{
            Version: []string{`1\.(9|\d{2,})\..*`}, // Requires 1.9+
            GraphDriver: []string{"aufs", "overlay", "devicemapper"},
        },
    },
 }
```

Currently, it only supports:
- Kernel validation: version validation and kernel configuration validation
- Cgroup validation: validating whether required cgroups subsystems are enabled.
- Runtime Validation: currently, only validates docker graph driver.

The validating framework is ready. The specific validation items could be added over time.

@dchen1107 
/cc @kubernetes/sig-node
2016-11-06 17:12:39 -08:00
Kubernetes Submit Queue b75c3a45a1 Merge pull request #35776 from jimmycuadra/petset-rename-docs-examples
Automatic merge from submit-queue

Rename PetSet to StatefulSet in docs and examples.

**What this PR does / why we need it**: Addresses some of the pre-code-freeze changes for implementing the PetSet --> StatefulSet rename. (#35534)

**Special notes for your reviewer**: This PR only changes docs and examples, as #35731 hasn't been merged yet and I don't want to create merge conflicts. I'll open another PR for any remaining code changes needed after that PR is merged. /cc @erictune @janetkuo @chrislovecnm
2016-11-06 13:30:21 -08:00
Kubernetes Submit Queue afa99c68b8 Merge pull request #35144 from pipejakob/generate-token
Automatic merge from submit-queue

New command: "kubeadm token generate"

As part of #33930, this PR adds a new top-level command to kubeadm to just generate a token for use with the init/join commands. Otherwise, users are left to either figure out how to generate a token on their own, or let `kubeadm init` generate a token, capture and parse the output, and then use that token for `kubeadm join`.

At this point, I was hoping for feedback on the CLI experience, and then I can add tests. I spoke with @mikedanese and he didn't like the original propose of `kubeadm util generate-token`, so here are the runners up:

```
$ kubeadm generate-token          # <--- current implementation
$ kubeadm generate token          # in case kubeadm might generate other things in the future?
$ kubeadm init --generate-token   # possibly as a subcommand of an existing one
```

Currently, the output is simply the token on one line without any padding/formatting:

```
$ kubeadm generate-token
1087fd.722b60cdd39b1a5f
```

CC: @kubernetes/sig-cluster-lifecycle 

**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
New kubeadm command: generate-token
```
2016-11-05 16:12:52 -07:00
Kubernetes Submit Queue 47519962bf Merge pull request #35484 from smarterclayton/delete_warning
Automatic merge from submit-queue

Add --force to kubectl delete and explain force deletion

--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.

Part of #34160 & #29033

```release-note
In order to bypass graceful deletion of pods (to immediately remove the pod from the API) the user must now provide the `--force` flag in addition to `--grace-period=0`.  This prevents users from accidentally force deleting pods without being aware of the consequences of force deletion.  Force deleting pods for resources like StatefulSets can result in multiple pods with the same name having running processes in the cluster, which may lead to data corruption or data inconsistency when using shared storage or common API endpoints.
```
2016-11-05 11:19:04 -07:00
Jimmy Cuadra d42eabd9d2 Rename PetSet to StatefulSet in docs and examples. 2016-11-05 00:17:28 -07:00
Random-Liu b76b2f218b Add unit test for system verification 2016-11-03 20:38:28 -07:00
Kubernetes Submit Queue e4edd817af Merge pull request #35220 from MrHohn/kubectl-apply-type
Automatic merge from submit-queue

Implement --prune-whitelist(-w) flag to overwrite default whitelist for --prune

From #34274.

Updates:

As suggested, the new commits implement a default whitelist for `kubectl apply --prune`, which could be overwritten by using `--prune-whitelist`or `-w` flag. The default whitelist and example as below.

Also supports `--dry-run` for `--prune` to fix #35222.

whitelist:

```
type pruneResource struct {
    group      string
    version    string
    kind       string
    namespaced bool
}

*pruneResources = []pruneResource{
    {"", "v1", "ConfigMap", true},
    {"", "v1", "Endpoints", true},
    {"", "v1", "Namespace", false},
    {"", "v1", "PersistentVolumeClaim", true},
    {"", "v1", "PersistentVolume", false},
    {"", "v1", "Pod", true},
    {"", "v1", "ReplicationController", true},
    {"", "v1", "Secret", true},
    {"", "v1", "Service", true},
    {"batch", "v1", "Job", true},
    {"extensions", "v1beta1", "DaemonSet", true},
    {"extensions", "v1beta1", "Deployment", true},
    {"extensions", "v1beta1", "HorizontalPodAutoscaler", true},
    {"extensions", "v1beta1", "Ingress", true},
    {"extensions", "v1beta1", "ReplicaSet", true},
    {"apps", "v1beta1", "StatefulSet", true},
}
```

example:

```
$ kubectl apply -f /path/to/file --prune -l test=true \
      -w core/v1/Pod \
      -w core/v1/Service \
      -w extensions/v1beta1/Deployment 
```

@mikedanese
2016-11-03 18:46:17 -07:00
Kubernetes Submit Queue 6ac5887e8a Merge pull request #36148 from kargakis/edit-list
Automatic merge from submit-queue

kubectl: make edit work with lists again

@kubernetes/kubectl this is fixing https://github.com/kubernetes/kubernetes/issues/20519 and slightly changes the behavior of --recursive when the directory that is being edited has files with errors. Previously since `edit` was working on an object basis, bad objects would be skipped and the editor would load the next object. We want to load multiple objects in the same list and it's impossible to load invalid objects in a list so --recursive will not work if there is any error in the directory. I think this is an acceptable trade-off.

Review here: https://github.com/kubernetes/kubernetes/pull/36148/files?w=1
2016-11-03 17:27:13 -07:00
Jacob Tanenbaum 13afa70c81 Implemented both the dry run and local flags.
Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112

The previous attempt at the PR (PR#35050) was reverted for causeing a flake.
I believe that setting the deployments terminationGracePeriodSeconds to 0 should
take care of it. I ran hack/make-rules/test-cmd.sh 50 times in a row without encountering
the flake
2016-11-03 12:55:19 -04:00
Michail Kargakis 35f7d2513f kubectl: make edit work with lists again 2016-11-03 13:12:22 +01:00
Janet Kuo c15b9470f5 Replace apps/v1alpha1 with apps/v1beta1 and manually remove generated apps/v1alpha1 files
Manually remove generated apps/v1alpha1 types, protobuf, and api-reference doc files
Manually remove apps/v1alpha1 folder from 1.5 generated client
2016-11-02 15:16:23 -07:00
Clayton Coleman 6e25830378
Add --force to kubectl delete and explain force deletion
--force is required for --grace-period=0. --now is == --grace-period=1.
Improve command help to explain what graceful deletion is and warn about
force deletion.
2016-11-02 17:44:05 -04:00
Zihong Zheng 4523ce8f32 Adds a test for apply --prune --prune-whitelist 2016-11-01 14:02:31 -07:00
Saad Ali 1c51ac4fc1 Revert "fixed some issues with kubectl set resources" 2016-11-01 13:53:17 -07:00
Kubernetes Submit Queue 44b684ad53 Merge pull request #33663 from pmorie/selinux-fixes
Automatic merge from submit-queue

SELinux Overhaul

Overhauls handling of SELinux in Kubernetes.  TLDR: Kubelet dir no longer has to be labeled `svirt_sandbox_file_t`.

Fixes #33351 and #33510.  Implements #33951.
2016-11-01 05:04:17 -07:00
Jacob Beacham cf6b6778dc Adding CLI tests for kubeadm. 2016-10-31 11:12:51 -07:00
Michal Fojtik 0faa27e62d Use PATCH when pausing/resuming objects and CalculatePatches to get the patch 2016-10-31 13:13:59 +01:00
Kubernetes Submit Queue bc5682bbaa Merge pull request #35050 from JacobTanenbaum/resource_fixes
Automatic merge from submit-queue

fixed some issues with kubectl set resources

when using kubectl set resources it resets all resource fields that are not being set.

for example
  # kubectl set resources deployments nginx --limits=cpu=100m

followed by

  # kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

 you must specify an update to requests or limits or  (in the form of --requests/--limits)

corrected to

 you must specify an update to requests or limits (in the form of --requests/--limits)

 Implemented both the dry run and local flags.

Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112
2016-10-30 06:18:56 -07:00
Kubernetes Submit Queue a06a08a906 Merge pull request #34489 from caesarxuchao/time-copy.sh
Automatic merge from submit-queue

Verify and update client-go staging area for every PR

We need to keep the staging area up-to-date to prevent PRs from breaking client-go.

It's marked as "WIP" because we need to decide the [versioning strategy](https://github.com/kubernetes/client-go/issues/9) for client-go first. This PR contains breaking changes for client-go.

This is blocking #29934 and potentially #34441

cc @kubernetes/sig-api-machinery
2016-10-29 16:24:07 -07:00
Kubernetes Submit Queue 7c9c8cbf28 Merge pull request #34952 from kargakis/update-observedgeneration-for-overlapping-deployments
Automatic merge from submit-queue

Make overlapping deployments deletable

@kubernetes/deployment ptal

Fixes https://github.com/kubernetes/kubernetes/issues/34466 by 1) not adding the overlapping annotation in the working deployment, 2) updates observedGeneration for overlapping deployments, and 3) updates the kubectl deployment reaper to do non-cascading deletion for deployments with the overlapping annotation.
2016-10-29 14:50:16 -07:00
Chao Xu d3c0d04285 add update-staging-client-go.sh and verify-staging-client-go.sh;
disable verify-staging-client-go.sh until 1.5 code freeze
2016-10-29 14:20:39 -07:00
Kubernetes Submit Queue 739f78fad2 Merge pull request #33250 from ymqytw/edit_before_create
Automatic merge from submit-queue

support editing before creating resource

Support `kubectl create -f config.yaml --edit`
Support editing before creating resource from files, urls and stdin.
The behavior is similar to `kubectl edit`
It won't create anything when edit make no change.

partial: #18064

Based on: #33686 and #33973

```release-note
Support editing before creating resource from files, urls and stdin, e.g. `kubectl create -f config.yaml --edit`
It won't create anything when edit make no change.
```
2016-10-29 11:45:43 -07:00
Janet Kuo 10aee82ae3 Rename PetSet API to StatefulSet 2016-10-27 17:25:10 -07:00
Jacob Tanenbaum a77cecb957 Implemented both the dry run and local flags.
Added test cases to show that both flags are operating as intended.
Removed the print statement "running in local mode" as in PR#35112
2016-10-27 14:05:46 -04:00
Jacob Tanenbaum fe3bcad128 fixed some issues with kubectl set resources
when using kubectl set resources it resets all resource fields that are not being set.

for example
  # kubectl set resources deployments nginx --limits=cpu=100m

followed by

  # kubectl set resources deployments nginx --limits=memory=256Mi

would result in the nginx deployment only limiting memory at 256Mi with the previous
limit placed on the cpu being wiped out. This behavior is corrected so that each invocation
only modifies fields set in that command and changed the testing so that the desired behavior
is checked.

Also a typo:

 you must specify an update to requests or limits or  (in the form of --requests/--limits)

corrected to

 you must specify an update to requests or limits (in the form of --requests/--limits)

changelog:
 - fixed a typo in hack/make-rules/test-cmd.sh "effecting" to "affecting"
2016-10-27 14:05:46 -04:00
Paul Morie ea423110cc Remove SELinux relabel of Kubelet dir from test-e2e-node.sh 2016-10-26 09:38:03 -04:00
ymqytw c641834bb3 support editing before creating resource 2016-10-24 09:56:37 -07:00
Eric Paris 9214f8ab4f Make all useage of sort deterministic
Lots of places used sort (or sort -u) but didn't set LC_ALL=C. This
means it could be slightly different on different people's systems. Make
it deterministic.
2016-10-20 16:47:20 -04:00
Kubernetes Submit Queue 4b7024efe7 Merge pull request #27784 from deads2k/catch-mutators
Automatic merge from submit-queue

add optional mutation checks for shared informer cache

We need to make sure that no one is mutating caches if they're using a shared informer.  It is important that whatever is tracking those changes gets the object *before* anyone else possibly could.

This adds the ability to track the original objects in the cache and their current values.  Go doesn't have an exit hook or a way to say "wait for non-daemon go-funcs to complete before exit", so this runs a gofunc on a loop that can panic the entire process.  It's gated behind an env var.

@derekwaynecarr did I get the right spots to make sure that e2e runs with this flag?
@smarterclayton @kubernetes/rh-cluster-infra
2016-10-18 14:38:57 -07:00
Michail Kargakis 12455bf5e1 hack: add test for overlapping selectors in deployments 2016-10-18 17:46:34 +02:00
deads2k aee54ae57e add optional mutation checks for shared informer cache 2016-10-18 09:19:38 -04:00
Kubernetes Submit Queue 3f4c438946 Merge pull request #34836 from mikedanese/prune-1
Automatic merge from submit-queue

kubectl: apply prune should fallback to basic delete when a resource has no reaper

Fixes #34790

cc @kubernetes/kubectl @MrHohn
2016-10-15 18:38:20 -07:00
Kubernetes Submit Queue 9174429776 Merge pull request #33546 from k82cn/k8s_15834
Automatic merge from submit-queue

Updated err message when retrieving resources by name with --all-name…

fixes #15834
2016-10-15 06:50:00 -07:00
Kubernetes Submit Queue c0bd6e8ea5 Merge pull request #33958 from juanvallejo/jvallejo/add-global-timeout-flag
Automatic merge from submit-queue

Add global timeout flag

**Release note**:
```release-note
Add a new global option "--request-timeout" to the `kubectl` client
```

UPSTREAM: https://github.com/kubernetes/client-go/pull/10

This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

Adding a global timeout ensures that user-made scripts won't hang for an
indefinite amount of time while performing remote calls (right now, remote
calls are re-tried up to 10 times when each attempt fails, however, there is
no option to set a timeout in order to prevent any of these 10 attempts from
hanging indefinitely).

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --request-timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --request-timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 23:29:58 -07:00
Mike Danese c17a8a773d kubectl: apply prune should fallback to basic delete when a resource has no reaper 2016-10-14 15:04:38 -07:00
Klaus Ma 005b8dad14 Updated err message when retrieving resources by name with --all-namespaces. 2016-10-14 22:21:01 +08:00
juanvallejo fd087caadb Add global timeout flag
This patch adds a global timeout flag (viewable with `kubectl -h`) with
a default value of `0s` (meaning no timeout).

The timeout value is added to the default http client, so that zero
values and default behavior are enforced by the client.

**Example**
```
$ kubectl get pods # no timeout flag set - default to 0s (which means no
timeout)
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$ kubectl get pods --timeout=0 # zero means no timeout no timeout flag set
NAME                      READY     STATUS    RESTARTS   AGE
docker-registry-1-h7etw   1/1       Running   1          2h
router-1-uv0f9            1/1       Running   1          2h

$kubectl get pods --timeout=1ms
Unable to connect to the server: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
```
2016-10-14 09:57:40 -04:00
Jacob Tanenbaum 901bbee2fd Add 'kubectl set limit'
Add a way to set resource limits/requests on running pods

Ref: https://github.com/kubernetes/kubernetes/issues/21648

I squashed the commits to make rebasing easier
Change log:

- fixed a typo that caused the command to be run with kubectl set set instead of the correct kubectl set limit

- added a ResourcesWithPodTemplates to pkg/kubectl/cmd/util/factory.go
     instead of hardcoding these resources move there description all in one place

- Fixing some of the flow control in kubectl set limit

- update the help info

- changed the name of ResourcesWithPodTemplates to ResourcesWithPodSpecs to more accuratly describe what it is doing
    and changed the variable names to lower case to conform to go's variable naming convention

- changing the name of the command from 'set limit' to 'set resources'

- Adding the new file pkg/kubectl/cmd/set/set_resources.go

- changes to the test cases to reflect the change from 'kubectl set limit' to 'kubectl set resources'

- comment removed

- adding the man page to the git repository attempting to fix Jenkins tests

- adding the user guide

- fixed a few typos

- typo in hack/cmd-test.sh

- implamenting suggestions for command help text

- adding the dry-run flag

- removing the "remove" option in favor of zeroing out request/limits in order to remove them

- changed limits/requests to requests/limit

- changing ResourcesWithPodSpec

- updated generated docs and removed whitespace

- change priint on success message from "resource limits/requests updated" to "resource requirements updated"

- minor rebasing issues - 'hack/test-cmd.sh' now passes

- cmdutil.PrintSuccess added another argument

- fixing mungedocs failure

- removed whitespace from hack/make-rules/test-cmd.sh and an erroneous entry from pkg/cloudprovider/providers/openstack/MAINTAINERS.md

- fixed typo in Short: field of the cobra command

- rebased

- Creating a new factory in the ResourcesWithPodSpecs() so that the testing will pass

- changing ResourcesWithPodSpecs, it doesn't need to be a method of factory
2016-10-14 08:35:32 -04:00
deads2k f73d1ea90a make sure that the bootstrap rbac rules are getting created in test-cmd 2016-10-10 15:00:36 -04:00
Michail Kargakis 75f30ec46f kubectl: add --revision flag in rollout status 2016-10-10 15:04:46 +02:00
Kubernetes Submit Queue a99adcdf49 Merge pull request #34343 from mikedanese/prune-tests
Automatic merge from submit-queue

kubectl: add two more test of kubectl apply --prune

@pwittrock
2016-10-08 14:29:56 -07:00
Kubernetes Submit Queue 5562715ae5 Merge pull request #34249 from kargakis/retain-old-revisions
Automatic merge from submit-queue

controller: save older revisions for Deployment's replica sets

@jwforres the only usable way  I could find for multiple old revisions for a single replica set is to stuff them as comma-separated values.

@kubernetes/deployment this retains old revisions served by a replica set inside an annotation.

Fixes https://github.com/kubernetes/kubernetes/issues/33844
2016-10-08 01:32:47 -07:00
Mike Danese 6d17a87809 kubectl: add two more test of kubectl apply --prune 2016-10-07 10:30:41 -07:00
Michail Kargakis 89eaa918be controller: save older revisions for Deployment's replica sets 2016-10-07 11:45:06 +02:00
Kubernetes Submit Queue a89e4785ba Merge pull request #31949 from asalkeld/fix-coverage
Automatic merge from submit-queue

Ignore troublesome paths that cause coverage to fail

**What this PR does / why we need it**:
`KUBE_COVER=y make check` currently fails, this patch fixes it.

**Which issue this PR fixes** 
fixes #31691

**Special notes for your reviewer**:
None

**Release note**:

```release-note
NONE
```

This avoids the whole command failing because of errors like the following:
```
# cover k8s.io/kubernetes/pkg/client/restclient
cover: internal error: block 268 overlaps block 270
```
2016-10-07 02:40:07 -07:00
Kubernetes Submit Queue 83921597ef Merge pull request #29236 from juanvallejo/jvallejo_add-configuration-missing-error-type
Automatic merge from submit-queue

Update client config invalid option errors to be more specific

This patch adds better error handling for cases where a global option (such as --context or --cluster) causes an invalid config to be returned.

```release-note
release-note-none
```
2016-10-07 01:24:49 -07:00
Mike Danese 62960aace7 add a test for kubectl apply --prune 2016-10-06 17:49:02 -07:00
juanvallejo 6f925b1f82
handle invalid client config option errors
This patch provides a more relevant error message when a client
configuration option is passed with an invalid or non-existent value.

`$ kubectl get pods --cluster="non-existent"`
```
error: No configuration file found, please login or point to an existing
file
```

`$ kubectl get pods --cluster="non-existent"`
```
error: cluster "non-existent" does not exist
```
2016-10-06 16:28:51 -04:00
Kubernetes Submit Queue d4088fc47b Merge pull request #34020 from juanvallejo/jvallejo/allow-empty-annotation-values
Automatic merge from submit-queue

Allow empty annotation values

Related downstream issue: https://github.com/openshift/origin/issues/11175

**Release note**:
```release-note
release-note-none
```

Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```

@fabianofranz @liggitt
2016-10-05 11:48:02 -07:00
juanvallejo a872657371
Allow empty annotation values
Annotations with empty values can be used, for example, in diagnostics
logging. This patch removes the client-side check for empty values in
an annotation key-value pair.

**Before**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
error: invalid annotation format: node-selector=
```

**After**
```
$ kubectl annotate pod zookeeper-1 node-selector="" --overwrite
pod "zookeper-1" annotated
```

```
$ kubectl get po/zookeeper-1 --template='{{.metadata.annotations}}'
map[... node-selector: test-label:test]
```
2016-10-05 13:17:08 -04:00
gmarek cb167270bf Allow setting short value in integration tests 2016-10-05 16:36:47 +02:00
Kubernetes Submit Queue a7f6557f1d Merge pull request #34074 from asalkeld/annotate-local-option
Automatic merge from submit-queue

Add local option to annotate

**What this PR does / why we need it**:
Add the --local option to be both consistent with other commands and so it can be used with "set selector" and "create service".

**Which issue this PR fixes** 
Related: #7296

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Add a new option "--local" to the `kubectl annotate`
```
2016-10-05 07:09:05 -07:00
Kubernetes Submit Queue 776af8e7f6 Merge pull request #33990 from asalkeld/local-option-label
Automatic merge from submit-queue

Add local option to the label command

**What this PR does / why we need it**:
Add the --local option to be both consistent with other commands and so it can be used with  "set selector" and "create service".

**Which issue this PR fixes** 
Related: #7296

**Special notes for your reviewer**:
None

**Release note**:
```release-note
Add a new option "--local" to the `kubectl label`
```
2016-10-05 06:32:13 -07:00
Angus Salkeld 5cb945d672 Add local option to the label command
This is to be used with the new "set selector" command.
2016-10-05 15:45:43 +10:00
Angus Salkeld b86b85dea9 Add local option to annotate 2016-10-05 14:39:56 +10:00
deads2k 48c1e83a76 specify flags to test-integration 2016-10-04 14:16:23 -04:00
Kubernetes Submit Queue 6f69293240 Merge pull request #32599 from mikedanese/kubectl-selector
Automatic merge from submit-queue

allow kubectl -f to filter by selector

cc @kubernetes/kubectl

Fixes #32544
2016-10-01 01:13:09 -07:00
deads2k b577498c66 add optional env var for allowing version skew in test cmd 2016-09-30 13:37:25 -04:00
Mike Danese 6339d915a7 add a test to test-cmd.sh for apply -f with label selector 2016-09-30 00:42:35 -07:00
deads2k 06b1a9636d promote contrib/mesos to incubator 2016-09-28 10:58:09 -04:00
Jeff Grafton 13a3313957 Bundle kubemark in test tarball instead of server tarball 2016-09-26 11:06:48 -07:00
deads2k 2fbc98196c disconnect contrib/mesos 2016-09-26 10:16:15 -04:00
deads2k 7a8fa18116 update generation scripts to share API group version constants 2016-09-22 13:30:41 -04:00
Kubernetes Submit Queue db07433782 Merge pull request #33063 from pmorie/node-e2e
Automatic merge from submit-queue

Make node E2E tests more transparent

Add some logging and minor code reorg to make the node E2E tests a little more transparent and understandable.
2016-09-22 08:22:11 -07:00
Kubernetes Submit Queue 47e3d23a67 Merge pull request #32520 from jayunit100/component_tests
Automatic merge from submit-queue

Integration tests: Migrate scheduler perf to the integration suite, s…

*Problem*

issues like https://github.com/kubernetes/kubernetes/pull/32384/ happen because we dont compile the integration tests as part of the build

*Solution*

This pr will make it so scheduler_perf is included in the integration tests, but it will run in short mode that only makes sure compilation happens .  it also removes the over generalized test/component directory which only has one entry

```
test/integration/replicationcontroller
test/integration/scheduler
test/integration/scheduler
test/integration/scheduler_perf
test/integration/scheduler_perf
test/integration/secrets
test/integration/serviceaccount
test/integration/storageclasses
```
2016-09-22 05:45:50 -07:00
Paul Morie 3539993ee0 Make node E2E tests more transparent 2016-09-20 21:55:41 -04:00
Kubernetes Submit Queue 8423ff1f1b Merge pull request #32409 from liggitt/authentication-api-group-docs
Automatic merge from submit-queue

Generate API docs for authentication API group
2016-09-20 03:06:50 -07:00
Davanum Srinivas e1373cf516 Extend all to more resources
Added more things from the list here:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cmd.go#L159

Update the devel/kubectl-conventions.md with the rules mentioned by
a few folks on which resources could be added to the special 'all' alias
2016-09-19 13:01:59 -04:00
Kubernetes Submit Queue 824763977d Merge pull request #32938 from pmorie/gcloud-errs
Automatic merge from submit-queue

Fix error message around gcloud calls in node e2e and gubernator

Fixes some janky error messages around gcloud calls.
2016-09-16 23:59:42 -07:00
Paul Morie 88acffcda1 Fix error message around gcloud calls in node e2e and gubernator 2016-09-17 01:05:20 -04:00
jayunit100 a1481f5a3e component tests as integration-tests with short option. 2016-09-16 15:22:08 -04:00
Random-Liu a67fec6419 Add separate build process for node test. 2016-09-16 11:17:49 -07:00
Kubernetes Submit Queue c594d4960a Merge pull request #32532 from caesarxuchao/log-integration
Automatic merge from submit-queue

Set --alsologtostderr=true in integration test

Without the flag, no glog output are stored in the test results. The logs are useful for debugging flaky tests like https://github.com/kubernetes/kubernetes/issues/30228.

The change also reveals a lot of messages like `W0912 14:19:32.306719   25386 cacher.go:468] Terminating all watchers from cacher *api.LimitRange`, which doesn't seem right.
2016-09-14 23:47:27 -07:00
Chao Xu f12fb7ff0a set --alsologtostderr=true in integration test 2016-09-13 14:38:35 -07:00
Kubernetes Submit Queue 27c5e5dca7 Merge pull request #31110 from AdoHe/rollout_dry_run
Automatic merge from submit-queue

Rollout dry run

**What this PR does / why we need it**: rollout undo add dry-run implementation

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

**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`. 
-->
```
rollout undo add dry-run option
```
2016-09-11 15:05:16 -07:00
Kubernetes Submit Queue b4c09192bc Merge pull request #31841 from fraenkel/replace_force
Automatic merge from submit-queue

Replace force

fixes #28115
2016-09-11 14:27:30 -07:00
Kubernetes Submit Queue 0764aa0b68 Merge pull request #32140 from deads2k/restmapper-02-match-partial-groups
Automatic merge from submit-queue

add group prefix matching for kubectl usage

Adds prefix matching for groups so that `kubectl get storageclass.storage` matches `storageclass.storage.k8s.io`.

@kubernetes/kubectl
2016-09-09 23:43:53 -07:00
Jordan Liggitt a719c2fcf1
Generate API docs for authentication API group 2016-09-09 16:02:42 -04:00
Michael Fraenkel 88e17d7478 Require force when using grace period or timeout 2016-09-08 07:45:20 -04:00
Kubernetes Submit Queue f90df2448d Merge pull request #31533 from deads2k/partial-test-integration
Automatic merge from submit-queue

choose a particular directory test-integration

Enables `make test-integration WHAT=auth` or whatever particular integration test director you want to run.
2016-09-07 19:16:07 -07:00
AdoHe 6a68dbdac4 rollout undo add dry-run implementation 2016-09-08 08:02:04 +08:00
deads2k f9b498e341 add group prefix matching for kubectl usage 2016-09-07 10:32:39 -04:00
deads2k cd5b6cc491 move StorageClass to its own group 2016-09-06 08:41:17 -04:00
Angus Salkeld 9fcce9e001 Work around go cover bug
This avoids the whole command failing because of errors like the following:
```
# cover k8s.io/kubernetes/pkg/client/restclient
cover: internal error: block 268 overlaps block 270
```
For vendor code, igone
For local code replace the switch with an if statement
2016-09-05 09:59:15 +10:00
Kubernetes Submit Queue 11765ab92e Merge pull request #31887 from liggitt/certificates-group
Automatic merge from submit-queue

Namespace certificates API group

New API groups should follow best-practices for naming, including using DNS names within the k8s.io namespace

```release-note
The certificates API group has been renamed to certificates.k8s.io
```
2016-09-02 15:08:55 -07:00
Jordan Liggitt a869de61bd
Namespace certificates API group 2016-09-01 14:39:06 -04:00
Tim Hockin a7ab2da8d6 Make unit test runs MUCH faster
Running tests rebuilds almost everything.  Most unit tests do not need to be
rebuilt.  This installs test artifacts and makes subsequent test runs as much
as 6x faster.  I saw pkg/apiserver tests drop from 30+ seconds to 5 seconds.
2016-09-01 00:01:50 -07:00
Random-Liu e7a1b4e16f Do not set stop-services=false for node e2e and add more logs. 2016-08-30 17:52:23 -07:00
Random-Liu 4c9587bf61 Move the image and host related logic only to be run in remote mode. 2016-08-29 11:48:23 -07:00
Jan Chaloupka 8f28091c97 Call 'gcloud compute' only if necessary
The 'gcloud compute' is called everytime even if it is not needed.
When runnin node e2e tests on RHEL, the test-e2e-node.sh script is run
the way in which it takes execution path without gcloud invocation.

With the current code, gcloud is called everytime.
Thus introducing additional runtime dependency.
2016-08-28 13:25:41 +02:00
Kubernetes Submit Queue 60f978de07 Merge pull request #30316 from caesarxuchao/debug-cascading-deletion
Automatic merge from submit-queue

[GarbageCollector] Increase log verbosity for Garbage collector tests

I cannot reproduce the flake of GC locally, see https://github.com/kubernetes/kubernetes/issues/28713#issuecomment-237842105, so I increased the log verbosity for Garbage collector tests.
2016-08-26 18:09:36 -07:00
Chao Xu 9ac91e5172 debugging gc 2016-08-26 15:58:33 -07:00
deads2k 5c9df6655c choose a particular directory test-integration 2016-08-26 12:33:06 -04:00
Eric Paris 6f90869996 Merge pull request #31452 from jeffmendoza/cleanup-docs-yamls
Removed non-md files from docs. Moved doc yamls to test/fixtures.
2016-08-26 12:17:12 -04:00
Jeff Mendoza 95b73058d2 Removed non-md files from docs. Moved doc yamls to test/fixtures.
Most of the contents of docs/ has moved to kubernetes.github.io.
Development of the docs and accompanying files has continued there, making
the copies in this repo stale. I've removed everything but the .md files
which remain to redirect old links. The .yaml config files in the docs
were used by some tests, these have been moved to test/fixtures/doc-yaml,
and can remain there to be used by tests or other purposes.
2016-08-25 15:09:27 -07:00
Random-Liu afb780d4ee Move utilities into different packages. Add local and remove runner. 2016-08-24 20:18:45 -07:00
Ivan Shvedunov 0ca373d0a4 Fix overlong junit filename prefixes (2nd attempt) 2016-08-23 01:04:34 +03:00
Kubernetes Submit Queue 36f61007ef Merge pull request #30893 from ivan4th/fix-caching-of-go-dirs
Automatic merge from submit-queue

Fix caching of go dirs during build

Sometimes when you press `^C` during `make` the subsequent attempt to run `make` hangs due to zero-sized cache file for `ALL_GO_DIRS` var in Makefile.generated_files:
```
vagrant@devbox:~/work/kubernetes/src/k8s.io/kubernetes (master *%) $ KUBE_JUNIT_REPORT_DIR=/tmp/art KUBE_COVER=y make test
# hangs...
^CMakefile:279: recipe for target 'generated_files' failed
make: *** [generated_files] Interrupt

vagrant@devbox:~/work/kubernetes/src/k8s.io/kubernetes (master *%) $ ls -l .make/all_go_dirs.mk
-rw-rw-r-- 1 vagrant vagrant 0 Aug 18 15:03 .make/all_go_dirs.mk
```

 Corresponding process subtree looks like the following:
```
└─make test
    └─make -f Makefile.generated_files generated_files
        └─bash -c grep --color=never -l '+k8s:deepcopy-gen='  | xargs -n1 dirname | sort -u
            ├─grep --color=never -l +k8s:deepcopy-gen=
            ├─sort -u
            └─xargs -n1 dirname
```

Let's remove the cache file if `cache_go_dirs.sh` gets interrupted.
2016-08-22 00:54:33 -07:00
Kubernetes Submit Queue e9947d9ad7 Merge pull request #30813 from bprashanth/kubectl_petset
Automatic merge from submit-queue

Basic scaler/reaper for petset

Currently scaling or upgrading a petset is more complicated than it should be. Would be nice if this made code freeze on friday. I'm planning on a follow up change with generation number and e2es post freeze.
2016-08-20 10:51:07 -07:00
Kubernetes Submit Queue b29023aa91 Merge pull request #30810 from mnshaw/gubernator-bugs
Automatic merge from submit-queue

Gubernator bug fixes: mv and GCS bucket permissions

Fixed issue where results file was not moved correctly, and also the permissions issue with the GCS bucket.

Will rebase after #30414 is merged

@timstclair
2016-08-19 14:34:56 -07:00
Kubernetes Submit Queue d40e2296b2 Merge pull request #30630 from silasbw/short-n0
Automatic merge from submit-queue

Add a short `-n` for `kubectl --namespace`

fixes #24078

 `--namespace` is a very common flag for nearly every `kubectl` command we have. We should claim `-n` for it.
2016-08-19 14:34:13 -07:00
Kubernetes Submit Queue f51e834d63 Merge pull request #30445 from deads2k/get-raw
Automatic merge from submit-queue

add --raw for kubectl get

Adds a `--raw` option to `kubectl get` that allow you specify your URI, but use the transport built by `kubectl`.  This is especially useful when working with secured environments that require authentication and authorization to hit non-api endpoints.  For example, `kubect get --raw /metrics` or if you want to debug a watch with a view at the exact data `kubectl get --raw '/api/v1/namespaces/one/replicationcontrollers?watch=true'`.

@kubernetes/kubectl 
@fabianofranz fyi
2016-08-19 09:29:08 -07:00
krousey 0e5e6f4a94 Merge pull request #30894 from ivan4th/fix-overlong-junit-prefixes
Fix overlong junit filename prefixes
2016-08-18 15:03:59 -07:00
Marie Shaw f7e2109b8b Fix GCS permissions and file moving bugs 2016-08-18 14:51:33 -07:00
Kubernetes Submit Queue c8591c710b Merge pull request #30414 from mnshaw/run-remote-tests
Automatic merge from submit-queue

Add GUBERNATOR flag which produces g8r link for node e2e tests

When you run 'make tests-e2e-node REMOTE=true GUBERNATOR=true' outputs a URL to view the test results on Gubernator. ~~Should work after my PR for Gubernator is merged.~~

@timstclair
2016-08-18 14:40:12 -07:00
Ivan Shvedunov 98ea7b9441 Fix overlong junit filename prefixes 2016-08-18 23:24:41 +03:00
Ivan Shvedunov 7f422377e2 Fix caching of go dirs during build 2016-08-18 18:47:02 +03:00
Kubernetes Submit Queue 6fb10dd762 Merge pull request #30241 from Q-Lee/webhook
Automatic merge from submit-queue

Adding types file for image admission controller.

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
Adding container image verification webhook API.
```
2016-08-17 21:30:34 -07:00
bprashanth beb2088b1a test-cmd 2016-08-17 17:37:56 -07:00
Quintin Lee 19c0c676d8 Adding imagepolicy group non-autogenerated code. 2016-08-17 12:25:42 -07:00
Timothy St. Clair 730fc70107 Update etcd default ports for v3, and validate tests 2016-08-17 07:49:19 -05:00
deads2k 1ed263e0e5 add --raw for kubectl get 2016-08-17 08:45:50 -04:00
Marie Shaw d69252cbc2 Add GUBERNATOR flag for remote node e2e tests to produce gubernator link 2016-08-16 17:10:59 -07:00
Silas Boyd-Wickizer 39a9ec3a4f Add a short `-n` for `kubectl`'s `--namespace`
fixes #24078

--namespace is a very common flag for nearly every kubectl command we have.
We should claim -n for it.
2016-08-16 08:32:47 -07:00
Kubernetes Submit Queue 69419a145a Merge pull request #29802 from jfrazelle/fix-go-vet-errors
Automatic merge from submit-queue

fix go vet errors

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

```release-note
```

This fixes the `go vet` errors brought about by go 1.7 testing re (#28742).

The are all pretty trivial and mostly related to literal composites.

also related to #16086
2016-08-15 13:10:08 -07:00
Kubernetes Submit Queue 3a8b21b3a5 Merge pull request #29724 from brendandburns/thirdparty3
Automatic merge from submit-queue

Fix third party APIResource reporting

@polvi @caesarxuchao @deads2k 

This "fixes" some additional bugs in third party `APIResourceList` reporting.

This code needs a bunch of cleanup, and more tests, but sending it out for a quick smell check review in case I'm doing something stupid.

Fixes the bug referenced here:  https://github.com/kubernetes/kubernetes/pull/28414#issuecomment-235346108 and in https://github.com/kubernetes/kubernetes/issues/23831

Fixes https://github.com/kubernetes/kubernetes/issues/25570
2016-08-13 17:10:20 -07:00
Brendan Burns b3658c7b16 Fix third party APIResource reporting 2016-08-13 15:51:34 -07:00
Kubernetes Submit Queue 2ab58ea519 Merge pull request #30162 from juanvallejo/jvallejo_err-kube-run-on-invalid-image-value
Automatic merge from submit-queue

return err on `kubectl run --image` with invalid value

When running `kubectl run <configname> --image="Invalid$$%ImageValue%%__"`, a configuration is successfully created with an image name that is not a valid value for an image reference.

This patch validates that the image name is a valid image reference, and returns an error before creating a config if an invalid value is passed.

`$ kubectl run test --image="Invalid__%imagename"`
```
error: Invalid image name "Invalid__%imagename": invalid reference format
```

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30162)
<!-- Reviewable:end -->
2016-08-12 06:09:26 -07:00
Jess Frazelle 7e9d82129e
fix go vet errors
Signed-off-by: Jess Frazelle <jessfraz@google.com>

fix composites

Signed-off-by: Jess Frazelle <me@jessfraz.com>
2016-08-10 16:45:41 -07:00
Vishnu kannan e9034f1e0a make GCI the default node e2e test image. Fix bugs in runner
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-08-10 11:25:40 -07:00
Kubernetes Submit Queue f53a35fb76 Merge pull request #29147 from caesarxuchao/cut-client-repo-staging
Automatic merge from submit-queue

Cut the client repo, staging it in the main repo

Tracking issue: #28559
ref: https://github.com/kubernetes/kubernetes/pull/25978#issuecomment-232710174

This PR implements the plan a few of us came up with last week for cutting client into its own repo:
1. creating "_staging" (name is tentative) directory in the main repo, using a script to copy the client and its dependencies to this directory
2. periodically publishing the contents of this staging client to k8s.io/client-go repo
3. converting k8s components in the main repo to use the staged client. They should import the staged client as if the client were vendored. (i.e., the import line should be `import "k8s.io/client-go/<pacakge name>`). This requirement is to ease step 4.
4. In the future, removing the staging area, and vendoring the real client-go repo.

The advantage of having the staging area is that we can continuously run integration/e2e tests with the latest client repo and the latest main repo, without waiting for the client repo to be vendored back into the main repo. This staging area will exist until our test matrix is vendoring both the client and the server.

In the above plan, the tricky part is step 3. This PR achieves it by creating a symlink under ./vendor, pointing to the staging area, so packages in the main repo can refer to the client repo as if it's vendored. To prevent the godep tool from messing up the staging area, we export the staged client to GOPATH in hack/godep-save.sh so godep will think the client packages are local and won't attempt to manage ./vendor/k8s.io/client-go.

This is a POC. We'll rearrange the directory layout of the client before merge.

@thockin @lavalamp @bgrant0607 @kubernetes/sig-api-machinery

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/29147)
<!-- Reviewable:end -->
2016-08-09 17:12:14 -07:00