Commit Graph

1195 Commits (a07298ce54e3110c0c5e3f121a0d728193cdee63)

Author SHA1 Message Date
Kubernetes Submit Queue 017e61c76f Merge pull request #46525 from deads2k/crd-06-beta
Automatic merge from submit-queue (batch tested with PRs 43275, 45014, 46449, 46488, 46525)

move CustomResourceDefinitions from alpha to beta

CRDs are built upon the known ThirdPartyResource API with the lessons learned guiding the new shape.  Short comings of the old TPR API even have specific tests to ensure that CRDs do not face the same issues.  Given that, this API qualifies for beta.

These are straight mechanical changes.

@kubernetes/sig-api-machinery-misc 
@ericchiang  You asked about this in the original pull.
2017-05-30 07:49:10 -07:00
Kubernetes Submit Queue 56e73d829a Merge pull request #46449 from crawford/master
Automatic merge from submit-queue (batch tested with PRs 43275, 45014, 46449, 46488, 46525)

Export ErrWatchClosed from watch.Until

This is needed so that users of watch.Until may check for this
particular error instead of attempting to match the error string.
2017-05-30 07:49:05 -07:00
deads2k ce681fe47c move CRD from alpha to beta 2017-05-30 07:57:26 -04:00
Kubernetes Submit Queue 6ff83d123c Merge pull request #37212 from gmarek/ms
Automatic merge from submit-queue (batch tested with PRs 45534, 37212, 46613, 46350)

Add unversioned.MicroTime type

Ref. #36752

cc @smarterclayton @wojtek-t @dchen1107 @timothysc @bgrant0607
2017-05-30 04:46:01 -07:00
Wojciech Tyczynski f93a270edc Optimize selector for single-matching items 2017-05-30 08:08:15 +02:00
Wojciech Tyczynski 48d0249a40 allow for deleting field selector requirements using Transform 2017-05-30 08:07:56 +02:00
Kubernetes Submit Queue cc432dbc77 Merge pull request #46594 from xychu/golint
Automatic merge from submit-queue

Fix golint error in apimachinery/pkg/{fields,lables}

Also add these two packages to linted packages lists



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-29 22:02:20 -07:00
Kubernetes Submit Queue d6cc1de9cd Merge pull request #39930 from justinsb/fix_typo_multipled
Automatic merge from submit-queue

typos: spelling fixes in pkg/util/wait/wait.go

```release-note
NONE
```
2017-05-29 13:46:52 -07:00
Kubernetes Submit Queue 4d358a23b6 Merge pull request #46335 from sttts/sttts-audit-stages
Automatic merge from submit-queue (batch tested with PRs 45699, 46200, 46335, 46599)

audit: implement stages

Based on https://github.com/kubernetes/kubernetes/pull/46065. Implementing https://github.com/kubernetes/kubernetes/pull/46065#discussion_r117438531.
2017-05-29 11:14:03 -07:00
Kubernetes Submit Queue 313dc6b5a5 Merge pull request #46200 from nikhita/crd-test-name-collision
Automatic merge from submit-queue (batch tested with PRs 45699, 46200, 46335, 46599)

apiextensions: add integration test for name conflicts

**What this PR does / why we need it**: Add integration test for name conflicts.
Create 2 CRDs with name conflict. The controller sets the NameConflict condition on the second one. Delete the first one. The second CRD should now get accepted.

Update:
- [x] Add integration test for name conflicts
- [x] Fix naming controller so that when a resource is deleted, other resources in the same group are added to the queue
- [x]  Add integration test for self link (cluster scoped resources)
- [x] Add bigger poll interval
- [x] Fix DeleteCustomResourceDefinition poll condition


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

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
@sttts
2017-05-29 11:14:01 -07:00
Dr. Stefan Schimanski 548f7be8fa audit: uniform 2 or 3 events for short/long running requests 2017-05-29 18:02:49 +02:00
Dr. Stefan Schimanski 1e94185f44 audit: fill in stage 2017-05-29 17:52:23 +02:00
Dr. Stefan Schimanski 019003b926 audit: fill in sub-resource 2017-05-29 17:52:23 +02:00
Dr. Stefan Schimanski 3e9c8aaac6 audit-types: add Panic stage 2017-05-29 17:52:23 +02:00
Nikhita Raghunath 7cfba87baa
Add integration test for apiextensions
* add integration test for name conflicts of CRDs
* fix naming controller so that when a resource is deleted,
other resources in the same group are added to the queue
* add integration test for self link (clusterscoped resources)
* fix minor nits

address comments
add comments and fix nits

Bigger poll interval

customResource -> crd

