Commit Graph

1229 Commits (33c34f0ae492c29d6c60265549d40dd79db76348)

Author SHA1 Message Date
Kubernetes Submit Queue dd897a557d Merge pull request #46536 from deads2k/crd-07-deflake
Automatic merge from submit-queue

try to deflake CR watches in tests

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

I've added a comment trying to explain the reasoning in the code.  Without being able to expose the RV of the cache, I can't think of a reliable way to do it.  Even if you tried experimenting with a watch, it essentially does this since you'd be waiting to not get an error.
2017-06-01 15:42:04 -07:00
Kubernetes Submit Queue f7a1f10275 Merge pull request #45919 from ericchiang/audit-webhook-backend
Automatic merge from submit-queue

apiserver: add a webhook implementation of the audit backend

This builds off of #45315 and is intended to implement an interfaced defined in #45766.

TODO:

- [x] Rebase on top of API types PR.
- [x] Rebase on top of API types updates (#46065)
- [x] Rebase on top of feature flag (#46009)
- [x] Rebase on top of audit instrumentation.
- [x] Hook up API server flag or register plugin (depending on #45766)

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

Design proposal https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auditing.md

```release-notes
Webhook added to the API server which omits structured audit log events.
```

/cc @soltysh @timstclair @soltysh @deads2k
2017-06-01 13:41:59 -07:00
Kubernetes Submit Queue 14a1cdd208 Merge pull request #44785 from jingxu97/April/apistorage
Automatic merge from submit-queue

Add Local Storage Capacity Isolation API

This PR adds the new APIs to support storage capacity isolation as
described in the proposal [https://github.com/kubernetes/community/pull/306](url)

1. Add SizeLimit for emptyDir volume
2. Add scratch and overlay storage type used by container level or
node level


**Release note**:

```release-note
Alpha feature: Local volume Storage Capacity Isolation allows users to set storage limit to isolate EmptyDir volumes, container storage overlay, and also supports allocatable storage for shared root file system. 
```
2017-06-01 09:12:19 -07:00
Kubernetes Submit Queue 82245a1f06 Merge pull request #45980 from mengqiy/setElementOrder
Automatic merge from submit-queue

support setElementOrder

Implement [proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/preserve-order-in-strategic-merge-patch.md).

Fixes #40373

```release-note
kubectl edit and kubectl apply will keep the ordering of elements in merged lists
```
2017-06-01 09:12:13 -07:00
Kubernetes Submit Queue 67724439fd Merge pull request #46623 from sttts/sttts-aggregator-unified-modes
Automatic merge from submit-queue (batch tested with PRs 43505, 45168, 46439, 46677, 46623)

aggregator: unify resolver implementation and tests

This is https://github.com/kubernetes/kubernetes/pull/45082, but without the port support.
2017-06-01 05:43:46 -07:00
Dr. Stefan Schimanski c7d9a396fd Update bazel 2017-06-01 09:26:28 +02:00
Dr. Stefan Schimanski 8b409e8f77 aggregation: add ExternalName service support 2017-06-01 09:26:28 +02:00
Dr. Stefan Schimanski b1f708758c aggregation: handle ClusterIPNone correctly 2017-06-01 09:26:28 +02:00
Dr. Stefan Schimanski d56759452c aggregation: unify mode implementations 2017-06-01 09:26:28 +02:00
Dr. Stefan Schimanski 35335c09e1 aggregation: restore cluster-ip routing tests 2017-06-01 09:26:27 +02:00
Mikhail Mazurskiy 5ac9d860a3
Test finalization of CRD
Updates #45511
2017-06-01 09:18:42 +10:00
ymqytw c3481b07d2 support setElementOrder 2017-05-31 15:08:25 -07:00
Jing Xu 695f7be697 generated files 2017-05-31 13:06:39 -07:00
Eric Chiang a88e0187f9 apiserver: add a webhook implementation of the audit backend 2017-05-31 09:45:23 -07:00
Kubernetes Submit Queue c79df64306 Merge pull request #46242 from ahmetb/clientgo-examples/crud-deployment
Automatic merge from submit-queue

clientgo/examples: Add CRUD Deployment sample
2017-05-31 01:54:07 -07:00
Kubernetes Submit Queue e97b72296f Merge pull request #46556 from mbohlool/gvk
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Use meta.v1 GroupVersionKind with json tags to generate OpenAPI spec

We are using two different GVK struct in generation of OpenAPI extensions. This PR unify that and also add json tags to meta.v1 GVK to comply with json naming system in other serializations. Also the value of Action extension is now lowercase.

ref: https://github.com/kubernetes/kubernetes/pull/46388
2017-05-30 23:20:04 -07:00
Kubernetes Submit Queue 0aad9d30e3 Merge pull request #44897 from msau42/local-storage-plugin
Automatic merge from submit-queue (batch tested with PRs 46076, 43879, 44897, 46556, 46654)

Local storage plugin

**What this PR does / why we need it**:
Volume plugin implementation for local persistent volumes.  Scheduler predicate will direct already-bound PVCs to the node that the local PV is at.  PVC binding still happens independently.

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

**Release note**:

```
Alpha feature: Local volume plugin allows local directories to be created and consumed as a Persistent Volume.  These volumes have node affinity and pods will only be scheduled to the node that the volume is at.
```
2017-05-30 23:20:02 -07:00
Kubernetes Submit Queue a44bf9fd7f Merge pull request #46134 from ahmetb/clientgo-examples/out-of-cluster
Automatic merge from submit-queue (batch tested with PRs 44061, 46614, 46419, 46628, 46134)

clientgo/examples/out-of-cluster: add instructions
2017-05-30 18:35:05 -07:00
Kubernetes Submit Queue 8c1f45953b Merge pull request #46431 from zjj2wry/rollback-rollback
Automatic merge from submit-queue (batch tested with PRs 42240, 46100, 46154, 46431, 45755)

Fix api description in swagger

**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
 NONE
```
2017-05-30 14:57:05 -07:00
mbohlool a3cbfde4b1 Make OpenAPI GVK and Action extensions all lower-case 2017-05-30 14:43:27 -07:00
Kubernetes Submit Queue db5c21f328 Merge pull request #42240 from fate-grand-order/patch-3
Automatic merge from submit-queue

correct misspell "identify" in client_config.go
2017-05-30 14:41:51 -07:00
Kubernetes Submit Queue b5eadb5d6b Merge pull request #43946 from jhorwit2/jah/host-path-psp
Automatic merge from submit-queue (batch tested with PRs 46489, 46281, 46463, 46114, 43946)

Allow PSP's to specify a whitelist of allowed paths for host volume

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

This PR adds the ability to whitelist paths for the host volume to ensure pods cannot access directories they aren't supposed to. E.g. `/var/lib/kubelet`, `/etc/kubernetes/*`, etc. 

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


**Special notes for your reviewer**:

**Release note**:

```release-note
Allow PSP's to specify a whitelist of allowed paths for host volume based on path prefixes
```
2017-05-30 11:59:10 -07:00
Ahmet Alp Balkan e59f05fe0e
clientgo/examples/out-of-cluster: add instructions
Adding instructions for out-of-cluster example and making it work without
specifying the -kubeconfig argument if the home directory can be inferred.

This is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-30 09:58:59 -07:00
Ahmet Alp Balkan d75710f9f4
client-go: Add CRUD Deployment sample
This sample adds sample code for create/list/replace/delete operations for
Deployment resource for client-go library. This patch also contains
documentation explaining what the example application does and how it can be
executed.

This patch is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-05-30 09:52:53 -07:00
Kubernetes Submit Queue cb201802a1 Merge pull request #46459 from p0lyn0mial/move_admission_lifecycle_to_genericapi
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Move admission lifecycle to genericapi

**What this PR does / why we need it**:  ends the whole sequence of moving some admission plugins to generic api.


**Release note**:

```release-note
NONE
```
2017-05-30 08:42:02 -07:00
Kubernetes Submit Queue 82f24cee5e Merge pull request #46390 from enj/enj/i/require_delete_strategy
Automatic merge from submit-queue (batch tested with PRs 46552, 46608, 46390, 46605, 46459)

Require DeleteStrategy for all registry.Store

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

All `registry.Store` objects already set a non-nil `DeleteStrategy`.  This change ensures that all future objects do so as well.

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

xref: #24153 openshift/origin/issues/14198

cc @deads2k @liggitt @caesarxuchao @lavalamp @smarterclayton @derekmahar 

In regards to this, why is the `RESTDeleteStrategy` a useless interface (as far as deletion goes)?  We cast it to `GarbageCollectionDeleteStrategy` or `RESTGracefulDeleteStrategy` in an attempt to do operations related to deletion, but we have "default" behavior for both of those cases.  It should be possible to make `DeleteStrategy` optional by using the other strategies as the `runtime.ObjectTyper` and then defaulting a `nil` `DeleteStrategy` with the expected behavior.

```go
// RESTDeleteStrategy defines deletion behavior on an object that follows Kubernetes
// API conventions.
type RESTDeleteStrategy interface {
	runtime.ObjectTyper
}

type GarbageCollectionPolicy string

const (
	DeleteDependents GarbageCollectionPolicy = "DeleteDependents"
	OrphanDependents GarbageCollectionPolicy = "OrphanDependents"
)

// GarbageCollectionDeleteStrategy must be implemented by the registry that wants to
// orphan dependents by default.
type GarbageCollectionDeleteStrategy interface {
	// DefaultGarbageCollectionPolicy returns the default garbage collection behavior.
	DefaultGarbageCollectionPolicy() GarbageCollectionPolicy
}

// RESTGracefulDeleteStrategy must be implemented by the registry that supports
// graceful deletion.
type RESTGracefulDeleteStrategy interface {
	// CheckGracefulDelete should return true if the object can be gracefully deleted and set
	// any default values on the DeleteOptions.
	CheckGracefulDelete(ctx genericapirequest.Context, obj runtime.Object, options *metav1.DeleteOptions) bool
}
```

**Release note**:

```
NONE
```
2017-05-30 08:41:57 -07:00
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 8170cf0fd3 try to make the watch cache for CRs match first return values 2017-05-30 09:13:11 -04: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
p0lyn0mial 77eb2f3950 register all generic admission plugins when AdmissionOptions are created.
lifecycle plugin: make use of the libraries under k8s.io/client-go/pkg/api and k8s.io/client-go/kubernetes
for the client libraries instead of k8s.io/kubernetes/client/*

move registration to AdmissionOptions
2017-05-29 22:08:59 +02: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
Josh Horwitz 24271c4c86 staging client 2017-05-29 13:03:25 -04: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