Commit Graph

6328 Commits (04c6d0ab26bd273fd57db0f3e8a07bd39e9eb655)

Author SHA1 Message Date
Joe Betz 04c6d0ab26 Bump etcd server patch version to 3.2.16 2018-03-05 13:58:51 -08:00
Jeff Grafton 0c1f69a213 Update gazelle to latest to fix vendoring issue 2018-03-02 11:58:31 -08:00
Kubernetes Submit Queue f9f5677b3e
Merge pull request #60618 from rmmh/verify-explicit
Automatic merge from submit-queue (batch tested with PRs 60530, 60618). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for `make verify WHAT=typecheck`

This will be used to make the typecheck job emit junit and avoids duplicating the rest of the verify logic.

**Release note**:
```release-note
NONE
```
2018-03-01 18:49:44 -08:00
Ryan Hitchman d295ca1134 Add support for `make verify WHAT=typecheck`.
This will be used to make the typecheck job emit junit and avoids
duplicating the rest of the verify logic.
2018-03-01 15:03:24 -08:00
Ryan Hitchman f6e23e32f9 Only install etcd for verify tests that need it. 2018-02-28 22:05:52 -08:00
spxtr 39c9b36323 Remove spxtr from various OWNERS files.
I don't have the time to review PRs quickly anymore.
2018-02-28 13:04:32 -08:00
Ryan Hitchman 800c2f8dcd Ensure generated files are present before typechecking. 2018-02-27 14:31:57 -08:00
Ryan Hitchman dd40e612dd Add test/typecheck, a fast typecheck for all build platforms.
Most of the time spent compiling is spent optimizing and linking
binary code. Most errors occur at the syntax or semantic (type) layers.
Go's compiler is importable as a normal package, so we can do fast
syntax and type checking for the 10 platforms we build on.

This currently takes ~6 minutes of CPU time (parallelized).

This makes presubmit cross builds superfluous, since it should catch
most cross-build breaks (generally Unix and 64-bit assumptions).

Example output:

$ time go run test/typecheck/main.go
type-checking:  linux/amd64, windows/386, darwin/amd64, linux/arm, linux/386, windows/amd64, linux/arm64, linux/ppc64le, linux/s390x, darwin/386
ERROR(windows/amd64) pkg/proxy/ipvs/proxier.go:1708:27: ENXIO not declared by package unix
ERROR(windows/386) pkg/proxy/ipvs/proxier.go:1708:27: ENXIO not declared by package unix