Fix DeleteCustomResourceDefinition condition
2017-05-29 21:11:11 +05:30
gmarek 989d4051d9 generated 2017-05-29 15:08:55 +02:00
gmarek ec874b062f Add metav1.MicroTime type 2017-05-29 15:08:55 +02:00
Ethan Chu d7485de02a Fix golint error in apimachinery/pkg/{fields,lables}
Also add these two packages to linted packages lists
2017-05-29 21:07:00 +08:00
Kubernetes Submit Queue a673d99731 Merge pull request #46548 from timstclair/audit-policy
Automatic merge from submit-queue

Fix audit level none

... and add a testcase for it

https://github.com/kubernetes/features/issues/22

/cc @sttts @ericchiang
2017-05-29 02:38:34 -07:00
Dan Winship 0923f860f1 Regenerate files 2017-05-28 10:11:02 -04:00
Kubernetes Submit Queue c2667203e4 Merge pull request #45859 from DirectXMan12/refactor/protobuf-for-metrics
Automatic merge from submit-queue

Protobuf generation for k8s.io/metrics

This PR introduces protobuf generation for k8s.io/metrics.  Doing so required:

- fixing a bug in `go-to-protobuf` causing the `cast{key,value,type}` values to not be quoted when coming from struct tags (and not auto-injection by `go-to-protobuf` itself).
- Making sure the proto IDL in k8s.io/client-go had a package name of `k8s.io.client_go.xyz` and not `k8s.io.kubernetes.xyz`.

Additionally, I updated `go-to-protobuf` to skip functions and non-public types when composing the import list, which cuts down on the more bizarre imports in the IDL (like importing the sample API package in every IDL file because it contained `addToScheme`, like every other API package).

We use `castvalue` to force gogo-proto to realize that it should consider the value of the map which underlies `ResourceList` when calculating which imports need to be named.  Otherwise, it ignores the value's type, leading to compilation errors when it later can't find an import it assumed existed.  We accidentally didn't hit this in `k8s.io/kubernetes/pkg/api/v1` since another field coincidentally happens to directly use `resource.Quantity` (the value type of `ResourceList`).

**Release note**:
```release-note
NONE
```
2017-05-27 14:08:46 -07:00
Solly Ross 8d03536d00 Regenerate protobuf and client-go
This commit regenerates the protobuf as per the recent generation
changes (removing erroneous imports, adding k8s.io/metrics), and
syncs the changes to client-go (which also ensures that client-go
protobuf IDL has the correct package names).
2017-05-27 00:37:49 -04:00
Kubernetes Submit Queue fdb4fa689e Merge pull request #44742 from cheftako/aggregate
Automatic merge from submit-queue (batch tested with PRs 46302, 44597, 44742, 46554)

Change to aggregator so it calls a user apiservice via its pod IP.

proxy_handler now does a sideways call to lookup the pod IPs for aservice.
It will then pick a random pod IP to forward the use apiserver request to.

**What this PR does / why we need it**: It allows the aggregator to work without setting up the full network stack on the kube master (i.e. with kube-dns or kube-proxy)

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-26 20:39:56 -07:00
Kubernetes Submit Queue 6927e7061b Merge pull request #44597 from mengqiy/replacekeys
Automatic merge from submit-queue (batch tested with PRs 46302, 44597, 44742, 46554)

support replaceKeys patch strategy

Implementing according to [this proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/add-new-patchStrategy-to-clear-fields-not-present-in-patch.md).
The revision is in kubernetes/community#620.

```release-note
support replaceKeys patch strategy and directive for strategic merge patch
```
2017-05-26 20:39:54 -07:00
Solly Ross d72cbcb339 [k8s.io/metrics] proto tags for metrics/v1alpha1
This commit adds proto tags to
`k8s.io/metrics/pkg/apis/metrics/v1alpha1`.  The tags are more-or-less
what's suggested by `go-to-protobuf`, with the exception of the use of
`castvalue`.

`castvalue` is used to force gogo-proto to realize that the value of
`ResourceList` (which is `map[ResourceName]Quantity`) is actually a type
that it should consider when recording which packages are used.
Otherwise, it ignores the type, using an unnamed import for the
`k8s.io/apimachinery/pkg/api/resource`, which causes compilation errors.
2017-05-26 19:59:27 -04:00
Solly Ross 64b5124595 [update-staging] convert package name in IDL
This commit converts the package names in the proto IDL in client-go.
This allows third parties (and repositories in staging) who make use of
types in client-go to generate proto IDL themselves properly.
2017-05-26 19:59:06 -04:00
Tim St. Clair 93e1e54e29
Fix audit level none 2017-05-26 16:31:00 -07:00
Walter Fender ad8a83a7c1 Change to aggregator so it calls a user apiservice via its pod IP.
proxy_handler now uses the endpoint router to map the cluster IP to
appropriate endpoint (Pod) IP for the given resource.
Added code to allow aggregator routing to be optional.
Updated bazel build.
Fixes to cover JLiggit comments.
Added util ResourceLocation method based on Listers.
Fixed issues from verification steps.
Updated to add an interface to obfuscate some of the routing logic.
Collapsed cluster IP resolution in to the aggregator routing
implementation.
Added 2 simple unit tests for ResolveEndpoint
2017-05-26 16:10:01 -07:00
Kubernetes Submit Queue 3be6879bde Merge pull request #46440 from deads2k/crd-03-invert
Automatic merge from submit-queue (batch tested with PRs 42256, 46479, 45436, 46440, 46417)

