Commit Graph

1704 Commits (d717bf53b9ce5bd1c3f5fe54f74fce1b679e08e3)

Author SHA1 Message Date
Clayton Coleman cf026a3314
Move SPDY specific code into its own package 2017-07-09 16:11:05 -04:00
Clayton Coleman c73622108c
generated: bazel / godeps 2017-07-09 15:23:34 -04:00
Dr. Stefan Schimanski da3322c2d9 apimachinery: remove unneeded GetObjectKind() impls 2017-07-08 18:37:37 +02:00
Kubernetes Submit Queue 70fa697517 Merge pull request #48601 from sttts/sttts-separate-test-types
Automatic merge from submit-queue (batch tested with PRs 48583, 48605, 48601)

apimachinery+apiserver: separate test types in their own packages

Preparation for static deepcopy https://github.com/kubernetes/kubernetes/pull/48544
and its use of package-global deepcopy-gen tags for all runtime.Objects.

- [x] wait for #48497
2017-07-08 08:54:45 -07:00
Kubernetes Submit Queue eab5e060a4 Merge pull request #48605 from CaoShuFeng/json_log
Automatic merge from submit-queue (batch tested with PRs 48583, 48605, 48601)

support json output for log backend of advanced audit

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

```
Add json format support for advanced audit in apiserver. Use --audit-log-format=json to emit json to log backend.
```
2017-07-08 08:54:43 -07:00
Kubernetes Submit Queue 9c86d7473a Merge pull request #48583 from smarterclayton/record_errors
Automatic merge from submit-queue

Record 429 and timeout errors to prometheus

Allows gathering of load being shed.

Fixes #48559

@deads2k please review, there was a logic error in apiserver RequestInfo (minor, fortunately)

```release-note
Requests with the query parameter `?watch=` are treated by the API server as a request to watch, but authorization and metrics were not correctly identifying those as watch requests, instead grouping them as list calls.
```
2017-07-08 08:50:55 -07:00
Kubernetes Submit Queue a2e463f6d0 Merge pull request #48546 from deads2k/tpr-19-ripples
Automatic merge from submit-queue (batch tested with PRs 48497, 48604, 48599, 48560, 48546)

remove dead code

This removes the dead code cruft since we stopped serving TPRs.

ref #48152
2017-07-08 07:09:38 -07:00
Kubernetes Submit Queue b5c4346130 Merge pull request #48599 from sttts/sttts-audit-deepcopy-reg
Automatic merge from submit-queue (batch tested with PRs 48497, 48604, 48599, 48560, 48546)

audit: fix deepcopy registration

Remove manual registration into scheme by fixing the deepcopy tag of the api group.
2017-07-08 07:09:34 -07:00
Kubernetes Submit Queue ed66bfd2a1 Merge pull request #48604 from sttts/sttts-remove-tpr-example
Automatic merge from submit-queue (batch tested with PRs 48497, 48604, 48599, 48560, 48546)

client-go: remove TPR example