real	0m45.083s
user	6m15.504s
sys	1m14.000s
2018-02-27 13:53:32 -08:00
Kubernetes Submit Queue 744b5d3357
Merge pull request #60431 from dims/use-feature-gates-on-kube-proxy-command-line
Automatic merge from submit-queue (batch tested with PRs 59365, 60446, 60448, 55019, 60431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use feature-gates command line for kube-proxy

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

Avoid throwing `featureGates:` into the kube-proxy yaml, since it's
not in the right format. It should be

```
    featureGates:
      AllAlpha: true
```

Since FEATURES_GATES is set to `AllAlpha=true`, we can't just throw that
into the yaml file. Just pass along FEATURES_GATES in the command line
instead just like we do for all other services

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-27 10:50:49 -08:00
Kubernetes Submit Queue 724a2f968c
Merge pull request #60446 from cblecker/no-dep-reviewer
Automatic merge from submit-queue (batch tested with PRs 59365, 60446, 60448, 55019, 60431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove dep-reviewers

**What this PR does / why we need it**:
The dep-reviewers group seems to get assigned PRs early the the review process. However, most code changes should be reviewed in the importing part of the code base first, and then assigned to an approver after.

By removing the reviewers group, the approvers plugin will still suggest assigning to an approver, but won't assign for review when the PR is initially opened.

**Release note**:

```release-note
NONE
```
2018-02-27 10:50:38 -08:00
Kubernetes Submit Queue a9ef75b98f
Merge pull request #60308 from ipuustin/shell-bugfix4
Automatic merge from submit-queue (batch tested with PRs 59310, 60424, 60308, 60436, 60020). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix potential issues and bugs in hack/lib/*.sh scripts using shellcheck

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

This PR is continuing the work for cleaning up the shell scripts using shellcheck and manual inspection. The plan is to make the scripts more robust in case for unexpected input and also to fix potential bugs.

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

**Special notes for your reviewer**:

The changes are for scripts in `hack/lib/` directory, and as library scripts are used from multiple places. It is not trivial to see all possible places from where the scripts are accessed, so careful review is needed. I tried to make sure that the changes would be compatible for older bash versions too.

**Release note**:

```release-note
NONE
```
2018-02-27 07:11:47 -08:00
wackxu dad09c1142 update golint_failures 2018-02-27 19:58:41 +08:00
Kubernetes Submit Queue d1806263f4
Merge pull request #60220 from MaciekPytel/external_metrics_client
Automatic merge from submit-queue (batch tested with PRs 59674, 60059, 60220, 58916, 60336). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Client for external metrics

Add client for External Metrics API introduced in https://github.com/kubernetes/kubernetes/pull/60079.

This PR is just client all the API changes are included from https://github.com/kubernetes/kubernetes/pull/60079.
2018-02-27 03:31:39 -08:00
Kubernetes Submit Queue 1eb1c00c44
Merge pull request #59674 from jennybuckley/codegen
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

code-gen: output golint compliant 'Generated by' comment

New PR instead of reopening #58115 because /reopen did not work.
This won't be ready to merge until the upstream https://github.com/kubernetes/gengo/pull/94 merges. Once that merges, the second commit will be changed to godep-save.sh and update-staging-godeps.sh, and the last commit will be changed to update-all.sh

The failing test is due to the upstream changes not being merged yet

```devel-release-note
Go code generated by the code generators will now have a comment which allows them to be easily identified by golint
```

Fixes #56489
2018-02-27 02:47:05 -08:00
Kubernetes Submit Queue e30b6634c3
Merge pull request #60367 from NickrenREN/admission-sc-dir-change
Automatic merge from submit-queue (batch tested with PRs 60011, 59256, 59293, 60328, 60367). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move `storageclass` into  `storage` package under `plugin/pkg/admission`

We have two directories `storage` and `storageclass` under package `plugin/pkg/admission` and one subdir `storageobjectinuseprotection` of `storage` now.
- 1. Move `storageclass` into  `storage` being  `storage`'s sub-package since storageclass is one of the storage objects
- 2. fix golint failures

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

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-02-26 23:47:59 -08:00
Kubernetes Submit Queue 205ec1e97d
Merge pull request #60147 from aledbf/remove-cassandra
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove cassandra example.

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

Removes duplicated content from this repository and `kubernetes/examples`

https://github.com/kubernetes/examples/tree/master/cassandra

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-26 22:34:15 -08:00
Kubernetes Submit Queue 5e10b13f7e
Merge pull request #59958 from ixdy/bzl-boilerplate
Automatic merge from submit-queue (batch tested with PRs 50724, 59025, 59710, 59404, 59958). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Require boilerplate on Bazel Skylark source files

**What this PR does / why we need it**: `.bzl` files are also source code, so they should probably have the boilerplate text too.

**Release note**:

```release-note
NONE
```
2018-02-26 21:34:45 -08:00
Kubernetes Submit Queue 5badfc6bac
Merge pull request #60458 from jennybuckley/integration-timeout
Automatic merge from submit-queue (batch tested with PRs 60435, 60334, 60458, 59301, 60125). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Increase timeout of integration tests

**What this PR does / why we need it**:
In #24509 we intended to increase the timeout to 600s, but it was reverted by accident in #57521 when overriding of the value was enabled. The jenkins job should honor the default of 600s instead of continuing to override it to 300s.
This lead to flaky integration tests, specifically TestCRDDeletionCascading

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

**Special notes for your reviewer**:

**Release note**:
```release-note
Increase timeout of integration tests
```
2018-02-26 17:48:47 -08:00
jennybuckley 4282d0fb7d Remove passing packages from hack/.golint_failures 2018-02-26 17:30:26 -08:00
Christoph Blecker b97b9530f0
Remove dep-reviewers 2018-02-26 17:04:32 -08:00
Manuel de Brito Fontes 02370e529b
Remove cassandra example 2018-02-26 20:39:07 -03:00
jennybuckley a1ab2b2ee1 Increase timeout of integration tests 2018-02-26 14:29:42 -08:00
Mike Danese 4186abf72b bzl: fix update-bazel.sh
pickup a85b63b06c
2018-02-26 11:01:30 -08:00
Davanum Srinivas 42cc24e68d Better PROXY_LOG and verbosity in the command line
`>"${PROXY_LOG}"` was in the wrong spot
2018-02-26 16:29:31 +00:00
Davanum Srinivas c339fc0c4f Use feature-gates command line for kube-proxy
Avoid throwing `featureGates:` into the kube-proxy yaml, since it's
not in the right format. It should be

```
    featureGates:
      AllAlpha: true
```

Since FEATURES_GATES is set to `AllAlpha=true`, we can't just throw that
into the yaml file. Just pass along FEATURES_GATES in the command line
instead just like we do for all other services
2018-02-26 09:03:39 -07:00
Beata Skiba 92adb069a3 Add external metrics client 2018-02-26 16:44:47 +01:00
Ismo Puustinen 1f41f32d3e hack/lib/protoc.sh: don't split find-binary output. 2018-02-26 16:46:19 +02:00
Ismo Puustinen afc459758e hack/lib/util.sh: remove shadowed case statements.
The topmost case statements shadow those coming after them. Since they
are never run, remove them.
2018-02-26 16:46:19 +02:00
Ismo Puustinen f03730682c hack/lib/util.sh: do not iterate over ls output.
Use globs to make the code more resilient for directory names with
special characters or whitespace.
2018-02-26 16:46:19 +02:00
Ismo Puustinen 4a82a011a0 hack/lib/util.sh: improve staging api finding.
Do not bother with pushd/popd construct -- there is no need to go back
to original directory in a subshell. Use "find --exec" instead of "find
| xargs" to handle special file names better.
2018-02-26 16:46:19 +02:00
Ismo Puustinen 39f4763afe hack/lib/util.sh: add double quotes.
Also move one test to use bash [[ insted of [.
2018-02-26 16:46:19 +02:00
Ismo Puustinen 73b5f1b78c hack/lib/init.sh: prevent splitting in 'dirname' result.
You can test this change like this:

  $ mkdir -p '/tmp/foo bar/x'
  $ cd $(dirname "/tmp/foo bar/x")
  bash: cd: too many arguments
  $ cd "$(dirname "/tmp/foo bar/x")"
  $ pwd
  /tmp/foo bar
2018-02-26 16:46:19 +02:00
Ismo Puustinen 173f8e2e4a hack/lib/golang.sh: use double quotes.
It's admittedly extremely unlikely that the host platform name would
contain special characters, but still use double quotes to pattern
matching.

Consider this script:

  #!/bin/bash

  bar="foobar"
  foo="foo*"

  [[ $bar == $foo ]] && echo "first true"
  [[ "$bar" == "$foo" ]] && echo "second true"

We get the output:

  first true

The plan is to move from first case to the second case to prevent
pattern match where there shouldn't be any.
2018-02-26 16:46:18 +02:00
Ismo Puustinen c0c888fdc1 hack/lib/golang.sh: do not split on array items. 2018-02-26 16:45:19 +02:00
Ismo Puustinen 9209953c62 hack/lib/golang.sh: split strings into arrays safely. 2018-02-26 16:45:19 +02:00
Kubernetes Submit Queue 726b73fd41
Merge pull request #60310 from juanvallejo/jvallejo/enable-server-print-in-get
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

enable server-printing in tests

**Release note**:
```release-note
NONE
```

Depends on https://github.com/kubernetes/kubernetes/pull/55637

Separate pull to test the `--experimental-server-print` flag in test-cmd-util tests introduced in https://github.com/kubernetes/kubernetes/pull/55637

cc @soltysh
2018-02-26 03:56:23 -08:00
Kubernetes Submit Queue 15b7d4666d
Merge pull request #60377 from dims/support-running-local-up-cluster-in-ci
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support Running local-up-cluster in CI

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

We have a new CI job for running conformance tests with local-up-cluster.sh: 
https://k8s-testgrid.appspot.com/sig-testing-misc#ci-kubernetes-local-e2e

In this PR, we do some additional tasks to be able to setup and run kubetest

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-02-26 02:20:06 -08:00
juanvallejo 9f3501b287 add --experimental-server-print tests 2018-02-26 01:33:27 -05:00
Kubernetes Submit Queue 2482e34b69
Merge pull request #60079 from kawych/external_metrics_api
Automatic merge from submit-queue (batch tested with PRs 59159, 60318, 60079, 59371, 57415). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Introduce External Metrics API

**What this PR does / why we need it**:
Introduce External Metrics API

This PR introduces External Metrics API which has been proposed: xref https://github.com/kubernetes/community/pull/1802

**Release note**:
```release-note
NONE
```
2018-02-24 21:19:36 -08:00
Davanum Srinivas d71b7a8d7d Support Running local-up-cluster in CI 2018-02-24 21:53:51 -05:00
NickrenREN cb34a2ca68 fix references 2018-02-24 19:16:51 +08:00
Kubernetes Submit Queue f7c65005a4
Merge pull request #59042 from soltysh/issue25442
Automatic merge from submit-queue (batch tested with PRs 60302, 57921, 59042, 60126, 59561). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove pkg/client/unversioned

**What this PR does / why we need it**:
This is removing unused package, and moves the used bits into appropriate placeholders. 

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

/assign @deads2k 
/assign @sttts
2018-02-23 14:01:44 -08:00
Karol Wychowaniec e375f3607d Include generated files 2018-02-23 18:09:06 +01:00
Kubernetes Submit Queue df3ccb65a2
Merge pull request #60196 from marpaia/unset-cdpath
Automatic merge from submit-queue (batch tested with PRs 60196, 59844, 60255, 60254, 60251). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Unset CDPATH in build script to fix path generation

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

In #52255, it was determined that if the user has set the `CDPATH` environment variable, running `make` will fail. This is because using the `KUBE_ROOT` variable results in invalid paths when the CDPATH environment variable is set.

Fixes #52255

**Release note**:

```release-note
NONE
```

/area build-release
/sig testing
2018-02-23 01:44:33 -08:00
Di Xu 16a807aaef add spelling checking script 2018-02-23 09:33:14 +08:00
Di Xu 48434b44c4 vendor misspell 2018-02-23 09:33:14 +08:00
Kubernetes Submit Queue 6e856480c0
Merge pull request #55168 from nikhita/customresources-subresources
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: add subresources for custom resources

Fixes #38113
Fixes #58778

**Related**:
- Proposal: https://github.com/kubernetes/community/pull/913
- For custom resources to work with `kubectl scale`: https://github.com/kubernetes/kubernetes/pull/58283

**Add types**:

- Add `CustomResourceSubResources` type to CRD.
    - Fix proto generation for `CustomResourceSubResourceStatus`: https://github.com/kubernetes/kubernetes/pull/55970.
- Add feature gate for `CustomResourceSubResources`.
    - Update CRD strategy: if feature gate is disabled, this feature is dropped (i.e. set to `nil`).
- Add validation for `CustomResourceSubResources`:
    - `SpecReplicasPath` should not be empty and should be a valid json path under `.spec`. If there is no value under the given path in the CustomResource, the `/scale` subresource will return an error on GET.
    - `StatusReplicasPath` should not be empty and should be a valid json path under `.status`. If there is no value under the given path in the CustomResource, the status replica value in the /scale subresource will default to 0.
    - If present, `LabelSelectorPath` should be a valid json path. If there is no value under `LabelSelectorPath` in the CustomResource, the status label selector value in the `/scale` subresource will default to the empty string.
    - `ScaleGroupVersion` should be `autoscaling/v1`.
    - If `CustomResourceSubResources` is enabled, only `properties` is allowed under the root schema for CRD validation.

**Add status and scale subresources**:

- Use helper functions from `apimachinery/pkg/apis/meta/v1/unstructured/helpers.go`.
    - Improve error handling: https://github.com/kubernetes/kubernetes/pull/56563, https://github.com/kubernetes/kubernetes/pull/58215.
- Introduce Registry interface for storage.
- Update storage:
    - Introduce `CustomResourceStorage` which acts as storage for the custom resource and its status and scale subresources. Note: storage for status and scale is only enabled when the feature gate is enabled _and_ the respective fields are enabled in the CRD.
    - Introduce `StatusREST` and its `New()`, `Get()` and `Update()` methods.
    - Introduce `ScaleREST` and its `New()`, `Get()` and `Update()` methods.
        - Get and Update use the json paths from the CRD and use it to return an `autoscaling/v1.Scale` object.
- Update strategy:
    - In `PrepareForCreate`,
         - Clear `.status`.
         - Set `.metadata.generation` = 1
    - In `PrepareForUpdate`,
         - Do not update `.status`.
             - If both the old and new objects have `.status` and it is changed, set it back to its old value.
             - If the old object has a `.status` but the new object doesn't, set it to the old value.
             - If old object did not have a `.status` but the new object does, delete it.
         - Increment generation if spec changes i.e. in the following cases:
             - If both the old and new objects had `.spec` and it changed.
             - If the old object did not have `.spec` but the new object does.
             - If the old object had a `.spec` but the new object doesn't.
     - In `Validate` and `ValidateUpdate`,
        - ensure that values at `specReplicasPath` and `statusReplicasPath` are >=0 and < maxInt32.
        - make sure there are no errors in getting the value at all the paths.
    - Introduce `statusStrategy` with its methods.
        - In `PrepareForUpdate`:
            - Do not update `.spec`.
                - If both the old and new objects have `.spec` and it is changed, set it back to its old value.
                - If the old object has a `.spec` but the new object doesn't, set it to the old value.
                - If old object did not have a `.spec` but the new object does, delete it.
             - Do not update `.metadata`.
        - In `ValidateStatusUpdate`:
            - For CRD validation, validate only under `.status`.
            - Validate value at `statusReplicasPath` as above. If `labelSelectorPath` is a path under `.status`, then validate it as well.
- Plug into the custom resource handler:
    - Store all three storage - customResource, status and scale in `crdInfo`.
    - Use the storage as per the subresource in the request.
    - Use the validator as per the subresource (for status, only use the schema for `status`, if present).
    - Serve the endpoint as per the subresource - see `serveResource`, `serveStatus` and `serveScale`.
- Update discovery by adding the `/status` and `/scale` resources, if enabled.

**Add tests**:

- Add unit tests in `etcd_test.go`.
- Add integration tests.
    - In `subresources_test.go`, use the [polymporphic scale client](https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/client-go/scale) to get and update `Scale`.
    -  Add a test to check everything works fine with yaml in `yaml_test.go`.

**Release note**:

```release-note
`/status` and `/scale` subresources are added for custom resources.
```
2018-02-22 13:37:35 -08:00
Kubernetes Submit Queue fd1527a977
Merge pull request #60131 from soltysh/integration_fixes_followup
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Return information about which int tests failed in the summary - followup

@stevekuznetsov you asked about it in https://github.com/kubernetes/kubernetes/pull/59486#discussion_r169351176

/assign @stevekuznetsov 


**Release note**:
```release-note
NONE
```
2018-02-22 10:35:47 -08:00
Nikhita Raghunath 6fbe8157e3 add subresources for custom resources 2018-02-22 23:26:09 +05:30
Mike Arpaia c5031fafd0
Unset CDPATH in build script to fix path generation
In https://github.com/kubernetes/kubernetes/issues/52255, it was
determined that if the user has a CDPATH, running `make` will fail. This
is because using the KUBE_ROOT variable results in invalid paths when
the CDPATH environment variable is set.
2018-02-22 01:12:02 -08:00