move CRD behind TPR

Second attempt at https://github.com/kubernetes/kubernetes/pull/46297

@liggitt since @sttts is out can you take a look and hopefully find me a different, more sane way to do this? It's a little crazy, but I left a large comment explaining why I think its the only way.
2017-05-26 15:59:03 -07:00
ymqytw 16e07c7d55 Support replaceKeys patch strategy and directive 2017-05-26 15:05:38 -07:00
Kubernetes Submit Queue 9f3a3e3c88 Merge pull request #46534 from mengqiy/addSMPOwner
Automatic merge from submit-queue

add owners file for strategic merge patch

`staging/src/k8s.io/apimachinery/pkg/util/strategicpatch` is the strategic merge patch pkg
`staging/src/k8s.io/apimachinery/pkg/util/mergepatch` is the util pkg for strategic merge patch and json merge patch
`staging/src/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS` is another util pkg used by strategic merge patch

cc: @pwittrock @grodrigues3 @apelisse
2017-05-26 14:46:10 -07:00
Kubernetes Submit Queue 7bc6da0b77 Merge pull request #46294 from caesarxuchao/dynamic-registration-prototype
Automatic merge from submit-queue (batch tested with PRs 46383, 45645, 45923, 44884, 46294)

Dynamic registration prototype

Implementing the api proposed in https://github.com/kubernetes/community/pull/611.
Wiring the code to serve the api via apiserver.
```release-note
Adding admissionregistration API group which enables dynamic registration of initializers and external admission webhooks. It is an alpha feature.
```
2017-05-26 12:58:07 -07:00
ymqytw 428fb52f98 add owners file for strategic merge patch 2017-05-26 12:44:07 -07:00
Kubernetes Submit Queue 97fd065251 Merge pull request #46501 from sttts/sttts-crd-finalizer-sync
Automatic merge from submit-queue (batch tested with PRs 46501, 45944, 46473)

apiextensions: fix missing storage on CRD delete without previous CR access

Create CR storage on demand when needed from CRD finalizer controller.

/cc @nikhita
2017-05-26 10:13:56 -07:00
deads2k 18177e2bde move CRD behind TPR 2017-05-26 12:15:13 -04:00
Kubernetes Submit Queue 8951bb609d Merge pull request #46511 from deads2k/crd-04-short
Automatic merge from submit-queue

add crd shortname

Adds a shortname, `crd`, for `CustomResourceDefinition`.
2017-05-26 09:11:16 -07:00
deads2k 4b149e740c add crd shortname 2017-05-26 10:24:53 -04:00
deads2k d441568312 remove duplicate, flaky tests 2017-05-26 10:08:09 -04:00
Kubernetes Submit Queue 7f8fd32ecb Merge pull request #46418 from zjj2wry/ux
Automatic merge from submit-queue

fix err message typo and small change in UX

**What this PR does / why we need it**:
1. small ux change

2. fix typo: convertable to convertible

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-26 05:46:47 -07:00
Dr. Stefan Schimanski 60c48628bf apiextensions: create CR storage on demand from finalizer 2017-05-26 14:37:24 +02:00
Kubernetes Submit Queue 73314a04e4 Merge pull request #39829 from MHBauer/prepareforcreate-doc
Automatic merge from submit-queue

documentation for implementors of RESTCreateStrategy

**What this PR does / why we need it**:
Documentation useful for those implementing these methods.

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

**Special notes for your reviewer**:
I am implementing these for service broker, and gives me examples of what is done or should be done.

**Release note**:
-->
```release-note
NONE
```
2017-05-26 00:47:36 -07:00
Chao Xu 89e506c46a generated 2017-05-26 00:14:11 -07:00
Kubernetes Submit Queue 7d37a2685c Merge pull request #45867 from kow3ns/controller-history
Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Controller history

**What this PR does / why we need it**:
Implements the ControllerRevision API object and clientset to allow for the implementation of StatefulSet update and DaemonSet history