Now that the TPR api is gone (https://github.com/kubernetes/kubernetes/issues/48152).
2017-07-08 07:09:33 -07:00
Dr. Stefan Schimanski d358cb168d Update generated files 2017-07-08 10:18:14 +02:00
Dr. Stefan Schimanski 205cd90d46 apimachinery+apiserver: extract test types to work w/ deepcopy-gen 2017-07-08 10:18:14 +02:00
Dr. Stefan Schimanski ad23081273 audit: fix deepcopy registration 2017-07-08 10:15:16 +02:00
Cao Shufeng f41eb67798 remove extra WriteHeader function
The deleted two functions will be called later in the function
SerializeObject(). Not necessary to call them twice.
2017-07-08 14:07:01 +08:00
Cao Shufeng bc94370e9c support json output for log backend of advanced audit 2017-07-08 11:25:28 +08:00
Chao Xu 65cedeeb43 update bazel 2017-07-07 19:04:26 -07:00
shiywang 9ac39849b9 add test resource carp and change name 2017-07-08 08:53:35 +08:00
Shiyang Wang da4a875ef8 Move pkg/apimachinery/test to apimachinery 2017-07-08 08:48:38 +08:00
Chao Xu 24d5279c59 move leaderelection package to client-go 2017-07-07 17:01:04 -07:00
Clayton Coleman 12c7874c0d
Prepare to introduce websockets for exec and portforward
Refactor the code in remotecommand to better represent the structure of
what is common between portforward and exec.
2017-07-07 18:22:51 -04:00
Clayton Coleman edc12aafe2
Unify generic proxy code in apimachinery
Make the utility package truly generic, consolidate all generic proxy in
apimachinery.
2017-07-07 16:26:29 -04:00
Clayton Coleman 2e33a2f0bc
Record 429 and timeout errors to prometheus
Allows gathering of load being shed.
2017-07-07 15:50:49 -04:00
deads2k 0801ded425 remove dead code 2017-07-07 09:12:29 -04:00
Paul Michali 78ae9a57df IPv6 support for getting IP from default route
This is part 2 of the effort to update ChoseHostInterface() to support IPv6
addresses (as part of issue 44848). This changeset includes:

- Supports finding IPv6 host addresses from default routes (but currently only
  provided with IPv4 default routes).
- getRoutes() filters for default routes.
- getFinalIP() checks that IP is in requested family. Uses IsGlobalUnicast(),
  instead of explicit tests for loopback, multicast, and link-local IPs.
- getIPFromInterace() checks for family requested.
- chooseHostInterfaceFromRoute()
    * Quickly exits, if no default routes.
    * Since only getting default routes, no check here.
    * Searches all default routes for IPv4 addresses, and then searches all
      default routes for IPv6 addresses (for backwards compatibility).
- More coverage in UTs (87.8% vs 62.6%).
- Better testing of error conditions/results.
- Tests for IPv6 IPs, throughout functions.
- Reduced duplicate testing for items tested at lower levels.

Commit has been rebased on top of PR46044.
2017-07-07 12:52:21 +00:00
Dr. Stefan Schimanski b34464241d client-go: remove TPR example 2017-07-07 14:13:46 +02:00
Kubernetes Submit Queue 4e276d49b9 Merge pull request #46044 from pmichali/issue44848a
Automatic merge from submit-queue (batch tested with PRs 47435, 46044)

IPv6 support for getting node IP

As part of ChooseHostInterface(), it will call a function to try to get the
global IP for the host, by looking at all the system interfaces and select
the first IP that is not a loopback, link-local, or point-to-point IP.

This commit does the following:

- Allows IPv6 non-local IPs to be selected.
- IPv4 takes priority (checks all interfaces for IPv4 addresses and
  then checks all interfaces for IPv6), for backward compatibility.
- Adds UTs for code coverage (was no coverage of underlying function),
  increasing from 62% to 85%.
- Improved logging and reporting for error conditions.
- Minor renaming of functions and variables for readability.



**What this PR does / why we need it**:
This will be part of several PRs to add IPv6 support in apimachinery area for use by Kubernetes. It partially fixes the issue.

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

**Special notes for your reviewer**:
The intent is to break up the PR 45116 into multiple PRs to take on this change a piece at a time.

**Release note**:

```release-noteNONE
```
2017-07-06 12:43:42 -07:00
Kubernetes Submit Queue 756a814042 Merge pull request #43674 from shiywang/fixjsonpath
Automatic merge from submit-queue (batch tested with PRs 48538, 43674)

fix JSONPath parser will not filter strings containing parentheses

Fixes https://github.com/kubernetes/client-go/issues/158
@mtaufen  @daizuozhuo @caesarxuchao
2017-07-06 11:21:28 -07:00
Kubernetes Submit Queue f177389436 Merge pull request #48536 from CaoShuFeng/application/json
Automatic merge from submit-queue

Fix invalid Content-Type for 403 error

https://github.com/kubernetes/kubernetes/pull/47384 makes 403 errors return Status Object. However the Content-Type is still "text/plain"
This change fixes it.

Before this change:
kubectl get pods --as=tom
Error from server (Forbidden): {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"pods \"\" is forbidden: User \"tom\" cannot list pods in the namespace \"default\".","reason":"Forbidden","details":{"kind":"pods"},"code":403} (get pods)

After this change:
$ kubectl get pods --as=tom
Error from server (Forbidden): pods "" is forbidden: User "tom" cannot list pods in the namespace "default".



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

```
NONE
```
2017-07-06 08:52:09 -07:00
Cao Shufeng 36e0a5ed14 Fix invalid Content-Type for 403 error
https://github.com/kubernetes/kubernetes/pull/47384 makes 403 errors
return Status Object. How the Content-Type is still "text/plain"
This change fix it.
2017-07-06 20:22:43 +08:00
Cao Shufeng f21bc7bb9a Fix Audit-ID header key
Now http header key "Audit-ID" doesn't have effect, because golang
automaticly transforms "Audit-ID" into "Audit-Id". This change use
http.Header.Get() function to canonicalize "Audit-ID" to "Audit-Id".
2017-07-06 15:29:00 +08:00
Kubernetes Submit Queue 8b58346517 Merge pull request #48502 from ironcladlou/memcachediscovery
Automatic merge from submit-queue (batch tested with PRs 47700, 48464, 48502)

Add a refreshing discovery client

Introduce a discovery client (implementing `CachedDiscoveryInterface`) which caches discovery information in memory and which can be actively refreshed by the user.

This implementation fetches from discovery upon refresh and could later be improved to maintain updates from a watch.

Extracted from https://github.com/kubernetes/kubernetes/pull/47665 and https://github.com/kubernetes/kubernetes/pull/46000 to help reduce the scope of https://github.com/kubernetes/kubernetes/pull/48065.

```release-note
NONE
```
2017-07-05 13:27:46 -07:00
Kubernetes Submit Queue d630c0b6b1 Merge pull request #48464 from wanghaoran1988/fix_err_type
Automatic merge from submit-queue (batch tested with PRs 47700, 48464, 48502)

fix error type

**What this PR does / why we need it**:
invalidToken should be errInvalideToken
**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**:
No
**Release note**:
```
None
```
2017-07-05 13:27:45 -07:00
Kubernetes Submit Queue 1108738200 Merge pull request #48033 from smarterclayton/generic_printer
Automatic merge from submit-queue (batch tested with PRs 45467, 48091, 48033, 48498)

Refactor and simplify generic printer for unknown objects

The first two commits are part of other PRs

@kubernetes/sig-cli-pr-reviews part of the general refactoring for server side print
2017-07-05 12:37:33 -07:00
Dan Mace 2639b75d84 Refactor cached discovery client 2017-07-05 11:05:46 -04:00
Kubernetes Submit Queue fdee1d5488 Merge pull request #48445 from deads2k/server-28-panichandler
Automatic merge from submit-queue (batch tested with PRs 47162, 48444, 48445)

make the panic handler first

Move the panic handler to the beginning of the chain so that panics will get information in the log beyond a stack.
2017-07-05 06:39:31 -07:00
Kubernetes Submit Queue cfde9e5832 Merge pull request #48444 from p0lyn0mial/add_fisher_resource_to_wardle_group
Automatic merge from submit-queue (batch tested with PRs 47162, 48444, 48445)

Introducing a cluster-scoped resource in the wardle.k8s.io group.

**What this PR does / why we need it**:
This PR adds a cluster-scoped resource to the wardle.k8s.io group.
The cluster scoped resource has a field that indicates Flunder.Names that are disallowed.
The resource is going to be used by an admission plugin.
The admission plugin will list the cluster-scope resources and check against banned names.

**Special notes for your reviewer**:
Issue: #47868

**Release note**:

```
NONE
```
2017-07-05 06:39:29 -07:00
Kubernetes Submit Queue c746680143 Merge pull request #47384 from shiywang/api403
Automatic merge from submit-queue (batch tested with PRs 48383, 47384)

Fix 401/403 apiserver errors do not return 'Status' objects

fixes https://github.com/kubernetes/kubernetes/issues/45970
2017-07-05 02:18:21 -07:00
Kubernetes Submit Queue 0ec36bdc8f Merge pull request #47043 from CaoShuFeng/validate_audit
Automatic merge from submit-queue

Add Validate() function for audit options

**Release note**:

```
NONE
```
Fixes: #47114
2017-07-04 08:48:20 -07:00
p0lyn0mial 113e9ba1d3 Introducing a cluster-scoped resource in the wardle.k8s.io group.
The cluster scoped resource has a field that indicates Flunder.Names that are disallowed.
The resource is going to be used by an admission plugin.
The admission plugin will list the cluster-scope resources and check against banned names.

Issue: #47868
2017-07-04 15:43:45 +02:00
Kubernetes Submit Queue 1033dae18e Merge pull request #46928 from CaoShuFeng/audit_unused_function
Automatic merge from submit-queue

remove unused function and variable from audit backend

auditStringSlice is not used here anymore.
sink variable is also not used.
**Release note**:

```
NONE
```
Fixes: #47114
2017-07-04 04:21:15 -07:00
Haoran Wang 45ec7d9f51 fix error type 2017-07-04 17:21:36 +08:00
Cao Shufeng 00e871a846 remove unused function and variable from audit backend 2017-07-04 16:14:10 +08:00
Shiyang Wang 3d6479f721 Fix 401/403 apiserver errors do not return 'Status' objects 2017-07-04 15:35:51 +08:00
Kubernetes Submit Queue ea6e84365e Merge pull request #47206 from gyliu513/typo
Automatic merge from submit-queue

Follow up for https://github.com/kubernetes/kubernetes/pull/47003

**What this PR does / why we need it**:
This is addressing left comments for https://github.com/kubernetes/kubernetes/pull/47003#discussion_r120888982

/cc @aveshagarwal 

**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-07-04 00:25:22 -07:00
Kubernetes Submit Queue 4ae3b032f4 Merge pull request #48394 from smarterclayton/must_serialize_if_data_differs
Automatic merge from submit-queue (batch tested with PRs 48439, 48440, 48394)

GuaranteedUpdate must write if stored data is not canonical

An optimization added to the GuaranteedUpdate loop changed the
comparison of the current objects serialization against the stored data,
instead comparing to the in memory object, which defeated the mechanism
we use to migrate stored data (GET then PUT should update the version stored in etcd if the canonical serialization has changed)

This commit preserves that optimization but correctly verifies the in
memory serialization against the on disk serialization by fetching the
latest serialized data. Since most updates are not no-ops, this should
not regress the performance of the normal path.

Fixes #48393

```release-note
When performing a GET then PUT, the kube-apiserver must write the canonical representation of the object to etcd if the current value does not match. That allows external agents to migrate content in etcd from one API version to another, across different storage types, or across varying encryption levels. This fixes a bug introduced in 1.5 where we unintentionally stopped writing the newest data.
```
2017-07-03 13:05:30 -07:00
deads2k 9b43bd4a5b make the panic handler first 2017-07-03 14:34:03 -04:00
Kubernetes Submit Queue 74bde7f7ff Merge pull request #48354 from deads2k/gc-01-deletenever
Automatic merge from submit-queue (batch tested with PRs 47784, 47793, 48334, 48435, 48354)

allow a deletestrategy to opt-out of GC

Not all resources should be GC-able and we implemented an ignore list to handle this, but at the storage layer they could still set finalizers, they just hung in a stuck state forever.  This updates the strategy to allow a resource to indicate that they shouldn't be GCed.

@kubernetes/sig-api-machinery-misc
2017-07-03 10:41:56 -07:00
Kubernetes Submit Queue cf9f110387 Merge pull request #48334 from CaoShuFeng/LevelMetadata
Automatic merge from submit-queue (batch tested with PRs 47784, 47793, 48334, 48435, 48354)

update events' ResponseStatus at Metadata level

ResponseStatus is populated in MetadataLevel, so we also update it in
MetadataLevel.

**Release note**:

```
NONE
```
2017-07-03 10:41:51 -07:00
Kubernetes Submit Queue 55261d7955 Merge pull request #47784 from CaoShuFeng/rule_validate
Automatic merge from submit-queue (batch tested with PRs 47784, 47793, 48334, 48435, 48354)

add validate for advanced audit policy

This change checks group name and non-resrouce URLs format for audit
policy.

**Release note**:

```
add validate for advanced audit policy, kube-apiserver will do a stricter validation and will break existing users with invalid configs.
```
2017-07-03 10:41:47 -07:00
deads2k 312fb1e1fa allow a deletestrategy to opt-out of GC 2017-07-03 11:27:45 -04:00
Cao Shufeng b6abcacb38 update events' ResponseStatus at Metadata level
ResponseStatus is populated in MetadataLevel, so we also update it in
MetadataLevel.
2017-07-03 20:43:48 +08:00
Cao Shufeng 7437b88386 add validate for advanced audit policy
This change checks group name and non-resrouce URLs format for audit
policy.
2017-07-03 20:35:35 +08:00
Clayton Coleman b851614adf
GuaranteedUpdate must write if stored data is not canonical
An optimization added to the GuaranteedUpdate loop changed the
comparison of the current objects serialization against the stored data,
instead comparing to the in memory object, which defeated the mechanism
we use to migrate stored data.

This commit preserves that optimization but correctly verifies the in
memory serialization against the on disk serialization by fetching the
latest serialized data. Since most updates are not no-ops, this should
not regress the performance of the normal path.
2017-07-02 23:13:15 -04:00
Nikhita Raghunath 36271f985d
Add Cleanup section to apiextensions client-go 2017-07-02 03:53:35 +05:30
Kubernetes Submit Queue fbba67098b Merge pull request #48317 from CaoShuFeng/impersonation_group
Automatic merge from submit-queue

remove useless check from impersonation filter

When groupsSpecified is false, that means no other groups are added
rather than the service account groups. So this check doesn't make
any sense.

**Release note**:

```
NONE
```
2017-06-30 19:47:38 -07:00
Kubernetes Submit Queue 19724f0b98 Merge pull request #48151 from apelisse/accept-encoding-gzip
Automatic merge from submit-queue (batch tested with PRs 47918, 47964, 48151, 47881, 48299)

GZip openapi schema if accepted by client

**What this PR does / why we need it**: Uses gzip "Accept-Encoding" flag rather than specific path to download gzipped openapi schema.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-06-30 18:42:38 -07:00
Kubernetes Submit Queue 9c74026ffc Merge pull request #46803 from apelisse/new-download-openapi
Automatic merge from submit-queue (batch tested with PRs 43558, 48261, 42376, 46803, 47058)

OpenAPI downloads protobuf rather than Json

**What this PR does / why we need it**: 
The current implementation of the OpenAPI getter fetches the swagger in a Json format from the apiserver. The Json file is big (~1.7mb), which means that it takes a long time to download, and then a long time to parse. Because that is going to be needed on each `kubectl` run later, we want this to be as fast as possible.

The apiserver has been modified to be able to return a protobuf version of the swagger, which this patch intends to use.

Note that there is currently no piece of code that exists that allows us to go from the protobuf version of the file, back into Json and/or `spec.Swagger`. Because the protobuf is not very different (but significantly different enough that it can't be translated), I've updated the code to use `openapi_v2.Document` (the protobuf type) everywhere rather than `spec.Swagger`. The behavior should be identical though.

There are more changes that are coming in follow-up pull-requests: using the gzip version (also provided by the new apiserver) to even further reduce the size of the downloaded content, and use the HTTP Etag cache mechanism to completely get rid of recurrent fetch requests. I'm currently working on these two features.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-06-30 16:28:48 -07:00
Clayton Coleman 3662184786
meta.EachListItem should support runtime.Unstructured
Allows callers to iterate over that construct.
2017-06-30 16:40:26 -04:00
Kubernetes Submit Queue 992002689e Merge pull request #47132 from pichouk/patch-1
Automatic merge from submit-queue

Fix a typo in deletion log of apiserver

**What this PR does / why we need it**:
I just fix a typo in a log message. Nothing more 😄 

**Which issue this PR fixes**
apiserver sometimes log this message "About do delete object from database". It seems that there is a typo for `to`.

```release-note
Fix a typo in apiserver log message
```
2017-06-30 05:30:17 -07:00
Cao Shufeng 0a1e24f31e remove useless check from impersonation filter
When groupsSpecified is false, that means no other groups are added
rather than the service account groups. So this check doesn't make
any sense.
2017-06-30 10:51:07 +08:00
Mikhail Mazurskiy dc1ee493a2
Refactor unstructured converter 2017-06-30 09:35:14 +10:00
Aaron Crickenberger 8469b01333 TestLoopbackHostPort should accept IPv6 loopback host 2017-06-29 11:49:28 -07:00
Dan Mace 547d820588 Fix Unstructured field accessor
Fix the Unstructured GetDeletionGracePeriodSeconds accessor which was
always returning nil regardless of the underlying stored value. The
field value always appearing nil prevents Custom Resource instances
from being deleted when garbage collection is enabled for CRs and
when DeletePropagationOrphan is used. More generally, this fix means that
delete-on-update now works for CR instances.

Add some test coverage for Unstructured metadata deserialization.

The Unstructured DeletionGracePeriodSeconds field marshals as a value
type from JSON and as a pointer type via SetDeletionGracePeriodSeconds.
The GetDeletionGracePeriodSeconds method now supports handling both
int64 and *int64 values so that either underlying value can be returned.

Add a reflection-based unit test which attempts to exercise all the
Object Get/Set methods for nil handling.
2017-06-28 13:44:29 -04:00
Guangya Liu 159fa86d98 Follow up for https://github.com/kubernetes/kubernetes/pull/47003 2017-06-28 10:41:09 +08:00
xiangpengzhao fcf2df9ad7 Validate --storage-backend type. 2017-06-28 09:47:49 +08:00
Kubernetes Submit Queue 82eff38a63 Merge pull request #45610 from bsalamat/priority_api
Automatic merge from submit-queue (batch tested with PRs 45610, 47628)

Add Priority to Kubernetes API

**What this PR does / why we need it**: This is the first in a series of PRs to add priority to Kubernetes API. Subsequent PRs will add priority name resolution to admission controller.


**Release note**:

```release-note
Add PriorityClassName and Priority fields to PodSpec.
```
2017-06-27 17:46:08 -07:00
Antoine Pelisse f617df7d6a Add NYTimes/gziphandler dependency 2017-06-27 15:55:01 -07:00
Antoine Pelisse bd38dd4d12 openapi: Read Accept-Content to send gzip if needed 2017-06-27 15:55:00 -07:00
Kubernetes Submit Queue fd884b7eb6 Merge pull request #48106 from timstclair/audit-metrics
Automatic merge from submit-queue (batch tested with PRs 48106, 46761)

s/count/total/ in audit prometheus metrics

Responding to https://github.com/kubernetes/kubernetes/pull/46732#discussion_r124057806, making the metric names conform with the [metric naming convention](https://prometheus.io/docs/practices/naming/#metric-names).

kubernetes/features#22

/cc @ericchiang @ihmccreery
2017-06-27 15:01:57 -07:00
Kubernetes Submit Queue 9120d58fc9 Merge pull request #47352 from p0lyn0mial/wire_admission_to_sample_apiserver
Automatic merge from submit-queue

shows how to wire admission control in a sample api server.

**What this PR does / why we need it**:
This PR shows how to wire admission control in a custom api server

**Release note**:

```release-note
NONE
```
2017-06-27 10:06:06 -07:00
Kubernetes Submit Queue 353633b877 Merge pull request #47904 from deads2k/log-01-supress
Automatic merge from submit-queue (batch tested with PRs 47484, 47904, 48034)

prioritize messages for long steps

This pull prioritizes the trace messages, so steps that are unusually large come out at the info level and all details come out a v(4) level.
2017-06-26 22:21:58 -07:00
Kubernetes Submit Queue d31bcad496 Merge pull request #47702 from smarterclayton/avoid_mutable
Automatic merge from submit-queue (batch tested with PRs 48012, 47443, 47702, 47178)

Don't bother with a mutable transformer for identity

The default value transformer can safely be the identity transformer - mutability is not required if the caller doesn't need transformation.
2017-06-26 17:48:03 -07:00
Kubernetes Submit Queue aac42add77 Merge pull request #47443 from p0lyn0mial/use_incluster_cfg_when_creating_ext_informers
Automatic merge from submit-queue (batch tested with PRs 48012, 47443, 47702, 47178)

incluster config will be used when creating external shared informers.

**What this PR does / why we need it**:
Previously the loopback configuration was used to talk to the server.
As a consequence a custom API server was unable to talk to the root API server.
This PR changes the above by using incluster configuration to create shared informers.

**Release note**:

```release-note
NONE
```
2017-06-26 17:48:01 -07:00
Kubernetes Submit Queue eadd20ef48 Merge pull request #47748 from nikhita/client-go-examples-readme
Automatic merge from submit-queue

Update custom-resources example in client-go

- Update client-go examples `README.md` to point to the CustomResources example instead of the deprecated TPR one.
- Delete `staging/src/k8s.io/client-go/examples/custom-resources`. 

Fixing #47743.

**Release note**:

```release-note
NONE
```

/cc @ahmetb @sttts
2017-06-26 16:30:55 -07:00
Nikhita Raghunath bfa9ce4308
Update CR example in client-go
Remove custom-resources directory from client-go

Add TPR example back

Mention CRD is successor to TPR
2017-06-27 03:39:29 +05:30
Bobby (Babak) Salamat 403b30f6e9 Autogenerated files 2017-06-26 15:02:49 -07:00
Tim St. Clair b34d6ab890
s/count/total/ in audit prometheus metrics 2017-06-26 14:41:20 -07:00
Bobby Salamat 91f893eebe Add priority to Kubernetes API 2017-06-26 13:43:19 -07:00
Kubernetes Submit Queue 6b973991a8 Merge pull request #48036 from hongchaodeng/master
Automatic merge from submit-queue (batch tested with PRs 48036, 48022)

apiextensions-apiserver: fix build

Can't build CRD due to this bug. This PR will fix it.
2017-06-26 12:52:39 -07:00
Eric Paris f4767c270d prioritize messages for long steps 2017-06-26 13:17:00 -04:00
Paul Michali a2a99c786a IPv6 support for getting node IP
As part of ChooseHostInterface(), it will call a function to try to get the
global IP for the host, by looking at all the system interfaces and select
the first IP that is not a loopback, link-local, or point-to-point IP.

This commit does the following:

- Allows IPv6 non-local IPs to be selected.
- IPv4 takes priority (checks all interfaces for IPv4 addresses and
  then checks all interfaces for IPv6), for backward compatibility.
- Adds UTs for code coverage (was no coverage of underlying function),
  increasing from 62% to 84%.
- Improved logging and reporting for error conditions.
- Minor renaming of functions and variables for readability.
2017-06-26 13:13:17 +00:00
Kubernetes Submit Queue df7f4b3526 Merge pull request #47975 from deads2k/api-14-proto
Automatic merge from submit-queue (batch tested with PRs 46425, 47975)

make proto time precision match json

json readers/writers see second precision, but protobuf readers/writers seen nanosecond precision.  This means that a json client can read and write and accidentally mutate fields as seen by protobuf clients.

This makes the precision consistent.

@kubernetes/sig-api-machinery-misc @smarterclayton 

```release-note
Update protobuf time serialization for a one second granularity
```
2017-06-26 05:49:40 -07:00
Hongchao Deng 9ee991837c apiextensions-apiserver: fix build 2017-06-25 19:33:17 -07:00
Kubernetes Submit Queue 06453433c0 Merge pull request #48017 from liggitt/encode-nested
Automatic merge from submit-queue

Plumb preferred version to nested object encoder

Fixes https://github.com/kubernetes/kubernetes/issues/48018
2017-06-24 10:24:32 -07:00
Kubernetes Submit Queue beb5b9dd4d Merge pull request #47869 from timothysc/affinity_cleanup
Automatic merge from submit-queue

Removes alpha feature gate for affinity annotations.  

**What this PR does / why we need it**:
In 1.5 we added a backstop to support alpha affinity annotations.  This PR removes that support in favor of the Beta fields per discussions.  

It also serves as a precursor to some of the component config work that @ncdc has done around @mikedanese design proposal.  

xref: https://github.com/kubernetes/kubernetes/pull/41617 

**Special notes for your reviewer**:

**Release note**:

```
Removes alpha feature gate for pod affinity annotations.  
```

/cc @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-cluster-lifecycle-misc
2017-06-24 06:11:42 -07:00
Kubernetes Submit Queue b042c76d10 Merge pull request #47936 from caesarxuchao/test-api-dependency
Automatic merge from submit-queue (batch tested with PRs 47650, 47936, 47939, 47986, 48006)

External dependency of k8s.io/api

Fix https://github.com/kubernetes/kubernetes/issues/48007

It's unfortunate that k8s.io/api has external dependencies.

Most of the dependencies are introduced by "k8s.io/apimachinery/pkg/util/intstr" and ugorji.
2017-06-24 05:15:40 -07:00
Kubernetes Submit Queue 714f97d7ba Merge pull request #47740 from liggitt/websocket-protocol
Automatic merge from submit-queue

Add token authentication method for websocket browser clients

Closes #47967

Browser clients do not have the ability to set an `Authorization` header programatically on websocket requests. All they have control over is the URL and the websocket subprotocols sent (see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket)

This PR adds support for specifying a bearer token via a websocket subprotocol, with the format `base64url.bearer.authorization.k8s.io.<encoded-token>`

1. The client must specify at least one other subprotocol, since the server must echo a selected subprotocol back
2. `<encoded-token>` is `base64url-without-padding(token)`

This enables web consoles to use websocket-based APIs (like watch, exec, logs, etc) using bearer token authentication.

For example, to authenticate with the bearer token `mytoken`, the client could do:
```js
var ws = new WebSocket(
  "wss://<server>/api/v1/namespaces/myns/pods/mypod/logs?follow=true",
  [
    "base64url.bearer.authorization.k8s.io.bXl0b2tlbg",
    "base64.binary.k8s.io"
  ]
);
```

This results in the following headers:
```
Sec-WebSocket-Protocol: base64url.bearer.authorization.k8s.io.bXl0b2tlbg, base64.binary.k8s.io
```

Which this authenticator would recognize as the token `mytoken`, and if authentication succeeded, hand off to the rest of the API server with the headers
```
Sec-WebSocket-Protocol: base64.binary.k8s.io
```

Base64-encoding the token is required, since bearer tokens can contain characters a websocket protocol may not (`/` and `=`)

```release-note
Websocket requests may now authenticate to the API server by passing a bearer token in a websocket subprotocol of the form `base64url.bearer.authorization.k8s.io.<base64url-encoded-bearer-token>`
```
2017-06-24 00:34:41 -07:00
Kubernetes Submit Queue aee3c5ae87 Merge pull request #47973 from sjenning/include-obj-fieldpath-event-key
Automatic merge from submit-queue

include object fieldpath in event key

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

#47462 exposed a bug where `getEventKey()` only keys on event fields that are common at the pod level. Events generated by different containers in the same pod will yield identical event keys.  This results in events with the same message from different containers in a pod being aggregated in error.

This wasn't a problem before as the event message contained container specific information and thus didn't produce the same event key.

@derekwaynecarr @dhilipkumars @dchen1107
2017-06-23 19:51:53 -07:00
Jordan Liggitt 49b51c2de8
Plumb preferred version to nested object encoder 2017-06-23 22:09:03 -04:00
Kubernetes Submit Queue ed3c50a755 Merge pull request #47845 from liggitt/remove-redirect
Automatic merge from submit-queue (batch tested with PRs 47993, 47892, 47591, 47469, 47845)

Remove redirect verb parsing

The redirect verb was removed pre-1.0 in https://github.com/kubernetes/kubernetes/pull/9826 so the request parsing logic is dead code

Diff best viewed without whitespace:
https://github.com/kubernetes/kubernetes/pull/47845/files?w=1
2017-06-23 18:05:52 -07:00
Kubernetes Submit Queue 1a93dd60bb Merge pull request #47945 from sakeven/fix/add_level_for_print_flags
Automatic merge from submit-queue (batch tested with PRs 47883, 47179, 46966, 47982, 47945)

add level for print flags

Signed-off-by: sakeven <jc5930@sina.cn>



**What this PR does / why we need it**:
It's ugly to print all flags whenever.

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

fixes #47932

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-06-23 15:48:46 -07:00
Kubernetes Submit Queue 80af10c0e6 Merge pull request #46966 from ilackarms/compression-gating
Automatic merge from submit-queue (batch tested with PRs 47883, 47179, 46966, 47982, 47945)

Add feature gating to REST Compression

**What this PR does / why we need it**: Adds feature gating to opt out of REST API compression

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

**Special notes for your reviewer**: This PR is a fix / addendum to #45666

**Release note**:

```release-note
```
2017-06-23 15:48:40 -07:00
Antoine Pelisse 224dba9a13 openapi: Fetch protobuf rather than Json
This is much faster.
2017-06-23 13:50:50 -07:00
Seth Jennings fbcb0562ea include object fieldpath in event key 2017-06-23 13:26:02 -05:00
deads2k 5b8a483a96 make proto time precision match json 2017-06-23 13:53:19 -04:00
Scott Weiss c305f72315 add compression to GET and LIST api requests
this feature is gated; disabled by default
2017-06-23 11:24:36 -04:00
Timothy St. Clair 4aea626944 Removes alpha feature gate for affinity annotations. Beta fields should be used. 2017-06-23 10:02:14 -05:00
Kubernetes Submit Queue 10a6b227b1 Merge pull request #47778 from NickrenREN/etcd-compact-loglevel
Automatic merge from submit-queue

Lower etcd compacted loglevel

Fixes #47941

When we run apiserver, it will consistently produce logs like:

> I0620 15:27:44.627978    2765 compact.go:159] etcd: compacted rev (7825), endpoints ([http://127.0.0.1:2379])
I0620 15:32:44.632311    2765 compact.go:159] etcd: compacted rev (8193), endpoints ([http://127.0.0.1:2379])
I0620 15:37:44.643658    2765 compact.go:159] etcd: compacted rev (8552), endpoints ([http://127.0.0.1:2379])
...

which does not mean much overall, we may change the loglevel and lower the frequency.

**Release note**:
-->
```release-note
NONE
```
2017-06-23 06:04:53 -07:00
Kubernetes Submit Queue f5a5c50812 Merge pull request #47602 from rootfs/gophercloud-383
Automatic merge from submit-queue (batch tested with PRs 46151, 47602, 47507, 46203, 47471)

rebase gophercloud to support HTTP status 300 in pagination, so listingng Cinder v1/v2 API versions won't break

**What this PR does / why we need it**:
Since Cinder block v1/v2 support lands in 1.7, we have to ensure Cinder block api list won't fail due to https://github.com/gophercloud/gophercloud/pull/384.


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

**Special notes for your reviewer**:

@anguslees @NickrenREN 

**Release note**:

```release-note
NONE
```
2017-06-23 05:08:21 -07:00
sakeven 8b1a08a919 add level for print flags
Signed-off-by: sakeven <jc5930@sina.cn>
2017-06-23 11:59:36 +08:00
Chao Xu 1b7201ab91 generated Godeps.json 2017-06-22 16:58:53 -07:00
Kubernetes Submit Queue e123311d8a Merge pull request #47684 from nikhita/fix-cr-example
Automatic merge from submit-queue

Fix link to apiextensions client-go example

Fixes link to client-go example for apiextensions-apiserver.

Fixing #47211.

**Special notes for your reviewer**:

When I run `hack/update-staging-client-go.sh`, I get this error:

```
!!! Error in staging/copy.sh:132
    Error in staging/copy.sh:132. 'git commit -q -m "Snapshot" > /dev/null' exited with status 1
  Call stack:
    1: staging/copy.sh:132 main(...)
  Exiting with status 1
```

What am I missing here?
/cc @caesarxuchao @sttts 

**Release note**:

```
NONE
```
2017-06-22 16:44:03 -07:00
p0lyn0mial 074544b3b0 incluster config will be used when creating external shared informers.
previously the loopback configuration was used to talk to the server.
As a consequence a custom API server was unable to talk to the root API server.
2017-06-22 21:48:50 +02:00
Chao Xu c2d576886b run update-staging-godeps.sh; the script asks user to manually commit changes for each repo 2017-06-22 11:31:04 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu 4379bbdafb manually fix openapi-gen 2017-06-22 11:31:03 -07:00
Chao Xu 239613b521 manually fix kubectl openapi unit test 2017-06-22 11:31:02 -07:00
Chao Xu 847b048fa0 make all works. generated harmless covnersion/deepcoy chagnes 2017-06-22 11:30:59 -07:00
Chao Xu ffe74d1fe7 run hack/update-staging-client-go, somehow we copied listers/<authn,authz,imagepolicy> 2017-06-22 11:30:59 -07:00
Chao Xu f2d3220a11 run root-rewrite-import-client-go-api-types 2017-06-22 11:30:59 -07:00
Chao Xu e185f7e277 run hack/update-codegen.sh 2017-06-22 11:30:58 -07:00
Chao Xu 6abfeb9d40 some copy.sh changes 2017-06-22 11:30:58 -07:00
Chao Xu edd30fddcd run fix-casttype.sh 2017-06-22 11:30:52 -07:00
Chao Xu 4fb28dafad pkg/apis/move-external-types-for-apis.sh, k8s.io/api compiles 2017-06-22 11:30:51 -07:00
Chao Xu 94e8bb6261 unify register.go formats:
networking/v1/register.go
staging/src/k8s.io/kube-apiextensions-server/pkg/apis/apiextensions/v1alpha1/register.go
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1alpha1/register.go
staging/src/k8s.io/metrics/pkg/apis/metrics/v1alpha1 register.go
2017-06-22 11:30:51 -07:00
Chao Xu 58edb6b485 split v1/register.go to regsiter.go and builder.go
move api/v1 to k8s.io/api/v1
duplicate some global variables/functions in pkg/api/v1/builder.go, add todo to remove these
2017-06-22 10:21:42 -07:00
Kubernetes Submit Queue 4d1379c473 Merge pull request #47512 from rickypai/rpai/fix_hostalias_json_key
Automatic merge from submit-queue (batch tested with PRs 42252, 42251, 42249, 47512, 47887)

fix HostAliases' json keys to be hostAlias instead of hostMapping to reflect actual feature name

**What this PR does / why we need it**: a rename was introduce during the middle of #44641 to change from `hostMappings` to `hostAliases`. the Go structs were updated, but I neglected to update the json keys. They should be in sync.

**Special notes for your reviewer**:  I messed up. This is an API change. I hope this is still ok to be in the 1.7 release.

**Release note**:
```release-note
HostAliases is now parsed with `hostAliases` json keys to be in line with the feature's name.
```
2017-06-21 22:13:33 -07:00
Kubernetes Submit Queue 96716d3eb4 Merge pull request #47857 from deads2k/agg-35-routing
Automatic merge from submit-queue (batch tested with PRs 47878, 47503, 47857)

restore working aggregator and avoid duplicate informers

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

This runs the informer all the way through and makes sure its started.

@lavalamp ptal
@kubernetes/sig-api-machinery-bugs
2017-06-21 21:12:18 -07:00
Ricky Pai 797dc10a0c generated code 2017-06-21 16:39:50 -07:00
Kubernetes Submit Queue 03014f486c Merge pull request #47824 from mbohlool/revert2
Automatic merge from submit-queue (batch tested with PRs 47851, 47824, 47858, 46099)

Revert 44714 manually

#44714 broke backward compatibility for old swagger spec that kubectl still uses. The decision on #47448 was to revert this change but the change was not automatically revertible. Here I semi-manually remove all references to UnixUserID and UnixGroupID and updated generated files accordingly.

Please wait for tests to pass then review that as there may still be tests that are failing.

Fixes #47448

Adding release note just because the original PR has a release note. If possible, we should remove both release notes as they cancel each other.

**Release note**: (removed by caesarxuchao)

UnixUserID and UnixGroupID is reverted back as int64 to keep backward compatibility.
2017-06-21 15:21:14 -07:00
Kubernetes Submit Queue 5d30190b3b Merge pull request #47851 from jhorwit2/jah/revert-psp-hostpath-whitelist
Automatic merge from submit-queue (batch tested with PRs 47851, 47824, 47858, 46099)

Revert "Merge pull request #43946 from jhorwit2/jah/host-path-psp"

fixes #47863

This reverts commit b5eadb5d6b, reversing
changes made to 1889d654f5.



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

Revert whitelist host paths in psp due to API concerns. Please refer to https://github.com/kubernetes/kubernetes/pull/47811 for the concerns.

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

cc @liggitt @ericchiang @smarterclayton 

**Release note**:

```release-note
```
2017-06-21 15:21:11 -07:00
Kubernetes Submit Queue ee89c30eb3 Merge pull request #47792 from liggitt/decode-raw
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

Fix rawextension decoding in update

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

The `Create` handler was correctly decoding into the internal version, but the `Update` handler was not.

Top-level objects were not affected, because the type of the `New()` object returned by the rest handler governs the destination group/version/kind.

If a field within the object is of type `RawExtension`, and converts to a `runtime.Object` field in the internal object, the `runtime.Object` field provides no information about the desired group/version/kind, so the decoder's groupversioner governs.

This would manifest as the resthandler's Update function being given an internal top-level object with it's runtime.Object field containing an external object.
2017-06-21 13:30:21 -07:00
Kubernetes Submit Queue d3ee9df2c2 Merge pull request #46694 from matt-tyler/bug-gcpauthdefaultcred
Automatic merge from submit-queue (batch tested with PRs 34515, 47236, 46694, 47819, 47792)

Clear auth config when gcp app default credentials fail

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

Specific use case is when utilizing multiple gcp accounts, the user may provide credentials for the wrong account.

This change ensures the incorrect credentials are not cached in auth config, and logs an appropriate message.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Tokens retrieved from Google Cloud with application default credentials will not be cached if the client fails authorization
```
2017-06-21 13:30:13 -07:00
deads2k f525c0815e restore working aggregator and avoid duplicate informers 2017-06-21 15:14:59 -04:00
Josh Horwitz b6e08ec39d Revert "Merge pull request #43946 from jhorwit2/jah/host-path-psp"
This reverts commit b5eadb5d6b, reversing
changes made to 1889d654f5.
2017-06-21 12:45:22 -04:00
Jordan Liggitt e8b24679dc
Remove redirect verb parsing 2017-06-21 11:17:24 -04:00
Jordan Liggitt 6a872c09eb
Use websocket protocol authenticator in apiserver 2017-06-21 09:47:34 -04:00
Jordan Liggitt e2a03bcf2a
Add websocket protocol authentication method 2017-06-21 09:47:34 -04:00
mbohlool 70c4fe7f4f update generated files 2017-06-21 04:09:08 -07:00
mbohlool c91a12d205 Remove all references to types.UnixUserID and types.UnixGroupID 2017-06-21 04:09:07 -07:00
Jordan Liggitt a536ee3615
Fix rawextension decoding in update 2017-06-20 11:05:31 -04:00
Kubernetes Submit Queue 35016b153e Merge pull request #46604 from slintes/goClientNotFoundStatusErrorExample
Automatic merge from submit-queue (batch tested with PRs 46604, 47634)

Added example for status errors in go client

This PR adds status error handling examples to the go client examples, for both in-cluster and out-of-cluster usage. Fixes https://github.com/kubernetes/client-go/issues/163
2017-06-20 03:15:54 -07:00
NickrenREN 151b6a04e1 Lower etcd compacted loglevel 2017-06-20 15:46:13 +08:00
Kubernetes Submit Queue 6bab8dc493 Merge pull request #46812 from lavalamp/whitlockjc-plumbing
Automatic merge from submit-queue (batch tested with PRs 47726, 47693, 46909, 46812)

Plumb service resolver into webhook AC

This is the last piece of plumbing needed for https://github.com/kubernetes/features/issues/209
2017-06-19 18:34:06 -07:00
Kubernetes Submit Queue 6b52d8f138 Merge pull request #47701 from smarterclayton/stable_serialization
Automatic merge from submit-queue (batch tested with PRs 47669, 40284, 47356, 47458, 47701)

Serialized protobuf should have stable map order

Leverage `stable_marshaller_all` tag in gogo-protobuf to ensure all of our maps have stable ordering when serialized to protobuf. This preserves the behavior from JSON that we rely on to avoid writing to etcd except when the content has changed.

Will slightly increase allocations (1 slice per non-empty map in an object) during Encode, which has a minor impact on CPU. However, avoiding writes when a client issues a blind put results in significantly less CPU across the whole cluster (avoiding a new etcd version for an Endpoints object might save ~1 core/sec on large clusters).

Fixes #47678 

```release-note
The protobuf serialization of API objects has been updated to store maps in a predictable order to ensure that the representation of that object does not change when saved into etcd. This prevents the same object from being seen as being modified, even when no values have changed.
```
2017-06-19 15:25:06 -07:00
Nikhita Raghunath 731a1ccb44
Fix typo in cross-repo link 2017-06-20 00:20:30 +05:30
Kubernetes Submit Queue 2d023ab085 Merge pull request #46855 from wojtek-t/log_broken_watches
Automatic merge from submit-queue

Add logging to debug conflicts in kubemark-scale test

Ref #46851
2017-06-19 07:26:24 -07:00
Matt Tyler b92016769e Clear auth config when gcp credentials fail
Specific use case is when utilizing multiple
gcp accounts, the user may provide credentials
for the wrong account.

This change ensures the incorrect credentials
are not cached in auth config, and logs an
appropriate message.
2017-06-18 14:50:47 +08:00
Clayton Coleman c1ff7592fa
Add test for stable encoding 2017-06-17 14:32:51 -04:00
Clayton Coleman 606825eea4
generated: protobuf with stable map ordering 2017-06-17 14:32:51 -04:00
Clayton Coleman dac0d07546
Don't bother with a mutable transformer for identity 2017-06-17 09:19:13 -04:00
Marc Sluiter 92ac232790 run update-bazel.sh 2017-06-17 13:24:09 +02:00
Marc Sluiter a71bb87ec7 Added namespace and better pod name in client go example 2017-06-17 13:24:08 +02:00
Marc Sluiter 601ab10dbd Updated error handling example based on PR feedback 2017-06-17 13:24:08 +02:00
Marc Sluiter 8ca1732023 Added example for status errors in go client 2017-06-17 13:24:07 +02:00
Daniel Smith 6ff1a9829d generated files 2017-06-16 16:45:14 -07:00
Daniel Smith cadaaa349a Plumb service resolver to webhook AC 2017-06-16 16:45:14 -07:00
Kubernetes Submit Queue 532cb25d21 Merge pull request #47223 from sttts/sttts-fix-cr-example-link
Automatic merge from submit-queue

Fix cross-repo link

Fixing https://github.com/kubernetes/kubernetes/issues/47211
2017-06-16 16:13:22 -07:00
Kubernetes Submit Queue d7b631a52d Merge pull request #46883 from ahmetb/clientgo-toc
Automatic merge from submit-queue

clientgo/examples: add ToC for examples

Also add authenticate- prefix to auth samples. This patch could use some
improvement explaining workqueue and TPR examples as I'm not entirely sure.

/assign @caesarxuchao

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-06-16 14:14:26 -07:00
Kubernetes Submit Queue ad4d965711 Merge pull request #46961 from zjj2wry/api_describe
Automatic merge from submit-queue

Fix api description

**What this PR does / why we need it**:
prefered ->  preferred
the the ->  the

**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-06-16 12:19:08 -07:00
Kubernetes Submit Queue 464831e240 Merge pull request #47557 from janetkuo/hash-label-rename
Automatic merge from submit-queue (batch tested with PRs 46884, 47557)

Rename DaemonSet and StatefulSet hash label

**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 #47554

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/assign @kow3ns 
/cc @bgrant0607 
@kubernetes/sig-apps-api-reviews
2017-06-16 11:34:01 -07:00
Janet Kuo 25a67fc5cd Rename DaemonSet and StatefulSet hash label
Make them share the same hash label "controller-revision-hash", for
consistency
2017-06-15 18:04:27 -07:00
Huamin Chen ca65a6d151 rebase gophercloud to support HTTP status 300 in pagination, so listing Cinder v1/v2 API versions won't break
Signed-off-by: Huamin Chen <hchen@redhat.com>
2017-06-15 20:23:26 +00:00
Matt Liggett f6bcac3fec Add version and flag info to apiserver and CM logs.
Should help debugging.
Specifically for #45706
2017-06-15 11:38:11 -07:00
Kubernetes Submit Queue 08c705e875 Merge pull request #46800 from deads2k/agg-33-priority
Automatic merge from submit-queue (batch tested with PRs 47492, 47542, 46800, 47545, 45764)

separate group and version priority

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


This just modifies the API and does the minimal plumbing.  I can extend this pull or do another to fix the priority problem.
2017-06-14 21:43:44 -07:00
Kubernetes Submit Queue 791380664e Merge pull request #47537 from sakshamsharma/fix/typo_secretbox_prefix
Automatic merge from submit-queue (batch tested with PRs 47510, 47516, 47482, 47521, 47537)

Fix typo in secretbox transformer prefix

Introduced by #46916 via cherry picked commit [here](12bb591dbf).

Urgent fix in my opinion, ideally should be merged before production.

@smarterclayton
2017-06-14 20:32:51 -07:00
Kubernetes Submit Queue d2eb68c4a5 Merge pull request #47432 from deads2k/crd-13-gc-off
Automatic merge from submit-queue (batch tested with PRs 47204, 46808, 47432, 47400, 47099)

disable GC for custom resources

xref https://github.com/kubernetes/kubernetes/issues/47431

This prevents GC on CustomResources so you don't get an uncleared finalizer that prevents deletion
2017-06-14 17:13:58 -07:00
Saksham Sharma 2c820c2050 Fix typo in secretbox transformer prefix 2017-06-14 11:45:57 -07:00
deads2k 963c85e1c8 sort current API versions and fallback for others 2017-06-14 09:29:44 -04:00
deads2k d13ad28420 add group priority to apiservice 2017-06-14 09:29:44 -04:00
Kubernetes Submit Queue be0a5f75d5 Merge pull request #47457 from timstclair/audit-objref
Automatic merge from submit-queue (batch tested with PRs 47073, 47457, 47479)

audit: Fill in full ObjectRef, include in LevelMetadata

The previous implementation was missing several ObjectReference fields, including `APIVersion`, `Resource`, and `Subresource`. This PR adds those fields, and also fills in the `ObjectRef` when the level is `Metadata` (previously it was only filled for level `Request`).

For kubernetes/features#22

/cc @ericchiang @ihmccreery
2017-06-14 01:52:14 -07:00
Tim St. Clair 28beb4572e
audit: Fill in full ObjectRef, include in LevelMetadata 2017-06-14 00:46:04 -07:00
Kubernetes Submit Queue 4319f0fe5e Merge pull request #47302 from CaoShuFeng/leak_socket_file
Automatic merge from submit-queue (batch tested with PRs 47302, 47389, 47402, 47468, 47459)

remove leaked socket file in unit test

Fixes #47301


**Release note**:

```
NONE
```
2017-06-13 23:37:41 -07:00
Ahmet Alp Balkan 62d1251874
clientgo/examples: add ToC for examples
Also add authenticate- prefix to auth samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
2017-06-13 15:48:40 -07:00
Kubernetes Submit Queue 7560142e27 Merge pull request #47276 from kow3ns/rm-partition-strategy
Automatic merge from submit-queue (batch tested with PRs 46441, 43987, 46921, 46823, 47276)

Remove PartitionStatefulSetStrategyType

This PR removes PartitionStatefulSetStrategyType add adds a parameter to RollingUpdateStatefulSetStrategyType as described in the issue below. We need this PR to ensure that the StatefulSet API conforms to the existing API for DaemonSet.

fixes #46975
```release-note
NONE
```
@kargakis 
@smarterclayton 
@janetkuo
2017-06-13 13:55:53 -07:00
Kubernetes Submit Queue 72a046d858 Merge pull request #43987 from cosmincojocar/azure_plugin_for_client_auth
Automatic merge from submit-queue (batch tested with PRs 46441, 43987, 46921, 46823, 47276)

Azure plugin for client auth

This is an Azure Active Directory plugin for client authentification. It provides an integration with Azure CLI 2.0 login command. It can also be used standalone, in that case it will use the device code flow to acquire an access token. 

More details are provided in the README.md file. 

https://github.com/kubernetes/kubectl/issues/29

cc @brendandburns @colemickens
2017-06-13 13:55:45 -07:00
Kubernetes Submit Queue e58bc88c55 Merge pull request #46929 from CaoShuFeng/extra_newline
Automatic merge from submit-queue (batch tested with PRs 46929, 47391, 47399, 47428, 47274)

Remove empty lines from log

Everything() returns a new line end with "\n", it's not necessary
to add another one.
**Release note**:

```
NONE
```
2017-06-13 10:52:06 -07:00
deads2k 1da8f67560 disable GC for custom resources 2017-06-13 10:40:58 -04:00
Kubernetes Submit Queue 456293ba0c Merge pull request #45545 from ocadotechnology/44461-gophercloud-bump
Automatic merge from submit-queue (batch tested with PRs 46678, 45545, 47375)

update gophercloud/gophercloud dependency

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

**Which issue this PR fixes** 
fixes #44461

**Special notes for your reviewer**:

**Release note**:

```release-note
update gophercloud/gophercloud dependency for reauthentication fixes
```
2017-06-12 20:32:39 -07:00
Kenneth Owens 37a54d521a Generated code 2017-06-12 10:08:46 -07:00
p0lyn0mial 1feca6e28b shows how to wire admission control in a sample api server. 2017-06-12 18:32:32 +02:00
Dr. Stefan Schimanski 2aa87e4fee Fix cross-repo link 2017-06-12 09:40:16 +02:00
Kubernetes Submit Queue a648e10910 Merge pull request #47246 from gyliu513/container-image
Automatic merge from submit-queue

Made image as required in v1 Container struct.

**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 #47244 

**Special notes for your reviewer**:

**Release note**:

```release-note
none
```
2017-06-11 16:17:36 -07:00
Kubernetes Submit Queue df1e289888 Merge pull request #47004 from ixdy/bazel-stamp-multiple-packages
Automatic merge from submit-queue

bazel: stamp multiple packages by using x_defs instead of linkstamp in go_binary rules

**What this PR does / why we need it**: Fixes regression introduced sometime in the last few months that prevented bazel-built clusters from identifying version properly. 

It does so by updating the bazelbuild/rules_go and kubernetes/repo-infra dependencies to support using stamp values in `go_binary` `x_defs`, and then changing our `go_binary` rules to use `x_defs` instead of `linkstamp`.

This whole charade is necessary because we need to stamp version information in multiple packages.

This pretty much only affects the bazel build, so it should be low risk.

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

**Special notes for your reviewer**: depends on https://github.com/kubernetes/repo-infra/pull/18; should not be merged before it.

**Release note**:

```release-note
NONE
```

/assign @spxtr @mikedanese
2017-06-11 00:33:13 -07:00
Cao Shufeng 2c19b9e143 remove leaked socket file in unit test 2017-06-11 14:07:32 +08:00
Cao Shufeng 3816b6fde5 Remove extra empty lines from log
remove extra "\n" from Everything()
2017-06-11 10:32:39 +08:00
Guangya Liu 4250c5d3f4 Update client-go. 2017-06-10 02:56:19 -04:00
Kubernetes Submit Queue 9df40c3661 Merge pull request #42156 from croomes/storageos
Automatic merge from submit-queue

StorageOS Volume Plugin

**What this PR does / why we need it**:
This PR adds a new volume plugin for StorageOS volumes.  StorageOS runs as a container on Kubelet nodes, aggregating local or attached storage and making its capacity available to all nodes within the cluster. More information at http://storageos.com.

The StorageOS plugin supports:

1. Dynamic Provisioning using Storage Classes
2. Persistent Volumes and Persistent Volume Claims.

**Which issue this PR fixes**
A feature request has been created:
https://github.com/kubernetes/features/issues/190

This isn't on the schedule for 1.6 as I wasn't sure when it would be ready.  We intend to make the StorageOS container openly available within the 1.6 lifetime.

**Special notes for your reviewer**:

Separate commits for feature and godep changes.

**Release note**:
```release-note
StorageOS Volume Driver
[StorageOS](http://www.storageos.com) can be used as a storage provider for Kubernetes.  With StorageOS, capacity from local or attached storage is pooled across the cluster, providing converged infrastructure for cloud-native applications. 
```
2017-06-09 18:25:04 -07:00
Kubernetes Submit Queue 25aed0a631 Merge pull request #47251 from sttts/sttts-dynamic-client-getoptions
Automatic merge from submit-queue (batch tested with PRs 36376, 47251)

client-go: GetOptions for dynamic client

Looks like `GetOptions` were forgotten in the dynamic client. Without them it's hard to write a dynamic initializer controller (useful for custom resources).
2017-06-09 11:24:41 -07:00
Kubernetes Submit Queue d26bfda9b6 Merge pull request #47189 from sttts/sttts-aggregator-transport-cleanup
Automatic merge from submit-queue (batch tested with PRs 47113, 46665, 47189)

kube-apiserver: cleanup node proxy setup code

Follow-up of https://github.com/kubernetes/kubernetes/pull/46680, fixing #46679

- move `proxyTransport` from `New` func to config
- use self-explaining variable names
- remove redundant temporary var
- make `CreateNodeDialer` side-effect-free
- make imports follow conventions
- lower-case error messages
2017-06-09 10:26:44 -07:00
Dr. Stefan Schimanski 30668b24fb client-go: GetOptions for dynamic client 2017-06-09 18:04:17 +02:00
Simon Croome 5e2503e71f Add StorageOS volume plugin 2017-06-09 13:19:27 +01:00
Kubernetes Submit Queue 8c2a07fa1f Merge pull request #45575 from wanghaoran1988/fix_44476
Automatic merge from submit-queue

Make gcp auth provider not to override the Auth header if it's already exits

**What this PR does / why we need it**:
Make AuthProvider not wrap the transport if beartoken or basic auth is enabled
**Which issue this PR fixes** :
 fixes #44476 

**Special notes for your reviewer**:

**Release note**:
```
GCP auth plugin no longer overwrites existing Authorization headers.
```
2017-06-08 23:47:03 -07:00
Kubernetes Submit Queue 9f23149a52 Merge pull request #44965 from jpeeler/podpreset-exclusion-simple
Automatic merge from submit-queue

Allow pods to opt out of PodPreset mutation via an annotation on the pod

An annotation in the pod spec of the form:
podpreset.admission.kubernetes.io/PodPresetOptOut: "true"
Will cause the admission controller to skip manipulating the pod spec,
no matter the labelling.

This is an alternative implementation to pull #44163.

```release-note
Allow pods to opt out of PodPreset mutation via an annotation on the pod.
```
2017-06-08 22:57:34 -07:00
zhengjiajin f7ce20d2e4 Fix api description 2017-06-09 10:27:53 +08:00
Jeff Grafton 64bd79fad7 Convert go_binary linkstamp to x_defs 2017-06-08 14:59:55 -07:00
Kubernetes Submit Queue a5affa8d86 Merge pull request #47065 from deads2k/server-26-impersonate-test
Automatic merge from submit-queue

test header removal for impersonation

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

Adds a test that fails if the headers aren't removed.

@lavalamp per request
2017-06-08 13:04:26 -07:00
Dawn Chen acabdc4679 Merge pull request #47191 from liggitt/revert-gzip
Revert "add gzip compression to GET and LIST requests"
2017-06-08 11:50:39 -07:00
Kubernetes Submit Queue d31c946f31 Merge pull request #46970 from shiywang/cdr
Automatic merge from submit-queue (batch tested with PRs 46559, 46970)

Add e2e test that ensures that CRDs work in kube-apiserver

part of https://github.com/kubernetes/kubernetes/issues/45511
2017-06-08 11:43:04 -07:00
Jordan Liggitt 63e3e2fa7b
Revert "add gzip compression to GET and LIST requests"
This reverts commit fc650a54d0.
2017-06-08 13:26:05 -04:00
Dr. Stefan Schimanski 342a8fc657 kube-apiserver: cleanup node proxy setup code 2017-06-08 18:20:16 +02:00
Shiyang Wang f7ae22ab8e e2e test that ensures that CRDs work in kube-apiserver 2017-06-08 21:28:04 +08:00
Kubernetes Submit Queue 5404948e7b Merge pull request #47041 from k82cn/k8s_10043
Automatic merge from submit-queue

Deprecated binding for 1.7

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

```release-note
Deprecated Binding objects in 1.7.
```
2017-06-07 23:10:38 -07:00
Klaus Ma 6ad529be3e generated client-go. 2017-06-08 10:53:25 +08:00
Kubernetes Submit Queue d16d64f620 Merge pull request #46916 from smarterclayton/secretbox
Automatic merge from submit-queue (batch tested with PRs 46979, 47078, 47138, 46916)

Add a secretbox and AES-CBC path for encrypt at rest

Add a secretbox and AES-CBC encrypt at rest provider and alter the config, based on feedback from security review.  AES-CBC is more well reviewed and generally fits better with common criteria and FIPS, secretbox is newer and faster than CBC.

```release-note
Add secretbox and AES-CBC encryption modes to at rest encryption.  AES-CBC is considered superior to AES-GCM because it is resistant to nonce-reuse attacks, and secretbox uses Poly1305 and XSalsa20.
```
2017-06-07 19:01:53 -07:00
Kubernetes Submit Queue 1901cf8a37 Merge pull request #47138 from smarterclayton/delete_collection
Automatic merge from submit-queue (batch tested with PRs 46979, 47078, 47138, 46916)

DeleteCollection should include uninitialized resources

Users who delete a collection expect all resources to be deleted, and
users can also delete an uninitialized resource. To preserve this
expectation, DeleteCollection selects all resources regardless of
initialization.

The namespace controller should list uninitialized resources in order to
gate cleanup of a namespace.

Fixes #47137
2017-06-07 19:01:47 -07:00
Kubernetes Submit Queue 914f5d659e Merge pull request #47003 from aveshagarwal/master-scheduler-aggregate-errors-issue
Automatic merge from submit-queue (batch tested with PRs 45877, 46846, 46630, 46087, 47003)

Remove duplicate errors from an aggregate error input.

This PR, in general, removes duplicate errors from an aggregate error input, and returns unique errors with their occurrence count. Specifically,  this PR helps with some scheduler errors that fill the log enormously. For example, see the following `truncated` output from a 300-plus nodes cluster, as there was a same error from almost all nodes.


[SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected., SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found.........

After this PR, the output looks like (on a 2-node cluster):

SchedulerPredicates failed due to persistentvolumeclaims "mongodb" not found, which is unexpected.(Count=2)

@derekwaynecarr @smarterclayton @kubernetes/sig-scheduling-pr-reviews 

Fixes https://github.com/kubernetes/kubernetes/issues/47145
2017-06-07 17:55:52 -07:00
Kubernetes Submit Queue 20bf5f2311 Merge pull request #47086 from enisoc/crd-namespace-cleanup
Automatic merge from submit-queue (batch tested with PRs 47024, 47050, 47086, 47081, 47013)

apiextensions-apiserver: Fix decoding of DeleteOptions.

Fixes #47072 by making apiextensions-apiserver capable of decoding unversioned DeleteOptions, rather than only handling Unstructured objects (i.e. Custom Resources).

This also closes #46736 and #37554 since the added regression test works for TPR as well.
2017-06-07 16:53:43 -07:00
Kubernetes Submit Queue 43295501a3 Merge pull request #47050 from sttts/sttts-deprecate-tpr-example
Automatic merge from submit-queue (batch tested with PRs 47024, 47050, 47086, 47081, 47013)

client-go: deprecate TPR example and add CRD example

/cc @nilebox

Part of https://github.com/kubernetes/kubernetes/issues/46702
2017-06-07 16:53:40 -07:00
Kubernetes Submit Queue 507ca73218 Merge pull request #47024 from CaoShuFeng/legacy_hijack
Automatic merge from submit-queue

[legacy audit] add response audit for hijack

Fixes #47097
**Release note**:

```
NONE
```
2017-06-07 16:32:32 -07:00
Clayton Coleman 9ad1f80fdc
DeleteCollection should include uninitialized resources
Users who delete a collection expect all resources to be deleted, and
users can also delete an uninitialized resource. To preserve this
expectation, DeleteCollection selects all resources regardless of
initialization.

The namespace controller should list uninitialized resources in order to
gate cleanup of a namespace.
2017-06-07 17:50:57 -04:00