```release-note
ControllerRevision type added for StatefulSet and DaemonSet history.
```
2017-05-25 22:42:08 -07:00
Kubernetes Submit Queue 3e1eceaf90 Merge pull request #46045 from enj/enj/t/watch_decode_fatal
Automatic merge from submit-queue (batch tested with PRs 46124, 46434, 46089, 45589, 46045)

Panic server on watch errors during etcd test

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

This change makes it so that errors during watch decoding panic the server during the etcd storage test.  This allows us to catch coder errors related to storing incompatible types at the same location in etcd.

For example, https://github.com/kubernetes/kubernetes/pull/39164#discussion_r116619172 would have failed like so (instead of silently recording an error to the master log and passing the test):

```
I0518 14:39:32.413038    4654 storage_rbac.go:257] created rolebinding.rbac.authorization.k8s.io/system:controller:bootstrap-signer in kube-public
panic: v1beta1.NetworkPolicy is not suitable for converting to {{"networking.k8s.io" "__internal"} [{"networking.k8s.io" ""} {"networking.k8s.io" ""}]}

goroutine 799 [running]:
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3.decodeObj(0x71146c0, 0xc420eb9d80, 0x7129340, 0x733cdf8, 0xc423708360, 0x118, 0x120, 0x86, 0x0, 0x0, ...)
	/home/mkhan/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go:382 +0x115
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3.(*watchChan).prepareObjs(0xc420958f60, 0xc422ee9ef0, 0xc42003c600, 0x8a3b9b, 0x70f36c0, 0xc4209585a0, 0x4583f0, 0xc4215d0f58)
	/home/mkhan/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go:353 +0x2cd
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3.(*watchChan).transform(0xc420958f60, 0xc422ee9ef0, 0x0)
	/home/mkhan/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go:248 +0x4d
k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3.(*watchChan).processEvent(0xc420958f60, 0xc420132010)
	/home/mkhan/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go:213 +0x122
created by k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3.(*watchChan).run
	/home/mkhan/go/src/k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes/vendor/k8s.io/apiserver/pkg/storage/etcd3/watcher.go:116 +0xe9
exit status 2
FAIL	k8s.io/kubernetes/test/integration/etcd	13.065s
Makefile:164: recipe for target 'test' failed
```

@liggitt PTAL

Signed-off-by: Monis Khan <mkhan@redhat.com>

**Release note**:

```
NONE
```
2017-05-25 21:40:07 -07:00
Kubernetes Submit Queue ae03f22c65 Merge pull request #46009 from timstclair/audit-policy
Automatic merge from submit-queue (batch tested with PRs 45949, 46009, 46320, 46423, 46437)

Implement audit policy logic

Includes https://github.com/kubernetes/kubernetes/pull/45315#discussion_r117115932 (ignore the first commit)

Feature: https://github.com/kubernetes/features/issues/22

Remaining work:

- [x] Load the policy into the `server.Config`
- [x] Rebase on https://github.com/kubernetes/kubernetes/pull/45315
- [x] Establish shared code for audit api scheme (with https://github.com/kubernetes/kubernetes/pull/45919)
- [x] Once https://github.com/kubernetes/kubernetes/pull/45766 is merged, call the policy checker in the audit path

/cc @sttts @soltysh @ericchiang @ihmccreery @pweil- @deads2k
2017-05-25 19:40:59 -07:00
Kubernetes Submit Queue 6810b99f9d Merge pull request #46146 from mengqiy/sortinpatchtestcase
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

Fix bug in SMP test

Fixing a bug in strategic merge patch test.

before:
we check if customizedSort(input) == customizedSort(expected), which is always true
after:
we check if customizedSort(input) == expected

```release-note
NONE
```
2017-05-25 11:46:03 -07:00
Kubernetes Submit Queue 6a8ea80ecb Merge pull request #46127 from liggitt/list-unwatchable
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

Return MethodNotSupported when accessing unwatcheable resource with ?watch=true

Currently, if a RESTStorage does not implement Watch(), accessing the list endpoint with ?watch=true will call List, with ListOptions.Watch=true. It should return a MethodNotSupported error.
2017-05-25 11:46:01 -07:00
Kenneth Owens ba128e6e41 Implements ControllerRevision API Object without codec and code
generation
2017-05-25 11:38:57 -07:00
Monis Khan a13f026fd0
Panic server on watch errors in test environment
This change makes it so that errors during watch decoding panic the
server if it is in a test environment.  This allows us to catch coder
errors related to storing incompatible types at the same location in
etcd.

Signed-off-by: Monis Khan <mkhan@redhat.com>
2017-05-25 13:54:56 -04:00
Alex Crawford 505a7e935d Export ErrWatchClosed from watch.Until
This is needed so that users of watch.Until may check for this
particular error instead of attempting to match the error string.

```release-note
NONE
```
2017-05-25 10:19:59 -07:00