Commit Graph

4805 Commits (63930183e023492671817c5e33e5b80f1738ae2d)

Author SHA1 Message Date
Kubernetes Submit Queue 35cc40e1e0
Merge pull request #67159 from luxas/shared_config_types_conversion
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Write manually-created conversion funcs for shared ComponentConfig types

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

Due to how `conversion-gen` works today, it only discovers manually-generated conversion functions when creating autogenerated content for a referencing package. So in the example of `pkg/apis/componentconfig` referencing `k8s.io/apiserver/pkg/apis/config` types, no "native" conversion functions will be called from `pkg/apis/componentconfig/v1alpha1/zz_generated.conversion.go` unless these `Convert_*` functions exist in `k8s.io/apiserver/pkg/apis/config/v1alpha1/`.

We might consider this a bug in `conversion-gen`, I don't know, but to unblock the process of moving componentconfigs out of `pkg/apis/` I'm sending this PR so https://github.com/kubernetes/kubernetes/pull/66722 eventually can merge.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/assign @liggitt @sttts
2018-08-09 15:11:04 -07:00
Christoph Blecker c14a9c7c2b
Update staging godeps 2018-08-09 14:42:48 -07:00
Lucas Käldström 1b2346584f
Remove defaulting from shared ComponentConfig types 2018-08-09 23:33:47 +03:00
Jordan Liggitt 4e0a3b557e
Make the request attributes clearer in forbidden messages 2018-08-09 15:51:52 -04:00
Lucas Käldström 2c0d378799
Write manually-created conversion funcs for shared ComponentConfig types 2018-08-09 19:48:12 +03:00
Kubernetes Submit Queue d04d7b4db2
Merge pull request #67011 from charrywanganthony/default_admissionPlugins_doc
Automatic merge from submit-queue (batch tested with PRs 65297, 67179, 67116, 67011, 66842). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

list the default enabled admission plugins

**Which issue(s) this PR fixes** :
Fixes #66979 

**Release note**:
```release-note
NONE
```
2018-08-09 08:39:38 -07:00
Kubernetes Submit Queue 8ebc84e71d
Merge pull request #66507 from verb/pid-beta
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Promote ShareProcessNamespace to beta

**What this PR does / why we need it**: The ability to configure PID namespace sharing per-pod was added as an alpha feature in 1.10. This promotes the feature to beta and makes the feature available by default.

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

**Special notes for your reviewer**:
/assign @yujuhong 

**Release note**:

```release-note
The PodShareProcessNamespace feature to configure PID namespace sharing within a pod has been promoted to beta.
```
2018-08-09 05:01:01 -07:00
Chao Wang ee96a5638d list the default enabled admission plugins 2018-08-09 19:46:42 +08:00
Mehdy Bohlool 612dcb9ef1 generated files 2018-08-08 18:47:36 -07:00
Mehdy Bohlool 958a9339a3 Fix Proto Generator to not assign types to packages they don't belong to
The wrong type assignment resulted in wrong imports
2018-08-08 18:47:36 -07:00
juanvallejo d5651948cf
improve kubeconfig file modification time
Trades runtime complexity for spacial complexity when modifying
large amounts of contexts on a kubeconfig.

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.
2018-08-08 16:13:03 -04:00
Lucas Käldström 2ff9bd6699
Rename the KubeConfigFile field to Kubeconfig in ClientConnectionConfiguration 2018-08-08 22:25:55 +03:00
Kubernetes Submit Queue 28d649c2f5
Merge pull request #66932 from nilebox/discovery-include-unavailable
Automatic merge from submit-queue (batch tested with PRs 66394, 66888, 66932). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Include unavailable apiservices in discovery response

**What this PR does / why we need it**:
Include unavailable apiservices into `apis/` discovery endpoint response to fix namespace deletion https://github.com/kubernetes-incubator/service-catalog/issues/2254

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes-incubator/service-catalog/issues/2254

**Special notes for your reviewer**:

**Release note**:


```release-note
kube-apiserver now includes all registered API groups in discovery, including registered extension API group/versions for unavailable extension API servers.
```
2018-08-08 07:00:14 -07:00
Kubernetes Submit Queue 446eef54c5
Merge pull request #66394 from rtripat/i-65724
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support pulling requestheader CA from extension-apiserver-authentication ConfigMap without client CA

This commit prevents extension API server from erroring out during bootstrap when the core
API server doesn't support certificate based authentication for it's clients i.e. client-ca isn't
present in extension-apiserver-authentication ConfigMap in kube-system.

This can happen in cluster setups where core API server uses Webhook token authentication.

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

**Which issue(s) this PR fixes** 
Fixes #65724

**Special notes for your reviewer**:

**Release note**:
```release-note
Allows extension API server to dynamically discover the requestheader CA certificate when the core API server doesn't use certificate based authentication for it's clients
```
2018-08-08 06:30:27 -07:00
Tripathi db828a4440 Support pulling requestheader CA from extension-apiserver-authentication ConfigMap without client CA
This commit prevents extension API server from erroring out during bootstrap when the core
API server doesn't support certificate based authentication for it's clients i.e. client-ca isn't
present in extension-apiserver-authentication ConfigMap in kube-system.

This can happen in cluster setups where core API server uses Webhook token authentication.

Fixes: https://github.com/kubernetes/kubernetes/issues/65724
2018-08-08 02:48:49 -07:00
Kubernetes Submit Queue 28b2b21287
Merge pull request #65891 from CaoShuFeng/audit_v1_stable
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

upgrade Audit api version to stable

Partial Fix: https://github.com/kubernetes/kubernetes/issues/65266

TODO:
    use v1 version of advanced audit policy in [kubeadm](86b9a53226/cmd/kubeadm/app/util/audit/utils.go (L29)), [gce script](86b9a53226/cluster/gce/gci/configure-helper.sh (L743)), [kubemark](86b9a53226/test/kubemark/resources/start-kubemark-master.sh (L349))



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
audit.k8s.io api group is upgraded from v1beta1 to v1.
Deprecated element metav1.ObjectMeta and Timestamp are removed from audit Events in v1 version.
Default value of option --audit-webhook-version and --audit-log-version will be changed from `audit.k8s.io/v1beta1` to `audit.k8s.io/v1` in release 1.13
```
2018-08-08 02:17:24 -07:00
Tomas Nozicka ccb92f6ef8 Move Until from apimachinery to client-go 2018-08-08 06:44:35 +02:00
Nail Islamov d4690f4aec
Include unavailable API services in discovery response 2018-08-08 07:26:27 +03:00
jennybuckley 3a506be626 Add test cases for webhook dry run 2018-08-07 14:59:29 -07:00
jennybuckley aa36dc94cd Fix typo in webhook dry-run check 2018-08-07 14:37:24 -07:00
Kubernetes Submit Queue 00bf292cdc
Merge pull request #66480 from Huang-Wei/stateless-MatchNodeSelectorTerms
Automatic merge from submit-queue (batch tested with PRs 67042, 66480, 67053). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ensure MatchNodeSelectorTerms() runs statelessly

**What this PR does**:

Fix sorting behavior in selector.go:

- move sorting from NewRequirement() out to String()
- add related unit tests
- add unit tests in one of outer callers (pkg/apis/core/v1/helper)

**Why we need it**:
- Without this fix, scheduling and daemonset controller doesn't work well in some (corner) cases

**Which issue(s) this PR fixes**:
Fixes #66298

**Special notes for your reviewer**:
Parameter `nodeSelectorTerms` in method MatchNodeSelectorTerms() is a slice, which is fundamentally a {*elements, len, cap} tuple - i.e. it's passing in a pointer. In that method, NodeSelectorRequirementsAsSelector() -> NewRequirement() is invoked, and the `matchExpressions[*].values` is passed into and **modified** via `sort.Strings(vals)`.

This will cause following daemonset pod fall into an infinite create/delete loop:

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: problem
spec:
  selector:
    matchLabels:
      app: sleeper
  template:
    metadata:
      labels:
        app: sleeper
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - 127.0.0.2
                - 127.0.0.1
      containers:
      - name: busybox
        image: busybox
        command: ["/bin/sleep", "7200"]
```

(the problem can be stably reproduced on a local cluster started by `hack/local-up-cluster.sh`)

The first time daemonset yaml is handled by apiserver and persisted in etcd with original format (original order of values was kept - 127.0.0.2, 127.0.0.1). After that, daemonset controller tries to schedule pod, and it reuses the predicates logic in scheduler component - where the values are **sorted** deeply. This not only causes the pod to be created in sorted order (127.0.0.1, 127.0.0.2), but also introduced a bug when updating daemonset - internally ds controller use a "rawMessage" (bytes of an object) to calculate hash acting as a "controller-revision-hash" to control revision rollingUpdate/rollBack, so it keeps killing "old" pod and spawning "new" pod back and forth, and fall into an infinite loop.

The issue exists in `master`, `release-1.11` and `release-1.10`.

**Release note**:
```release-note
NONE
```
2018-08-07 14:27:59 -07:00
Kubernetes Submit Queue f8b6c59494
Merge pull request #66559 from yue9944882/chore/clean-up-legacyreststorage-test
Automatic merge from submit-queue (batch tested with PRs 67085, 66559, 67089). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleaning up unused LegacyRestStorage for apiserver test

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

As the title

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-07 13:05:10 -07:00
Kubernetes Submit Queue 47878f2bd1
Merge pull request #67085 from jennybuckley/dry-run-admission-2
Automatic merge from submit-queue (batch tested with PRs 67085, 66559, 67089). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Block dry-run if a webhook would be called

**What this PR does / why we need it**:
Follow up to https://github.com/kubernetes/kubernetes/pull/66391
Suggested in https://github.com/kubernetes/kubernetes/pull/66391#issuecomment-410876436

Makes dry-run safe in case https://github.com/kubernetes/kubernetes/pull/66936 takes a long time to merge

**Release note**:

```release-note
NONE
```

/sig api-machinery
cc @lavalamp
2018-08-07 13:05:07 -07:00
Kubernetes Submit Queue d1636b8019
Merge pull request #66807 from caesarxuchao/remove-connectrequest
Automatic merge from submit-queue (batch tested with PRs 66196, 67016, 66807, 67023). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make admission webhooks conversion convert CONNECT body correctly

Fix #59759.

1. Make apiserver pass connectRequest.Options directly to the admission layer. All other information in rest.ConnectRequest is present in admission attributes.
2. Make the scope.Kind of pod/attach, pod/exec, pod/portforward, node/proxy, service/proxy to their respective options Kind, instead of the parent Kind.

I've tested it locally, the conversion is working correctly for "kubectl attach". I'll add e2e tests.

I'll keep this to myself until I add the tests, but cc @mikedanese @liggitt RE. https://github.com/kubernetes/kubernetes/pull/66633.
2018-08-07 11:44:10 -07:00
Wei Huang e5e0de1b9d fix sorting behavior in selector.go
- move sorting from NewRequirement() out to String()
- add related unit tests
- add unit tests in one of outer callers (pkg/apis/core/v1/helper)

Closes #66298
2018-08-07 10:36:16 -07:00
jennybuckley e4c219df42 block dry run if a webhook would be called 2018-08-07 09:27:18 -07:00
Kubernetes Submit Queue 6bea053ee7
Merge pull request #65147 from liggitt/watch-prefix-deprecation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

document /watch prefix deprecation

closes #65133

these have been marked as deprecated in code for many releases, and all client accesses have switched to using the ?watch=true access method, but documentation was never updated

@kubernetes/sig-api-machinery-api-reviews @kubernetes/api-reviewers

```release-note
The watch API endpoints prefixed with `/watch` are deprecated and will be removed in a future release. These standard method for watching resources (supported since v1.0) is to use the list API endpoints with a `?watch=true` parameter. All client-go clients have used the parameter method since v1.6.0.
```
2018-08-07 08:01:14 -07:00
Jordan Liggitt c31faf2509
document /watch prefix deprecation 2018-08-07 08:20:53 -04:00
Kubernetes Submit Queue e69cc51a83
Merge pull request #66083 from jennybuckley/connect-dry-run
Automatic merge from submit-queue (batch tested with PRs 66512, 66946, 66083). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Explicitly disable dry run for connect

**What this PR does / why we need it**:
It isn't clear whether or not dry run would work on connect. I think we should explicitly disable it so no one can try to dry run a connect request and accidentally open a connection.

**Release note**:
```release-note
kube-apiserver: setting a `dryRun` query parameter on a CONNECT request will now cause the request to be rejected, consistent with behavior of other mutating API requests. Examples of CONNECT APIs are the `nodes/proxy`, `services/proxy`, `pods/proxy`, `pods/exec`, and `pods/attach` subresources. Note that this prevents sending a `dryRun` parameter to backends via `{nodes,services,pods}/proxy` subresources.
```
2018-08-06 19:44:07 -07:00
Kubernetes Submit Queue 235badbe5a
Merge pull request #66512 from jennybuckley/openapi-ignore-prefix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Skip building openapi for ignored paths

alternative to #66286

/kind bug
Fixes #66285

```release-note
NONE
```
2018-08-06 19:08:08 -07:00
Chao Xu d89c8dd8c0 generated 2018-08-06 18:59:53 -07:00
Chao Xu 355691d310 Remove rest.ConnectRequest.
Make apiserver pass connectRequest.Options directly to the admission layer. All
the information in rest.ConnectRequest is present in admission attributes.
2018-08-06 18:59:52 -07:00
Kubernetes Submit Queue 6fe7f9f4b7
Merge pull request #66391 from jennybuckley/dry-run-admission
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support dry run in admission plugins

**What this PR does / why we need it**:
Adds support for dry run to admission controllers as outlined by https://github.com/kubernetes/community/pull/2387

- [x] add IsDryRun() to admission.Attributes interface
- [x] add dry run support to NamespaceAutoProvision
- [x] add dry run support to ResourceQuota
- [x] add dry run support to EventRateLimit

The following is being done in a follow up PR:
- [x] add DryRun to ```admission.k8s.io/v1beta1.AdmissionReview```
- [x] add DryRunnable to ```admissionregistration.k8s.io/v1beta1.(Valid|Mut)atingWebhookConfiguration```
- [x] add dry run support to (Valid|Mut)atingAdmissionWebhook

/sig api-machinery

**Release note**:
```release-note
In clusters where the DryRun feature is enabled, dry-run requests will go through the normal admission chain. Because of this, ImagePolicyWebhook authors should especially make sure that their webhooks do not rely on side effects.
```

Here is a list of the admission controllers that were considered when making this PR:
- AlwaysAdmit: No side effects
- AlwaysPullImages: No side effects
- LimitPodHardAntiAffinityTopology: No side effects
- DefaultTolerationSeconds: No side effects
- AlwaysDeny: No side effects
- EventRateLimit: Has side possible effect of affecting the rate, skipping this entire plugin in dry-run case since it won't correspond to an actual write to etcd anyway
- DenyEscalatingExec: No side effects
- DenyExecOnPrivileged: Deprecated, and has no side effects
- ExtendedResourceToleration: No side effects
- OwnerReferencesPermissionEnforcement: No side effects
- ImagePolicyWebhook: No side effects* (*this uses a webhook but it is very specialized. It only sees pod container images, for the purpose of accepting or rejecting certain image sources, so it is very unlikely that it would rely on side effects.)
- LimitRanger: No side effects
- NamespaceAutoProvision: Has possible side effect of creating a namespace, skipping the create in the dry-run case
- NamespaceExists: No side effects
- NodeRestriction: No side effects
- PodNodeSelector: No side effects
- PodPreset: No side effects
- PodTolerationRestriction: No side effects
- Priority: No side effects
- ResourceQuota: Has side possible effect of taking up quota, will only check quota but skip changing quota in the dry-run case
- PodSecurityPolicy: No side effects
- SecurityContextDeny: No side effects
- ServiceAccount: No side effects
- PersistentVolumeLabel: No side effects
- PersistentVolumeClaimResize: No side effects
- DefaultStorageClass: No side effects
- StorageObjectInUseProtection: No side effects
- Initializers: No side effects
- NamespaceLifecycle: No side effects
- MutatingAdmissionWebhook: Same as below
- ValidatingAdmissionWebhook: Has possible side effects depending on if webhook authors depend on side effects and a reconciliation mechanism. To fix this we will expose whether or not a request is dry-run to webhooks through AdmissionReview, and require that all called webhooks understand the field by checking if DryRunnable true is specified in the webhook config. This will be done in a separate PR because it requires an api-change
2018-08-06 17:51:21 -07:00
Kubernetes Submit Queue a945b5d928
Merge pull request #67024 from juanvallejo/jvallejo/add-cancel-req-discovery-rt
Automatic merge from submit-queue (batch tested with PRs 66958, 67024). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add CancelRequest to discovery round-tripper

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

Make discovery roundtripper implement the RequestCanceler interface

cc @deads2k
2018-08-06 13:41:03 -07:00
Kubernetes Submit Queue 6afd783dd9
Merge pull request #66813 from DylanBLE/pprof
Automatic merge from submit-queue (batch tested with PRs 59030, 64666, 66251, 66485, 66813). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix apiserver pprof redirect bug

**What this PR does / why we need it**:
fix apiserver pprof redirect bug

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-08-06 12:21:12 -07:00
Kubernetes Submit Queue c06e76ce7f
Merge pull request #66251 from p0lyn0mial/generate_register_file
Automatic merge from submit-queue (batch tested with PRs 59030, 64666, 66251, 66485, 66813). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

register.go generator for external types

**What this PR does / why we need it**: This pull brings a new generator that creates `register.go` file, initially only for the external types. The app takes only one argument `--input-dirs` and outputs `zz_generated.register.go` file in the same directory. The name of the generated file can be controlled by passing `output-file-base` flag.

See: https://github.com/kubernetes/kubernetes/issues/65612

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

**Special notes for your reviewer**:

Passing https://github.com/openshift-evangelists/crd-code-generation/blob/master/pkg/apis/example.com/v1/types.go  to register-gen produces the following output:


```
/*
Copyright The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// Code generated by ___debug_register_gen. DO NOT EDIT.

package v1

import (
        v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
        "k8s.io/apimachinery/pkg/runtime"
        "k8s.io/apimachinery/pkg/runtime/schema"
)

// GroupName specifies the group name used to register the objects.
const GroupName = "example.com"

// GroupVersion specifies the group and the version used to register the objects.
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1"}

// SchemeGroupVersion is group version used to register these objects
// Deprecated: use GroupName instead.
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

// Resource takes an unqualified resource and returns a Group qualified GroupResource
func Resource(resource string) schema.GroupResource {
        return SchemeGroupVersion.WithResource(resource).GroupResource()
}

var (
        // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
        SchemeBuilder      runtime.SchemeBuilder
        localSchemeBuilder = &SchemeBuilder
        // Depreciated: use Install instead
        AddToScheme = localSchemeBuilder.AddToScheme
        Install     = localSchemeBuilder.AddToScheme
)

func init() {
        // We only register manually written functions here. The registration of the
        // generated functions takes place in the generated files. The separation
        // makes the code compile even when the generated files are missing.
        localSchemeBuilder.Register(addKnownTypes)
}

// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
        scheme.AddKnownTypes(SchemeGroupVersion,
                &Database{},
                &DatabaseList{},
        )
        // AddToGroupVersion allows the serialization of client types like ListOptions.
        v1.AddToGroupVersion(scheme, SchemeGroupVersion)
        return nil
}
```


**Release note**:

```
NONE
```
2018-08-06 12:21:05 -07:00
Kubernetes Submit Queue 3ba90d4f0a
Merge pull request #64666 from CaoShuFeng/admissionregistration_cleanup
Automatic merge from submit-queue (batch tested with PRs 59030, 64666, 66251, 66485, 66813). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean up empty dir for admissionregistration

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-06 12:21:00 -07:00
jennybuckley adafb1365e Support dry run in admission plugins 2018-08-06 10:37:44 -07:00
juanvallejo 07eae3a172
add CancelRequest to discovery round-tripper 2018-08-06 12:05:47 -04:00
hongjian.sun 981f239781 fix apiserver pprof redirect bug 2018-08-06 19:35:01 +08:00
Kubernetes Submit Queue a160fe94a5
Merge pull request #64517 from sttts/sttts-apiserver-sectioned-flags
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kube-apiserver: output flags in logical sections

<img width="862" alt="bildschirmfoto 2018-06-07 um 16 21 17" src="https://user-images.githubusercontent.com/730123/41105818-d8d68440-6a6e-11e8-91ba-cc682a2c63dd.png">

```release-note
Print kube-apiserver --help flag help in sections.
```
2018-08-06 03:18:57 -07:00
p0lyn0mial dcde050188 adds a new generator that creates register.go files
this pull brings a new generator that creates register.go file, initially only for the external types.
The app takes only one argument --input-dirs and outputs zz_generated.register.go file in the same directory.
The name of the generated file can be controlled by passing output-file-base flag.
2018-08-06 09:43:33 +02:00
Dr. Stefan Schimanski 42d533e40c apiserver: output flags in logical sections 2018-08-06 08:55:09 +02:00
Kubernetes Submit Queue 7dcbdbb1df
Merge pull request #66059 from hanxiaoshuai/apicfg
Automatic merge from submit-queue (batch tested with PRs 66058, 66059). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

move apiserver Configuration to k8s.io/apiserver/pkg/apis/config

**What this PR does / why we need it**:
ref [#2354](https://github.com/kubernetes/community/pull/2354)
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
After the related componentconfig  to be moved to staging, LeaderElectionConfiguration and DebuggingConfiguration should be clean up in pkg/apis/componentconfig
**Release note**:

```release-note
NONE
```
2018-08-05 07:05:05 -07:00
Tom Kerkhove 615dedb167 Introduce Azure custom metrics adapter
Signed-off-by: Tom Kerkhove <kerkhove.tom@gmail.com>
2018-08-05 11:40:56 +02:00
hangaoshuai d6caefe848 update zz_generated.conversion.go file 2018-08-05 11:50:25 +08:00
hangaoshuai 6be5a07d41 add an OWNERS file 2018-08-05 11:43:34 +08:00
hangaoshuai 2193f9892e add generated code files 2018-08-05 11:43:34 +08:00
hangaoshuai 0875ffe1e2 move apiserver Configuration to k8s.io/apiserver/pkg/apis/config 2018-08-05 11:43:34 +08:00
hangaoshuai 1bc0f431be update zz_generated.conversion.go file 2018-08-05 11:39:05 +08:00
hangaoshuai 378855e8f4 add an OWNERS file 2018-08-05 11:33:28 +08:00
hangaoshuai b7ce1f8208 add generated code files 2018-08-05 11:33:28 +08:00
hangaoshuai ad1f3e659e move componentconfig ClientConnectionConfiguration to k8s.io/apimachinery/pkg/apis/config 2018-08-05 11:33:28 +08:00
Antoine Pelisse b5258a5380 storage: Move precondition check as a method of preconditions 2018-08-03 14:30:50 -07:00
Antoine Pelisse 68937c4934 dry-run: Use dry-runnable structure 2018-08-03 14:30:50 -07:00
David Eads 8a1eae451b stop adding internal types to external schemes 2018-08-03 09:47:04 -04:00
Kubernetes Submit Queue 5b82745caf
Merge pull request #65983 from sttts/sttts-crd-object-count
Automatic merge from submit-queue (batch tested with PRs 66822, 65983). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions-apiserver: enable etcd_object_count metrics for CustomResources

~~This leaks one go routine per CRD that is deleted~~ The stop channel is wired already. We should not have the leak of the go routine:
d10e08fc89/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go (L1379)

```release-note
Added etcd_object_count metrics for CustomResources.
```
2018-08-03 00:08:58 -07:00
Kubernetes Submit Queue a2223e9a92
Merge pull request #66837 from deads2k/client-02-panic
Automatic merge from submit-queue (batch tested with PRs 66870, 66929, 66837). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix panic fake SAR client expansion

if the object is nil, the type assertion fails.

@kubernetes/sig-api-machinery-bugs 

```release-note
NONE
```
2018-08-02 17:03:08 -07:00
Kubernetes Submit Queue 99f96511fd
Merge pull request #66929 from deads2k/client-03-wrapping-log
Automatic merge from submit-queue (batch tested with PRs 66870, 66929, 66837). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add logging to find offending transports

When a transport can't be cancelled, we're notified, but we don't which transport is missing the ability.  This adds logging to give us a target type.

@kubernetes/sig-api-machinery-bugs 
/assign @juanvallejo 

since you hit it.

```release-note
NONE
```
2018-08-02 17:03:05 -07:00
David Eads 8b61c5a088 add logging to find offending transports 2018-08-02 15:14:27 -04:00
Antoine Pelisse 71970d6475 dry-run: Update DynamicClient to pass Create/Update options 2018-08-02 10:38:31 -07:00
W. Trevor King e42aab6430 client-go/rest: Fix "segments segment" comment typo
The typo landed with SubResource in adb75e1f (generated staging area,
2016-08-06, kubernetes/kubernetes#29147).
2018-08-02 08:30:44 -07:00
David Eads efb160c945 generated 2018-08-01 15:31:12 -04:00
David Eads d3bd0eb1d5 make package name match all the import aliases 2018-08-01 15:31:12 -04:00
David Eads 1f703d33f5 add methods to apimachinery to easy unit testing 2018-08-01 15:31:12 -04:00
Emil Nikolov 9b980fc6a0
Fix a typo: coverting -> converting 2018-08-01 12:27:23 +01:00
Ibrahim AshShohail 23996b25c9
change TRUNCATED to DATA+OMITTED in kubectl config view
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>
2018-08-01 03:39:50 +03:00
Kubernetes Submit Queue f49708bd49
Merge pull request #66643 from smarterclayton/improve_events
Automatic merge from submit-queue (batch tested with PRs 66445, 66643, 60551). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve the output of `kubectl get events`

Events have long shown the most data of the core objects in their output, but that data is of varying use to a user. Following the principle that events are intended for the system to communicate information back to the user, and that Message is the primary human readable field, this commit alters the default columns to ensure event is shown with the most width given to the message, and all other fields organized by their relevance to the message.

1. Events are no longer sorted in the printer (this was a bug and was broken with paging and server side rendering)
2. Only the last seen, type, reason, kind, and message fields are shown by default, which makes the message prominent
3. Source, subobject, count, and first seen are only shown under `-o wide`
4. The duration fields were changed to be the more precise output introduced for job duration (2-3 sig figs)
5. Prioritized the column order for scanning - when, how important, what kind of error, what kind of object, and the message.
6. Trim trailing newlines on the message.

```release-note
Improved the output of `kubectl get events` to prioritize showing the message, and move some fields to `-o wide`.
```

```
$ kubectl get events --sort-by lastTimestamp
LAST SEEN TYPE      REASON                   KIND                    MESSAGE
16m       Normal    SawCompletedJob          CronJob                 Saw completed job: image-mirror-origin-v3.11-quay-1532581200
16m       Normal    SuccessfulDelete         CronJob                 Deleted job image-mirror-origin-v3.11-quay-1532577600
14m       Normal    Scheduled                Pod                     Successfully assigned 50c42204-9091-11e8-b2a1-0a58ac101869 to origin-ci-ig-n-fqfh
14m       Normal    Pulling                  Pod                     pulling image "docker-registry.default.svc:5000/ci/commenter:latest"
14m       Normal    Created                  Pod                     Created container
14m       Normal    Pulled                   Pod                     Successfully pulled image "docker-registry.default.svc:5000/ci/commenter:latest"
14m       Normal    Started                  Pod                     Started container
14m       Normal    SandboxChanged           Pod                     Pod sandbox changed, it will be killed and re-created.
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m14s     Normal    ScaleDown                Pod                     deleting pod for node scale down
4m13s     Normal    SuccessfulCreate         ReplicationController   Created pod: tide-30-hmncf
4m13s     Normal    Scheduled                Pod                     Successfully assigned tide-30-hmncf to origin-ci-ig-n-x64l
4m12s     Normal    SuccessfulCreate         ReplicationController   Created pod: console-jenkins-operator-16-dd5k8
4m12s     Normal    SuccessfulCreate         ReplicationController   Created pod: sinker-23-scfmt
```
2018-07-31 15:56:07 -07:00
David Eads 13db7c77c9 fix panic fake SAR client expansion 2018-07-31 16:17:36 -04:00
Kubernetes Submit Queue 259e0743f1
Merge pull request #66581 from janetkuo/deploy-progress
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Default extensions/v1beta1 Deployment's ProgressDeadlineSeconds to MaxInt32

**What this PR does / why we need it**: Default values should be set in all API versions, because defaulting happens whenever a serialized version is read. When we switched to `apps/v1` as the storage version in `1.10` (#58854), `extensions/v1beta1` `DeploymentSpec.ProgressDeadlineSeconds` gets `apps/v1` default value (`600`) instead of being unset. 

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

**Special notes for your reviewer**: We need to cherrypick this fix to 1.10 and 1.11. Note that this fix will only help people who haven't upgraded to 1.10 or 1.11 when the storage version is changed. 

@kubernetes/sig-apps-bugs 

**Release note**:

```release-note
NONE
```
2018-07-31 09:30:59 -07:00
Cao Shufeng 716dc87a10 use Audit v1 api and add it to some unit tests 2018-07-30 15:56:39 +08:00
Cao Shufeng 15b800fdf7 run "make update" 2018-07-30 15:56:39 +08:00
Cao Shufeng 6d2c2ef169 upgrade advanced Audit to stable 2018-07-30 15:56:39 +08:00
Kubernetes Submit Queue 6715f13929
Merge pull request #65799 from dekkagaijin/fix-headers
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Percent-encode illegal characters in user.Info.Extra keys

This percent-encodes characters in `X-Remote-Extra-` and `Impersonate-Extra-` keys which aren't valid for header names per [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.6) (plus "%" to avoid breaking keys which contain them). The API server then blindly unescapes these keys.

Reviewer note:
Old clients sending keys which were `%`-escaped by the user will have their values unescaped by new API servers. New clients sending keys containing illegal characters (or "%") to old API servers will not have their values unescaped. This version skew incompatibility is a compromise discussed in #63682.

Fixes #63682

PTAL @mikedanese 

**Release note**:
```release-note
action required: the API server and client-go libraries have been fixed to support additional non-alpha-numeric characters in UserInfo "extra" data keys. Both should be updated in order to properly support extra data containing "/" characters or other characters disallowed in HTTP headers.
```
2018-07-27 16:42:11 -07:00
Kubernetes Submit Queue c2cbe86f7d
Merge pull request #66648 from feiskyer/azure-sdk-update
Automatic merge from submit-queue (batch tested with PRs 66225, 66648, 65799, 66630, 66619). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update Azure Go SDK to v19.0.0 and get availability zone for VirtualMachineScaleSetVM

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

Continue of #66242. This PR updates Azure Go SDK to v19.0.0 (with compute API 2018-04-01) and gets availability zones for VirtualMachineScaleSetVM.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Azure Go SDK has been upgraded to v19.0.0 and VirtualMachineScaleSetVM now supports availability zones.
```

/sig azure
/assign @brendandburns @khenidak @andyzhangx
2018-07-27 16:42:08 -07:00
Janet Kuo 4dadbb531a Autogen
1. hack/update-generated-protobuf.sh
2. hack/update-generated-swagger-docs.sh
3. hack/update-swagger-spec.sh
4. hack/update-openapi-spec.sh
5. hack/update-api-reference-docs.sh
2018-07-27 10:10:30 -07:00
Janet Kuo 849c08d1ed Update API doc of ProgressDeadlineSeconds 2018-07-27 10:10:30 -07:00
Kubernetes Submit Queue 090cafadec
Merge pull request #66616 from smarterclayton/timeout_error
Automatic merge from submit-queue (batch tested with PRs 66554, 66616, 66695, 66681). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make the timeout error more specific so users can find it
2018-07-27 10:09:08 -07:00
Kubernetes Submit Queue 630c780f37
Merge pull request #66333 from hzxuzhonghu/audit
Automatic merge from submit-queue (batch tested with PRs 66333, 65542). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add String method to audit.Backend interface

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

Add `String()` method to `audit.Backend` interface.  Should enforce backend to implement this method.
Because https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver/pkg/audit/union.go#L65

We encountered this issue when we upgrade recently and we implemented our private backend.

**Release note**:

```release-note
NONE
```
2018-07-27 07:24:02 -07:00
Pengfei Ni 4457947e11 Update staging Godeps 2018-07-27 10:13:56 +08:00
Clayton Coleman 2f275b72b2
Improve the output of `kubectl get events`
Events have long shown the most data of the core objects in their output, but that data is of varying use
to a user. Following the principle that events are intended for the system to communicate information back
to the user, and that Message is the primary human readable field, this commit alters the default columns
to ensure event is shown with the most width.

1. Events are no longer sorted in the printer (this was a bug and was broken with paging and server side
   rendering)
2. Only the last seen, type, reason, kind, and message fields are shown by default, which makes the
   message prominent
3. Source, subobject, count, and first seen are only shown under `-o wide`
4. The duration fields were changed to be the more precise output introduced for job duration (2-3 sig figs)
2018-07-26 16:12:32 -04:00
Kubernetes Submit Queue cef2d325ee
Merge pull request #66395 from awly/fix-kubelet-exec-plugin-startup
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update http.Transport if it already exists in ExecProvider

**What this PR does / why we need it**:
This unbreaks ExecPlugin. Without the change, we hit this error
https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/transport/transport.go#L32

**Release note**:
```release-note
Fix kubelet startup failure when using ExecPlugin in kubeconfig
```
2018-07-26 10:47:05 -07:00
Clayton Coleman 8a2d037bc5
Make the timeout error more specific so users can find it
This makes the error consistent with the timeout filter and also helps
the user understand that they requested a specific timeout.
2018-07-26 00:53:31 -04:00
Andrew Lytvynov 3357b5ecf4 Set connrotation dialer via restclient.Config.Dialer
Instead of Transport. This fixes ExecPlugin, which fails if
restclient.Config.Transport is set.
2018-07-25 16:23:57 -07:00
Kubernetes Submit Queue b6bffa83c0
Merge pull request #64681 from CaoShuFeng/webhook_validating_test_case
Automatic merge from submit-queue (batch tested with PRs 64681, 65907). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix a TODO in ValidatingAdmissionWebhook

Tests still passes without this filter.


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

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

**Special notes for your reviewer**:
/assign @sttts 

**Release note**:

```release-note
NONE
```
2018-07-24 16:28:08 -07:00
jennybuckley 37c10e2e05 Skip building openapi for ignored paths 2018-07-24 16:11:42 -07:00
Kubernetes Submit Queue 4e5c781b7d
Merge pull request #66411 from DirectXMan12/bug/allow-setting-openapi-version-with-sec
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Autoset OpenAPI version w/o SecurityDefinitions

There's code to automatically populate OpenAPI info based on existing
generic apiserver config, but it only fires if securitydefinitions are
present.  This doesn't make much sense, since this info is both required
and independent of security definitions, and there's no easy, generic
way to generate security definitions for an aggregated API server.

**Release note**:
```release-note
Properly autopopulate OpenAPI version field without needing other OpenAPI fields present in generic API server code.
```
2018-07-24 02:05:59 -07:00
Kubernetes Submit Queue 6764a79586
Merge pull request #66518 from deads2k/dynamic-02-ordie
Automatic merge from submit-queue (batch tested with PRs 66252, 66518). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add missing OrDie variant for dynamic client construction

Generated clients have it and it is very handy for test cases.

```release-note
NONE
```

@kubernetes/sig-api-machinery-pr-reviews
2018-07-24 00:49:07 -07:00
yue9944882 a6b781935e cleaning up 2018-07-24 15:04:28 +08:00
Antoine Pelisse 623370f603 dry-run: Run generated commands 2018-07-23 14:07:19 -07:00
David Eads 75e28b0dd4 add missing OrDie variant for dynamic client construction 2018-07-23 16:29:35 -04:00
Antoine Pelisse e99651b34b dry-run: Add DryRunTrue value 2018-07-23 13:15:22 -07:00
Lee Verberne 3acade424f Generated code for ShareProcessNamespace beta 2018-07-23 17:13:59 +02:00
Lee Verberne 85a2f92f5b Promote ShareProcessNamespace to beta 2018-07-23 17:13:59 +02:00
Kubernetes Submit Queue 819604e2ed
Merge pull request #65558 from apelisse/dry-run-feature-gate
Automatic merge from submit-queue (batch tested with PRs 66410, 66398, 66061, 66397, 65558). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

dry-run: Create feature-gate flag

Creates a feature gate flag for dry-run. Currently, dry-run query parameter is completely blocking all requests, once the feature is implemented, the flag will allow the parameter to pass if enabled.

cc @jennybuckley @deads2k @liggitt @lavalamp 

**Release note**:

```release-note
NONE
```
2018-07-20 18:51:14 -07:00
Kubernetes Submit Queue b914542b9c
Merge pull request #66264 from joejulian/workaround_for_slow_arm64_math
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

extend timeout to workaround slow arm64 math

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

The math/big functions are slow on arm64. There is improvement coming
with go1.11 but until such time as that version can be used to build releases, 
if a server uses rsa certificates on arm64, the math load for the multitude
of watches over-taxes the ability of the processor and the TLS connections
time out. Retries will also not succeed and serve to exacerbate the problem.

By extending the timeout, the TLS connections will eventually be
successful and the load will drop.

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

**Special notes for your reviewer**:
This was tested on a Raspberry Pi 3

**Release note**:
```release-note
Extend TLS timeouts to work around slow arm64 math/big
```
2018-07-20 16:02:14 -07:00
Kubernetes Submit Queue 267dd6b6a2
Merge pull request #66403 from deads2k/api-03-panic-track
Automatic merge from submit-queue (batch tested with PRs 66341, 66405, 66403, 66264, 66447). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

indicate which scheme has conflicting data

An oversight when adding scheme origination to error messages.  There are a couple state dependent panics which are useful to gain info on.

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

```release-note
NONE
```
2018-07-20 16:02:11 -07:00
Kubernetes Submit Queue 6c500be080
Merge pull request #66218 from atlassian/handle-errors
Automatic merge from submit-queue (batch tested with PRs 66152, 66406, 66218, 66278, 65660). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Handle errors

**What this PR does / why we need it**:
This is a followup PR for https://github.com/kubernetes/kubernetes/pull/64664 to handle errors returned from `.AddToScheme()` in places where they are not handled.

**Release note**:
```release-note
NONE
```
/kind cleanup
/sig api-machinery
/cc @sttts
2018-07-20 12:12:15 -07:00
Antoine Pelisse 9e7b140450 dry-run: Create feature-gate flag 2018-07-20 11:40:06 -07:00
Solly Ross ef73bb684b Autoset OpenAPI version w/o SecurityDefinitions
There's code to automatically populate OpenAPI info based on existing
generic apiserver config, but it only fires if securitydefinitions are
present.  This doesn't make much sense, since this info is both required
and independent of security definitions, and there's no easy, generic
way to generate security definitions for an aggregated API server.
2018-07-20 10:27:41 -04:00
Jordan Liggitt aad0e2e15f
Do not attempt to convert nil object during DELETE webhook admission 2018-07-20 08:31:07 -04:00
Kubernetes Submit Queue 24fc97a828
Merge pull request #66249 from deads2k/cli-03-restmapper
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fill in normal restmapping info with the legacy guess

@DirectXMan12 noted this here: https://github.com/kubernetes/kubernetes/issues/65718#issuecomment-401915805

The code does look wrong. This tries to fix it up

@kubernetes/sig-api-machinery-bugs 

```release-note
NONE
```
2018-07-19 14:38:58 -07:00
David Eads 7276aa0c7a indicate which scheme has conflicting data 2018-07-19 16:48:44 -04:00
Joe Julian 62b9d37866 extend timeout to workaround slow arm64 math
The math/big functions are slow on arm64. There is improvement coming
with go1.11 but in the mean time if a server uses rsa certificates on
arm64, the math load for the multitude of watches over taxes the ability
of the processor and the TLS connections time out. Retries will also not
succeed and serve to exacerbate the problem.

By extending the timeout, the TLS connections will eventually be
successful and the load will drop.

Fixes #64649
2018-07-19 10:52:46 -07:00
Kubernetes Submit Queue 8770d12494
Merge pull request #65572 from yue9944882/fixes-admission-operation-mismatch-for-create-on-update
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fixes operation for "create on update"

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

Set operation to `admission.Create` for create-on-update requests.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Checks CREATE admission for create-on-update requests instead of UPDATE admission
```
2018-07-19 10:42:54 -07:00
Kubernetes Submit Queue d08e68e759
Merge pull request #65849 from CaoShuFeng/debuggingRoundTripper
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix kube-aggregator dailer

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


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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-19 09:29:04 -07:00
Kubernetes Submit Queue d2cc34fb07
Merge pull request #65771 from smarterclayton/untyped
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a new conversion path to replace GenericConversionFunc

reflect.Call is very expensive. We currently use a switch block as part of AddGenericConversionFunc to avoid the bulk of top level a->b conversion for our primary types which is hand-written. Instead of having these be handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach last year). The
conversion machinery should then do a simple map lookup based on the incoming types and invoke the function.  Like defaulting, it's up to the caller to match the types to arguments, which we do by generating this code.  This bypasses reflect.Call and in the future allows Golang mid-stack inlining to optimize this code.

As part of this change I strengthened registration of custom functions to be generated instead of hand registered, and also strengthened error checking of the generator when it sees a manual conversion to error out.  Since custom functions are automatically used by the generator, we don't really have a case for not registering the functions.

Once this is fully tested out, we can remove the reflection based path and the old registration methods, and all conversion will work from point to point methods (whether generated or custom).

Much of the need for the reflection path has been removed by changes to generation (to omit fields) and changes to Go (to make assigning equivalent structs easy).

```release-note
NONE
```
2018-07-19 09:29:00 -07:00
Kubernetes Submit Queue 7f912af75c
Merge pull request #59383 from tanshanshan/fix-little3
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Replace info log with warn log

**What this PR does / why we need it**:
Replace info log with warn log
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #59356 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-19 07:28:44 -07:00
Cao Shufeng dc07d27d8b fix kube-aggregator dailer 2018-07-19 14:40:33 +08:00
xuzhonghu 416a478cf6 Add String method to audit.Backend interface 2018-07-18 17:55:01 +08:00
Kubernetes Submit Queue 57321c31a8
Merge pull request #64690 from chenyb4/fix_typo
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix TestWantsExternalKubeClientSet describe clientset typo

Signed-off-by: Yuanbin.Chen <cybing4@gmail.com>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-18 02:26:28 -07:00
Kubernetes Submit Queue a00e3748d4
Merge pull request #66302 from wking/apimachinery-runtime-doc-list
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apimachinery/pkg/runtime/doc: Split list into paragraphs

[Godoc uses go/doc][1] to convert comments to HTML, and go/doc [has no markup for lists][2].  With the previous comment, the lack of paragraph-splitting lines between the list entries was leading to entries 0, 1, etc. being formatted as a single paragraph.  And the hanging indents for entry 3, etc. were leading to formatting within `<pre>` blocks:

```console
$ curl -s https://godoc.org/k8s.io/apimachinery/pkg/runtime | grep -B1 -A7 'Your API objects'
<p>
0. Your API objects have a common metadata struct member, TypeMeta.
1. Your code refers to an internal set of API objects.
2. In a separate package, you have an external set of API objects.
3. The external set is considered to be versioned, and no breaking
</p>
<pre>changes are ever made to it (fields may be added but not changed
or removed).
</pre>
```

```release-note
NONE
```

[1]: https://godoc.org/golang.org/x/tools/cmd/godoc
[2]: https://golang.org/pkg/go/doc/#ToHTML
2018-07-17 23:18:33 -07:00
Clayton Coleman 90b5fbe876
generated: bazel 2018-07-17 23:02:16 -04:00
Clayton Coleman ef561ba8b5
generated: Avoid use of reflect.Call in conversion code paths 2018-07-17 23:02:16 -04:00
Clayton Coleman b5a266141c
Remove generic conversion function 2018-07-17 23:02:16 -04:00
Clayton Coleman ba95744bc5
Make conversion function names match expected values 2018-07-17 23:02:16 -04:00
Clayton Coleman bd0e4edd4f
Add a new conversion path to replace GenericConversionFunc
reflect.Call is very expensive. We currently use a switch block as part
of AddGenericConversionFunc to avoid the bulk of top level a->b
conversion for our primary types. Instead of having these be
handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach). The
conversion machinery would then do a simple map lookup and invoke the
function. This bypasses reflect.Call and in the future allows Golang
mid-stack inlining to optimize this code.

As a future step we can drop support for the reflection path and simply
return a nice error "you must write a generator for your type".
2018-07-17 23:02:15 -04:00
Clayton Coleman a36fd65c5a
conversion-gen: Report an error in conversion when names don't match 2018-07-17 23:02:09 -04:00
Clayton Coleman eb85c83e92
conversion-gen: Better error on duplicate objects 2018-07-17 23:02:02 -04:00
Clayton Coleman e9fa259451
conversion-gen: Register static untyped functions (interface{}) 2018-07-17 23:01:35 -04:00
tanshanshan 585f9c1af8 fix info level message 2018-07-18 08:46:39 +08:00
W. Trevor King 7a546ef223 apimachinery/pkg/runtime/doc: Split list into paragraphs
Godoc uses go/doc to convert comments to HTML [1], and go/doc has no
markup for lists [2].  With the previous comment, the lack of
paragraph-splitting lines between the list entries was leading to
entries 0, 1, etc. being formatted as a single paragraph.  And the
hanging indents for entry 3, etc. were leading to formatting within
<pre> blocks:

  $ curl -s https://godoc.org/k8s.io/apimachinery/pkg/runtime | grep -B1 -A7 'Your API objects'
  <p>
  0. Your API objects have a common metadata struct member, TypeMeta.
  1. Your code refers to an internal set of API objects.
  2. In a separate package, you have an external set of API objects.
  3. The external set is considered to be versioned, and no breaking
  </p>
  <pre>changes are ever made to it (fields may be added but not changed
  or removed).
  </pre>

[1]: https://godoc.org/golang.org/x/tools/cmd/godoc
[2]: https://golang.org/pkg/go/doc/#ToHTML
2018-07-17 11:08:55 -07:00
Kubernetes Submit Queue da1bb02830
Merge pull request #66078 from deads2k/client-01-list
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix fake dynamic client listing bug

The fake dynamic client used for unit testing had a bug that prevented list from working.  Added a test and fixed the fake client.

@kubernetes/sig-api-machinery-bugs 
/assign @tnozicka 

```release-note
NONE
```
2018-07-17 10:20:20 -07:00
Yann Hodique c4244a69e0 update github.com/matttproud/golang_protobuf_extensions to 1.0.1
This updates github.com/matttproud/golang_protobuf_extensions to a released
version.
There's no significant change in the code itself, and the corresponding
tests (which are not vendored) behave better with vgo (see details in #65683).
2018-07-17 09:20:07 -07:00
Kubernetes Submit Queue a74df596ab
Merge pull request #63418 from roycaihw/openapi-delete-path
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update openapi and doc to reflect 202 path in API server delete handler

**What this PR does / why we need it**:
Our API server returns 202 Accepted if a delete operation is asynchronous, but it is not reflected in our openapi spec and documentation. This PR adds 202 path in endpoint installer and updates our openapi spec and docs. The change in openapi spec may affect some clients that depend on the error paths. [Python client](e057f27306/kubernetes/client/api_client.py (L97-L102)) only depends on response type, which is not changed in this PR. Sending this PR to see if it breaks client-go. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref https://github.com/kubernetes/kubernetes/issues/33196

**Special notes for your reviewer**:

**Release note**:

```release-note
OpenAPI spec and documentation reflect 202 Accepted response path for delete request
```
2018-07-17 07:44:44 -07:00
David Eads 0aa13d7502 fill in normal restmapping info with the legacy guess 2018-07-17 09:39:44 -04:00
David Eads 60afd0ba81 fix dynamic client listing bug 2018-07-17 08:39:57 -04:00
Mikhail Mazurskiy 5cab7f9a57
Handle errors 2018-07-17 20:47:14 +10:00
Kubernetes Submit Queue 849603d5b5
Merge pull request #66263 from hzxuzhonghu/patch-misc
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove useless codec param from strategicPatchObject

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

`codec` param is not used, and was introduced in 2016.

**Release note**:

```release-note
NONE
```
2018-07-17 03:33:13 -07:00
Kubernetes Submit Queue bfba154715
Merge pull request #66256 from sigma/patch-2
Automatic merge from submit-queue (batch tested with PRs 66212, 66256, 66263, 66193). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go: fix error message spelling in rest config

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

Fixing spelling because it offends the eye.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-07-17 03:33:07 -07:00
xuzhonghu 43baa697aa remove useless codec param from strategicPatchObject 2018-07-17 11:33:53 +08:00
Yann Hodique f0ca5c1376
client-go: fix error message spelling in rest config 2018-07-16 16:00:03 -07:00
Yann Hodique f77060aa8d
client-go: update documentation for remotecommand.StreamOptions
The ability to explicitly define the supported protocols was removed in commit 12c7874c0d
Adjust documentation accordingly.
2018-07-16 14:43:54 -07:00
Jake Sanders f35e3d07c9 Escape illegal characters in remote extra keys
Signed-off-by: Jake Sanders <jsand@google.com>
2018-07-16 11:44:27 -07:00
Kubernetes Submit Queue b9bd7f2ffb
Merge pull request #66210 from foxyriver/delete-unused-var
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

splitRE is defined, but is never be referenced

**Which issue(s) this PR fixes** 

splitRE is defined, but is never be referenced

```release-note
NONE
```
2018-07-16 09:14:10 -07:00
Kubernetes Submit Queue 43b801d499
Merge pull request #66041 from liggitt/manual-registries
Automatic merge from submit-queue (batch tested with PRs 66158, 66041, 66210). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove manually written typed registries

These were only used in a handful of places, and were not consistently available for all types.

They add a lot of call sites for PRs like https://github.com/kubernetes/kubernetes/pull/65105 and are not generally useful (very few callers have the ability to construct the underlying store).

This PR switches the scale subresources to use the underlying store directly (like the status subresources already were), and removes the manually written Registry impls.

/sig api-machinery
/kind cleanup
/assign @deads2k

/hold
will hold for https://github.com/kubernetes/kubernetes/pull/65105 and rebase after that

```release-note
NONE
```
2018-07-16 09:14:06 -07:00
Kubernetes Submit Queue 4239729fc1
Merge pull request #66028 from sttts/sttts-crd-array-columns
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions-apiserver: add test for non-base type columns

Non-basic types can be converted to strings in CRD table columns. This PR adds a test.
2018-07-16 00:00:57 -07:00
Kubernetes Submit Queue 04f5200295
Merge pull request #66054 from nikhita/apiserver-readme-update-2018
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver/README: update to 2018 for compatibility

/shrug
/assign sttts 

**Release note**:

```release-note
NONE
```
2018-07-14 01:45:53 -07:00
foxyriver dabcec0e38 splitRE is never be referenced 2018-07-14 15:56:16 +08:00
Kubernetes Submit Queue 614e3adda0
Merge pull request #65737 from roycaihw/api-linter
Automatic merge from submit-queue (batch tested with PRs 64181, 65737). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

API linter framework and namesMatch API rule

**What this PR does / why we need it**:
Bump kube-openapi dependency to use the [API linter framework](https://github.com/kubernetes/kube-openapi/pull/83) in k/k OpenAPI spec generation procedure. 

Currently one API rule is enforced: 
"Go field names must be CamelCase. JSON field names must be camelCase. Other than capitalization of the initial letter, the two should almost always match. No underscores nor dashes in either."

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

**Special notes for your reviewer**:
Most code change in this PR was generated (~1700 lines). Please see commits for detail.

**Release note**:

```release-note
NONE
```

/sig api-machinery
/cc @pwittrock @mbohlool
2018-07-13 18:00:00 -07:00
Kubernetes Submit Queue 60ca804515
Merge pull request #65832 from sttts/sttts-apiserver-reusable-loopback-logic
Automatic merge from submit-queue (batch tested with PRs 65832, 66160, 66145). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: make loopback logic in SecureServingOptions reusable

For reuse in other components this PR separates the loopback logic from the GenericApiServer config.
2018-07-13 13:22:04 -07:00
Jordan Liggitt 652e2dc025
generated 2018-07-13 11:41:09 -04:00
Jordan Liggitt 617078d220
Remove hand-written typed registries 2018-07-13 11:40:52 -04:00
Jordan Liggitt 3cb771a866
Use storage directly for scale subresources 2018-07-13 11:40:52 -04:00
Dr. Stefan Schimanski 7090cd3c5f apiextensions-apiserver: add test for non-base type columns 2018-07-13 13:17:20 +02:00
Dr. Stefan Schimanski dc0a736d1e apiserver: make loopback logic in SecureServingOptions reusable 2018-07-13 13:04:57 +02:00
Dr. Stefan Schimanski 0dda53526a apiextensions-apiserver: use self-signed cert fixtures in testserver 2018-07-13 09:49:54 +02:00
Dr. Stefan Schimanski c1c564fd4d apiserver: add SecureServingOptions.ExternalAddress
Before this the advertised IP (which shows up in the server cert) in case of
listening to loopback was the first host interface IP. This makes self-signed
certs non-constant, such that we cannot use fixtures.
2018-07-13 09:49:54 +02:00
Dr. Stefan Schimanski 7deccb5b7a apiserver: use fixtures for self-signed certs in test server 2018-07-13 09:49:54 +02:00
Kubernetes Submit Queue fe8846196d
Merge pull request #65105 from apelisse/dry-run
Automatic merge from submit-queue (batch tested with PRs 65105, 62948). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

dry-run: Create Options with dryRun for POST/PUT/PATCH

**What this PR does / why we need it**:
Create new options for Create and Update (through POST/PUT/PATCH).

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-12 13:53:05 -07:00
Nikhita Raghunath 245c21b449
update generated files 2018-07-12 20:28:42 +05:30
Nikhita Raghunath d5c2649c15
apiextensions: add optional comment tags 2018-07-12 20:17:08 +05:30
Antoine Pelisse 4bfd5ec41f dry-run: Run generate commands for new Options types 2018-07-12 07:31:45 -07:00
Antoine Pelisse 03b1e14101 dry-run: Create new options for Update/Create and pass it along 2018-07-12 07:18:37 -07:00
Nikhita Raghunath 40985c3abb
apiserver/README: update to 2018 for compatibility 2018-07-12 18:33:33 +05:30
Kubernetes Submit Queue 337dfe0a9c
Merge pull request #65594 from liggitt/node-csr-addresses-2
Automatic merge from submit-queue (batch tested with PRs 65052, 65594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Derive kubelet serving certificate CSR template from node status addresses

xref https://github.com/kubernetes/features/issues/267
fixes #55633

Builds on https://github.com/kubernetes/kubernetes/pull/65587

* Makes the cloud provider authoritative when recording node status addresses
* Makes the node status addresses authoritative for the kube-apiserver determining how to speak to a kubelet (stops paying attention to the hostname label when determining how to reach a kubelet, which was only done to support kubelets < 1.5)
* Updates kubelet certificate rotation to be driven from node status
  * Avoids needing to compute node addresses a second time, and differently, in order to request serving certificates.
  * Allows the kubelet to react to changes in its status addresses by updating its serving certificate
  * Allows the kubelet to be driven by external cloud providers recording node addresses on the node status

test procedure:
```sh
# setup
export FEATURE_GATES=RotateKubeletServerCertificate=true
export KUBELET_FLAGS="--rotate-server-certificates=true --cloud-provider=external"

# cleanup from previous runs
sudo rm -fr /var/lib/kubelet/pki/

# startup
hack/local-up-cluster.sh

# wait for a node to register, verify it didn't set addresses
kubectl get nodes 
kubectl get node/127.0.0.1 -o jsonpath={.status.addresses}

# verify the kubelet server isn't available, and that it didn't populate a serving certificate
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
ls -la /var/lib/kubelet/pki

# set an address on the node
curl -X PATCH http://localhost:8080/api/v1/nodes/127.0.0.1/status \
  -H "Content-Type: application/merge-patch+json" \
  --data '{"status":{"addresses":[{"type":"Hostname","address":"localhost"}]}}'

# verify a csr was submitted with the right SAN, and approve it
kubectl describe csr
kubectl certificate approve csr-...

# verify the kubelet connection uses a cert that is properly signed and valid for the specified hostname, but NOT the IP
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
curl --cacert _output/certs/server-ca.crt -v https://127.0.0.1:10250/pods
ls -la /var/lib/kubelet/pki

# set an hostname and IP address on the node
curl -X PATCH http://localhost:8080/api/v1/nodes/127.0.0.1/status \
  -H "Content-Type: application/merge-patch+json" \
  --data '{"status":{"addresses":[{"type":"Hostname","address":"localhost"},{"type":"InternalIP","address":"127.0.0.1"}]}}'

# verify a csr was submitted with the right SAN, and approve it
kubectl describe csr
kubectl certificate approve csr-...

# verify the kubelet connection uses a cert that is properly signed and valid for the specified hostname AND IP
curl --cacert _output/certs/server-ca.crt -v https://localhost:10250/pods
curl --cacert _output/certs/server-ca.crt -v https://127.0.0.1:10250/pods
ls -la /var/lib/kubelet/pki
```

```release-note
* kubelets that specify `--cloud-provider` now only report addresses in Node status as determined by the cloud provider
* kubelet serving certificate rotation now reacts to changes in reported node addresses, and will request certificates for addresses set by an external cloud provider
```
2018-07-11 22:25:07 -07:00
Haowei Cai b4b84e023b Add Accepted to delete response path 2018-07-11 14:56:22 -07:00
Kubernetes Submit Queue 0972ce1acc
Merge pull request #65649 from rsc/fix-printf
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubernetes: fix printf format errors

These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

```release-note
NONE
```
2018-07-11 14:09:08 -07:00
Kubernetes Submit Queue 5170348431
Merge pull request #65792 from mbohlool/cleanup_c1
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove DefaultingSerializer as it is not being used

Keeping unused code around is confusing at least. The Serializer is not used as far as I can tell. If any external project is using it, they should just copy it in their code.
2018-07-11 14:09:04 -07:00
jennybuckley 702937ac86 Explicitly disable dry run for connect 2018-07-11 11:45:24 -07:00
Kubernetes Submit Queue 3a3d6564b6
Merge pull request #66047 from krunaljain/bugfix/csi_default_fs_type
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixing comments in types.go to describe the changes for CSI driver default FS type override fix

This PR fixes the comment in types.go which was made in the commit 5dfe7b5758 
In the above commit,  the change that fixed the override of default FSType for CSI driver was made. However the comments in types.go were made for   GCEPersistentDiskVolumeSource and RBDVolumeSource respectively. This commit fixes that comment to reflect the changes for CSI driver

```release-note
none
```
2018-07-10 18:45:32 -07:00
Haowei Cai 3cd919c9fb generated 2018-07-10 17:53:09 -07:00
Kubernetes Submit Queue ff9a66bd17
Merge pull request #66008 from smarterclayton/serving_test
Automatic merge from submit-queue (batch tested with PRs 66038, 65992, 66008). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Convert TestServerRunWithSNI to subtests to isolate flake

This test is flaking - make it easier to pin down where and why by
converting to subtests and making cleanup logic simpler. Also turn an
ignored listen error into a "fatal".

Make the test run in parallel to speed up individual runs and hopefully
flush out issues.

Noticed and reported in OpenShift, https://github.com/openshift/origin/issues/20220

@deads2k / @sttts
2018-07-10 17:02:07 -07:00
Krunal Jain bab7781a71 Adding generated files 2018-07-10 15:52:23 -07:00
Krunal Jain 14c7ce92b3 Fixing comments in types.go 2018-07-10 15:39:16 -07:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
Kubernetes Submit Queue 4b4408c339
Merge pull request #66033 from liggitt/x509-cleanup
Automatic merge from submit-queue (batch tested with PRs 65931, 65705, 66033). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove unused x509 code

We don't intend to use/support these user extraction methods

```release-note
NONE
```
2018-07-10 14:09:12 -07:00
Clayton Coleman 09463975c3
Convert TestServerRunWithSNI to subtests to isolate flake
This test is flaking - make it easier to pin down where and why by
converting to subtests and making cleanup logic easier. Also turn an
ignored listen error into a "fatal".

Make the test run in parallel to speed up individual runs and hopefully
flush out issues.
2018-07-10 16:07:33 -04:00
Jordan Liggitt db9d3c2d10
Derive kubelet serving certificate CSR template from node status addresses 2018-07-10 14:33:48 -04:00
Jordan Liggitt 82f603c327
Remove unused x509 code 2018-07-10 13:22:24 -04:00
Kubernetes Submit Queue 3b269e182d
Merge pull request #65499 from krunaljain/bugfix/csi_default_fs_type
Automatic merge from submit-queue (batch tested with PRs 55023, 65499). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bugfix/csi default fs type

This PR address the issue mentioned in the following ticket https://github.com/kubernetes/kubernetes/issues/65122 
The FSType string will now not be defaulted to ext4. Removes defaulting of CSI file system type to ext4. CSI plugins that depended on this default need to be updated as the fsType would remain an empty string if not provided and would not default to ext4. CSI spec allows for an empty fstype string. This is intended for non-block plugins like nfs and gluster where filesystems are not separately created on the volume. But currently the default file system is overridden to ext4  which makes the above case redundant. This commit prevents such an overridding. 


```release-note  
ACTION REQUIRED: Removes defaulting of CSI file system type to ext4. All the production drivers listed under https://kubernetes-csi.github.io/docs/Drivers.html were tested and work as expected after this change. If you are using a driver not in that list, please test the drivers on an updated test cluster first. ```
2018-07-10 10:18:08 -07:00
yue9944882 ccb1ec7a36 fixes operation for "create on update"
remove create-on-update logic for quota controller

review: add more error check

remove unused args

revert changes in patch.go

use hasUID to judge if it's a create-on-update
2018-07-10 17:22:09 +08:00
Kubernetes Submit Queue 4d609cea7f
Merge pull request #65780 from liggitt/AddFieldLabelConversionFuncGVK
Automatic merge from submit-queue (batch tested with PRs 65830, 65780, 65961). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

change field selector conversion registration to be strongly typed

the signature of these methods is misleading... they require a group-version-kind

```release-note
NONE
```
2018-07-09 09:35:06 -07:00
Kubernetes Submit Queue f6bbf1f6f8
Merge pull request #65830 from sttts/sttts-apiserver-readwrite-port
Automatic merge from submit-queue (batch tested with PRs 65830, 65780, 65961). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: get rid of ReadWritePort in config

Executing removal TODO by making the read write port logic explicit, and not hidden deep in the secure serving code.

Preparation for https://github.com/kubernetes/kubernetes/pull/65832
2018-07-09 09:35:02 -07:00
Dr. Stefan Schimanski bb8dcc3063 apiextensions-apiserver: wire through CountMetricPollPeriod for CRs 2018-07-09 17:36:32 +02:00
Kubernetes Submit Queue 0e7376d9cb
Merge pull request #64664 from atlassian/error-handling-generated-client
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Handle errors in generated client scheme

**What this PR does / why we need it**:
Adds missing error handling for schema construction code in generated clientsets.

**Which issue(s) this PR fixes**
Together with #64654 fixes #51457.

**Release note**:

```release-note
NONE
```
/kind bug
/sig api-machinery
2018-07-09 07:40:05 -07:00
Dr. Stefan Schimanski 6bb3aba23d kube-apiserver: fix tests which don't use tls yet 2018-07-09 15:01:18 +02:00
Dr. Stefan Schimanski e15ac9eb72 kube-apiserver: disallow --secure-port 0 2018-07-09 14:03:08 +02:00
Dr. Stefan Schimanski e32f380fa5 apiserver: get rid of ReadWritePort in config 2018-07-09 14:03:08 +02:00
Kubernetes Submit Queue 40806a2660
Merge pull request #65823 from loburm/fix_truncate
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix truncating and batch backends integration.

Truncating backend was not starting batch thread that is responsible for reading events from the channel.

Fixes https://github.com/kubernetes/kubernetes/pull/65819

```release-note
None
```
2018-07-09 04:28:58 -07:00
Marian Lobur 20fb0b5eb1 Fix truncating and buffering backends integration. 2018-07-09 10:25:41 +02:00
David Eads 79d04f6709 generated 2018-07-06 14:08:14 -04:00
David Eads 340802b079 name runtime.Schemes so we can see which one fails 2018-07-06 14:08:14 -04:00
David Eads d3731fe098 move CRD server unstructured typer to point of use 2018-07-06 14:08:14 -04:00
Kubernetes Submit Queue c7d4931dad
Merge pull request #65710 from sttts/sttts-unified-apiserver-testserver
Automatic merge from submit-queue (batch tested with PRs 64911, 65710). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions-apiserver: add pkg/cmd/server/testing pkg for integration tests

In analogy to kube-apiserver, this implements a uniform apiextensions-apiserver for integration tests which can be started using customized flags.
2018-07-05 11:39:03 -07:00
Kubernetes Submit Queue abf59aa8c4
Merge pull request #65834 from sttts/sttts-apiserver-no-secure-port-panic
Automatic merge from submit-queue (batch tested with PRs 65822, 65834, 65859, 65631). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: don't create self-signed certs with disabled secure serving
2018-07-05 10:16:06 -07:00
Kubernetes Submit Queue 403e22d10f
Merge pull request #65811 from nikhita/client-go-discovery-godoc
Automatic merge from submit-queue (batch tested with PRs 65805, 65811, 65833, 65488, 65857). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

client-go/discovery: fix godoc package comment

Fixes https://github.com/kubernetes/client-go/issues/436

/sig api-machinery
/kind cleanup
/shrug

/assign sttts 

**Release note**:

```release-note
NONE
```
2018-07-05 08:51:12 -07:00
Kubernetes Submit Queue 7597e952d1
Merge pull request #65805 from CaoShuFeng/retry
Automatic merge from submit-queue (batch tested with PRs 65805, 65811, 65833, 65488, 65857). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix print format string

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-05 08:51:09 -07:00
Dr. Stefan Schimanski 42f1e81488 apiextensions-apiserver: add pkg/cmd/server/testing pkg for integration bootstrapping
In analogy to kube-apiserver.
2018-07-05 17:34:16 +02:00
Dr. Stefan Schimanski 798535164a apiserver: don't create self-signed certs with disabled secure serving 2018-07-05 09:27:42 +02:00
Cao Shufeng 199a6eba88 fix print format string 2018-07-05 09:44:50 +08:00
Christoph Blecker 194c471c9c
Improve TestMergoSemantics test 2018-07-04 13:52:44 -07:00
Kubernetes Submit Queue 97a4da713b
Merge pull request #65752 from hzxuzhonghu/req-ua
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make use of request.UserAgent()

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

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

**Special notes for your reviewer**:
/assign @sttts
**Release note**:

```release-note
NONE
```
2018-07-04 13:36:42 -07:00
Christoph Blecker a1f6d24962
Move from mergo.Merge to mergo.MergeWithOverwrite 2018-07-04 12:52:01 -07:00
Kubernetes Submit Queue 692f9bb7b1
Merge pull request #65531 from qjiang77/fix_typos
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typos for TestBackoffHighWaterMark

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2018-07-04 07:33:37 -07:00
Nikhita Raghunath 5539fefd08
client-go/discovery: fix godoc package comment 2018-07-04 16:39:07 +05:30
Jordan Liggitt b7b4b84afe
Add healthz check to ensure logging is not blocked 2018-07-03 22:27:23 -04:00
Mehdy Bohlool d0e1118929 Remove DefaultingSerializer as it is not being used 2018-07-03 16:37:31 -07:00
Kubernetes Submit Queue 0e6d3f2abe
Merge pull request #65150 from jennybuckley/create-on-update-authorizer
Automatic merge from submit-queue (batch tested with PRs 65677, 65711, 65150, 65726). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Add additional authorization check for create-on-update

**What this PR does / why we need it**:
Currently it is possible for a user who is only authorized to update objects to send a PUT request for an object that doesn't currently exist, and if that resource allows create on update, it will all them to create the object. This PR fixes that bug and adds a test case which fails on master, but succeeds when the additional authorization check is done.

/sig api-machinery
/kind bug
/cc @liggitt @lavalamp 

**Release note**:
```release-note
LimitRange and Endpoints resources can be created via an update API call if the object does not already exist. When this occurs, an authorization check is now made to ensure the user making the API call is authorized to create the object. In previous releases, only an update authorization check was performed.
```
2018-07-03 16:35:11 -07:00
Tim Allclair 0a68e906ed
Cleanup apiserver errors 2018-07-03 15:26:48 -07:00
Kubernetes Submit Queue 6311a1e56f
Merge pull request #65538 from apelisse/add-mengqi-approver-strategicpatch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Mengqi to the list of approvers for strategicpatch

cc @mengqiy 
/assign @pwittrock 

Replaces #65535

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-03 14:47:27 -07:00
Christoph Blecker 12b2e2c2b5
Update github.com/imdario/mergo to v0.3.5 2018-07-03 13:32:11 -07:00
Jordan Liggitt f51ba20cdd
change field selector conversion registration to be strongly typed 2018-07-03 15:47:20 -04:00
jennybuckley cc5c17e554 Add additional authorization check for create-on-update 2018-07-03 11:20:16 -07:00
Kubernetes Submit Queue da64942ec2
Merge pull request #65357 from nikhita/crd-subresources-root-schema
Automatic merge from submit-queue (batch tested with PRs 65357, 65568). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow more fields at root of CRD schema if status is enabled

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

Currently, we allow only `properties`, `required` and `description` at the root of the CRD schema when the status subresource is enabled.

We can also include some other fields, even though sometimes they might not make sense (but they don't harm).

The main idea is that when validation schema for status is extracted as `properties["status"]`, validation for status is not lost.

**Release note**:

```release-note
More fields are allowed at the root of the CRD validation schema when the status subresource is enabled.
```
2018-07-03 03:24:00 -07:00
Mikhail Mazurskiy 0c737adf06
Run update-bazel 2018-07-03 19:28:51 +10:00
Mikhail Mazurskiy b9a94a8df4
Run code gen 2018-07-03 19:28:26 +10:00
Mikhail Mazurskiy 5cb6db95b5
Handle errors in generated client scheme 2018-07-03 19:11:48 +10:00
Kubernetes Submit Queue 036434583f
Merge pull request #65729 from cfork/comments
Automatic merge from submit-queue (batch tested with PRs 64599, 65729). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apimachinery: cleanup code and comments

fix golint issues

/kind cleanup

```release-note
NONE
```
2018-07-03 02:00:08 -07:00
Kubernetes Submit Queue 70e6fd2953
Merge pull request #64599 from hzxuzhonghu/fix-import
Automatic merge from submit-queue (batch tested with PRs 64599, 65729). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix go import

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

Fix go import introduced by #63777.

cc @lavalamp 

/assign @sttts 

**Release note**:

```release-note
NONE
```
2018-07-03 02:00:04 -07:00
xuzhonghu 82003bd9ac use request.UserAgent() 2018-07-03 16:56:15 +08:00
Kubernetes Submit Queue b770083da5
Merge pull request #65040 from CaoShuFeng/and_if
Automatic merge from submit-queue (batch tested with PRs 65040, 65731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[trivial] fix option help message.

s/andif/and if/



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 23:24:02 -07:00
Kubernetes Submit Queue fc081b5941
Merge pull request #65667 from hzxuzhonghu/patch-3
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

leader election: fix dead loop bug

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

bug fix: leader election calling apiserver without time interval. It is a dead loop.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 19:46:23 -07:00
Kubernetes Submit Queue 7dcac9d2a5
Merge pull request #65648 from sttts/sttts-k8s-metrics-codegen
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

k8s.io/metrics: normalize and fix codegen script

~~Builds on https://github.com/kubernetes/kubernetes/pull/65645. Will rebase when that one merges.~~ merged
2018-07-02 19:46:09 -07:00
Kubernetes Submit Queue 74b764224a
Merge pull request #63522 from atlassian/remove-json-int
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove int support from json patches

**What this PR does / why we need it**:
JSON only contains `int64` and `float64` types for numbers so `int` is not needed.

**Special notes for your reviewer**:
This is a follow up for https://github.com/kubernetes/kubernetes/pull/62981.

**Release note**:
```release-note
NONE
```
/sig api-machinery
/kind cleanup
/cc liggitt sttts
2018-07-02 18:19:12 -07:00
Kubernetes Submit Queue 47020f3318
Merge pull request #65094 from hzxuzhonghu/le-client-timeout
Automatic merge from submit-queue (batch tested with PRs 65094, 65533, 63522, 65694, 65702). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

set leader election client and renew timeout

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

set leader-election client timeout

set timeout for tryAcquireOrRenew

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 18:19:05 -07:00
Cong Ding 2082c71abe apimachinery: runtime: cleanup comments 2018-07-02 17:30:19 -07:00
Cong Ding 10698f8774 apimachinery: cleanup if...else statement
if block ends with a return statement, so drop this else and outdent its block
2018-07-02 17:29:56 -07:00
Cong Ding 3cd867fa6b apimachinery: runtime: cleanup code
1. variable type can be inferred from right-hand side
2. receiver names should be consistent with previous receiver names
2018-07-02 17:29:30 -07:00
Kubernetes Submit Queue dcf296a97a
Merge pull request #65154 from jennybuckley/add-update-options-3
Automatic merge from submit-queue (batch tested with PRs 65299, 65524, 65154, 65329, 65536). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Allow override of AllowCreateOnUpdate with new argument to Update

**What this PR does / why we need it**:
Changes the Update function signature to include a new bool which tells storage to override what the UpdateStrategy returns for AllowCreateOnUpdate. This is not exposed to the user, the handler is the one that sets this override value. Eventually the patch handler will set this to true, in order to provide more consistent apply behavior, without changing the existing PUT behavior.

Redo of https://github.com/kubernetes/kubernetes/pull/65075 but on master to reduce number of conflicts when we merge feature-serverside-apply with master.

/sig api-machinery
/cc @apelisse @lavalamp 

**Release note**:
```release-note
NONE
```
No release note because this is just an internal change
2018-07-02 11:06:15 -07:00
Kubernetes Submit Queue 7786bd8c9a
Merge pull request #64654 from atlassian/missing-error-handling
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add missing error handling in schema-related code

**What this PR does / why we need it**:
Adds missing error handling to a few places.

**Which issue(s) this PR fixes**
Updates #51457. Still more work to do to fix the issue - client generation code needs to be updated (addressed in https://github.com/kubernetes/kubernetes/pull/64664).

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

/kind bug
/sig api-machinery
2018-07-02 07:14:34 -07:00
Kubernetes Submit Queue 1570d3851c
Merge pull request #64741 from wgliang/master.etcd-prometheus-metics
Automatic merge from submit-queue (batch tested with PRs 64741, 65484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

enable etcdv3 client prometheus metics

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

Provide a way to enable etcdv3 client prometheus metics

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Enable etcdv3 client prometheus metics
```
2018-07-02 03:54:59 -07:00
Dr. Stefan Schimanski f6c3e5e823 Update generated files 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski 87efe61bbf bump(github.com/kubernetes/gengo): ecfcee3e19c8f1ac0e50e9b9c307626f343ce15f 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski 57036f90aa k8s.io/metrics: normalize client dir 2018-07-02 10:44:18 +02:00
Dr. Stefan Schimanski c080d2d009 k8s.io/metrics: use standard code-gen scripts 2018-07-02 10:44:18 +02:00
xuzhonghu 7a2c579409 bug fix: dead loop leaderelection 2018-07-02 15:49:39 +08:00
Zhonghu Xu 1c5a0218ed
simplify httplog.LogOf 2018-07-02 11:47:42 +08:00
Kubernetes Submit Queue a9be647e65
Merge pull request #65645 from sttts/sttts-gengo-import-aliases
Automatic merge from submit-queue (batch tested with PRs 65582, 65480, 65310, 65644, 65645). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump gengo to remove _ from generated import aliases

Pickup https://github.com/kubernetes/gengo/pull/113 and https://github.com/kubernetes/gengo/pull/111.

Avoid tons of golint exceptions for https://github.com/kubernetes/kubernetes/pull/64664.
2018-06-29 20:14:19 -07:00
xuzhonghu 90b287c12d leaderelection: set timeout for tryAcquireOrRenew 2018-06-30 10:38:53 +08:00
Kubernetes Submit Queue 16dbb95c51
Merge pull request #65390 from cfork/test
Automatic merge from submit-queue (batch tested with PRs 65518, 65624, 65380, 65390, 65586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup: remove deadcode

/kind cleanup

remove deadcode
remove unnecessary conversion

```release-note
NONE
```
2018-06-29 18:30:16 -07:00
Kubernetes Submit Queue 3e8faa22b0
Merge pull request #65518 from hzxuzhonghu/api-verbs
Automatic merge from submit-queue (batch tested with PRs 65518, 65624, 65380, 65390, 65586). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

transform ConnectMethods to kube verbs

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

/api/v1 does not list any verb for "pods/attach" and "pods/exec", this pr transform the ConnectMethods to kube verbs.

Fixes #65421

**Special notes for your reviewer**:

before this: 
```
   {
      "name": "nodes/proxy",
      "verbs": []
    },
    {
      "name": "pods/attach",
      "verbs": []
    },
    {
      "name": "pods/exec",
      "verbs": []
    },
    {
      "name": "pods/portforward",
      "verbs": []
    },
    {
      "name": "pods/proxy",
      "verbs": []
    },
    {
      "name": "services/proxy",
      "verbs": []
    },
```

after this:
```
    {
      "name": "nodes/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
    {
      "name": "pods/attach",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/exec",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/portforward",
      "verbs": [
        "create",
        "get"
      ]
    },
    {
      "name": "pods/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
    {
      "name": "services/proxy",
      "verbs": [
        "create",
        "delete",
        "get",
        "patch",
        "update"
      ]
    },
```
/assign @liggitt 

**Release note**:

```release-note
NONE
```
2018-06-29 18:30:06 -07:00
Kubernetes Submit Queue 4f465fac5b
Merge pull request #65634 from wojtek-t/fix_code_content_type
Automatic merge from submit-queue (batch tested with PRs 65319, 64513, 65474, 65601, 65634). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix apiserver metrics
2018-06-29 12:15:19 -07:00
Kubernetes Submit Queue 7b46e884ae
Merge pull request #64513 from fisherxu/useSameRv
Automatic merge from submit-queue (batch tested with PRs 65319, 64513, 65474, 65601, 65634). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use same rvParse in watchcache and move cacheStorage in separate dir

**What this PR does / why we need it**:
Use same rvParse in watchcache and move cacheStorage in separate dir.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-29 12:15:09 -07:00
Dr. Stefan Schimanski f8de7cea40 Update generated files 2018-06-29 20:36:17 +02:00
Dr. Stefan Schimanski 4e44170d72 bump(github.com/kubernetes/gengo): 5b57d243f2ca39dbbda758ee07b76b4d519f6dc7 2018-06-29 20:30:36 +02:00
jennybuckley c60fe4fb76 Propagate forceAllowCreate as false to all subresources 2018-06-29 11:28:19 -07:00
Kubernetes Submit Queue cf14f027c5
Merge pull request #65609 from CaoShuFeng/sample-controller
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix sample-controller README

The guide in doc causes an error
```
$ go run *.go -kubeconfig=$HOME/.kube/config
go run: cannot run *_test.go files (controller_test.go)
```



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-29 07:22:27 -07:00
wojtekt 3d9552cc38 Fix apiserver metrics 2018-06-29 14:15:53 +02:00
Cao Shufeng 9bb3bf2e78 fix sample-controller README
The guide in doc causes an error
```
$ go run *.go -kubeconfig=$HOME/.kube/config
go run: cannot run *_test.go files (controller_test.go)
```
2018-06-29 11:45:19 +08:00
Krunal Jain fb28a1dd28 Adding generated files 2018-06-28 16:48:53 -07:00
Krunal Jain 5dfe7b5758 Removes defaulting of CSI fsType to ext4 2018-06-28 16:48:25 -07:00
jennybuckley d10e08fc89 Allow override AllowCreateOnUpdate with new argument to Update 2018-06-28 14:24:51 -07:00
Hemant Kumar 063eee7a39 Fix comments about default mount propagation
Fix generated docs as well
2018-06-28 17:04:41 -04:00
Lubomir I. Ivanov ac5f5b4099 apiserver: do not print feature gates for glog v=0
Demand verbosity level > 0 for glog Infof() calls when
setting feature gates in pkg/util/feature_gate.go.
2018-06-28 17:10:51 +03:00
Kubernetes Submit Queue ee2e11a0d4
Merge pull request #65547 from liggitt/dial-util
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Honor custom transport dialer

https://github.com/kubernetes/kubernetes/pull/60012 updated API machinery code to use context dial functions by default, but we should still fall back to honor transport.Dial if set

* SetOldTransportDefaults should not use the default http DialContext if a custom Dial method is already set
* DialerFor should prefer DialContext, but fall back to returning a custom Dial if set before returning nil

```release-note
api-machinery utility functions `SetTransportDefaults` and `DialerFor` once again respect custom Dial functions set on transports
```
2018-06-28 03:42:17 -07:00
Kubernetes Submit Queue 41c95725b4
Merge pull request #65463 from smarterclayton/jobs_output
Automatic merge from submit-queue (batch tested with PRs 64575, 65120, 65463, 65434, 65522). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve job describe and get output

For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.

```
Start Time:     Mon, 25 Jun 2018 20:00:05 -0400
Completed At:   Mon, 25 Jun 2018 21:00:34 -0400
Duration:       60m
```

This is more useful than the current output:

```
NAME                                   DESIRED   SUCCESSFUL   AGE
image-mirror-origin-v3.10-1529982000   1         1            54m
image-mirror-origin-v3.11-1529982000   1         1            54m
image-pruner-1529971200                1         1            3h
```

```release-note
Improve the display of jobs in `kubectl get` and `kubectl describe` to emphasize progress and duration.
```
2018-06-28 02:20:20 -07:00
Kubernetes Submit Queue 75c8b56dcb
Merge pull request #64575 from immutableT/in-memory-domain-socket
Automatic merge from submit-queue (batch tested with PRs 64575, 65120, 65463, 65434, 65522). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for Linux Abstract Socket Namespace for KMS provider plugin.

**What this PR does / why we need it**:
Currently, kube-apiserver and kms-plugin interact via a Unix Domain Socket. The current implementation, assumes that such a Domain Socket is supported via a socket file, which is in turn is supported via a volume shared between kube-apiserver and kms-plugin containers.
However, Linux supports Abstract Socket Namespace, where a socket does not need to be back-up by a file. In golang, such sockets are created by prefixing a socket's name with @.

Benefits of using Linux Abstract Socket Namespace:
1. Don't need to worry about possible collisions with existing files.
2. Simpler configuration of master's manifest - no need to setup a shared volume between kube-apiserver and kms-plugin containers.
3. Don't need to remember to unlink the socket when KMS Plugin shuts down.
4. Creates a possibility to run KMS Plugin without access to file system.

This PR adds the ability to define a KMS endpoint as: unix:///@kms-provider.sock

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-28 02:20:09 -07:00
Kubernetes Submit Queue c4ca6638c3
Merge pull request #65560 from smarterclayton/print_better_type_info
Automatic merge from submit-queue (batch tested with PRs 65453, 65523, 65513, 65560). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Print type information when unknown watch error

Got

```
E0628 00:23:07.106285       1 watch.go:274] unable to encode watch object: expected pointer, but got invalid kind
```

on a production system and had no way to debug what type was being sent.

@liggitt re: the message I sent you
2018-06-27 22:30:15 -07:00
Qi Jiang 1ffe8a377d fix typos for TestBackoffHighWaterMark 2018-06-28 11:22:13 +08:00
fisherxu e0be692079 update bazel and staging-dep 2018-06-28 10:01:09 +08:00
fisherxu dbb448bbdc move cacher in separate dir 2018-06-28 10:01:09 +08:00
fisherxu 6cb344e78e resource version parsing should all be in one place 2018-06-28 10:00:56 +08:00
Clayton Coleman 307849baef
Print type information when unknown watch error
Got

```
E0628 00:23:07.106285       1 watch.go:274] unable to encode watch object: expected pointer, but got invalid kind
```

on a production system and had no way to debug what type was being sent.
2018-06-27 20:34:48 -04:00
Jordan Liggitt 51eb52cc8f
Honor custom transport dialer 2018-06-27 16:37:33 -04:00
Antoine Pelisse d53970cf30 Add Mengqi to the list of approvers for strategicpatch 2018-06-27 10:02:43 -07:00
Kubernetes Submit Queue 6d3bba7391
Merge pull request #64246 from wojtek-t/lease_object_type
Automatic merge from submit-queue (batch tested with PRs 64246, 65489, 65443). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Create "Lease" API in the new "coordination.k8s.io" api group

Part of "Efficient Node heartbeats" KEP:
https://github.com/kubernetes/community/blob/master/keps/0009-node-heartbeat.md

Part of: https://github.com/kubernetes/kubernetes/issues/14733

```release-note
NONE
```
2018-06-27 08:17:10 -07:00
wojtekt 0950084137 Autogenerated stuff 2018-06-27 13:31:10 +02:00
wojtekt f38e952f4e Add coordination API group with Lease type 2018-06-27 13:30:13 +02:00
Kubernetes Submit Queue 4d4bb53fae
Merge pull request #65486 from liggitt/diff-type
Automatic merge from submit-queue (batch tested with PRs 65507, 65508, 65486). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

show type differences in reflect diff

helps debugging type coercion round-tripping issues

/assign @smarterclayton

```release-note
NONE
```
2018-06-26 23:17:05 -07:00
xuzhonghu 8c820ae303 transform ConnectMethods to kube verbs 2018-06-27 11:15:08 +08:00
Kubernetes Submit Queue f9a1cb9b63
Merge pull request #65404 from fisherxu/collapse-rvParse
Automatic merge from submit-queue (batch tested with PRs 65404, 65323, 65468). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Collapse the list and watch resource version parse

**What this PR does / why we need it**:
Collapse the list and watch resource version parse, as discuss in [#64513](https://github.com/kubernetes/kubernetes/pull/64513#issuecomment-399380988)
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-26 17:33:01 -07:00
Jordan Liggitt 6354665ee8
show type differences in reflect diff 2018-06-26 11:30:30 -04:00
Clayton Coleman c819a16284
Improve job describe and get output
For get, condense completions and success into a single column, and
print the job duration. Use a new variant of ShortHumanDuration that
shows more significant digits, since duration matters more for jobs.

```
NAME                                   COMPLETIONS   DURATION   AGE
image-mirror-origin-v3.10-1529985600   1/1           47s        42m
image-mirror-origin-v3.11-1529985600   1/1           74s        42m
image-pruner-1529971200                1/1           60m        4h
```

The completions column can be:

```
COMPLETIONS
0/1        # completions nil or 1, succeeded 0
1/1        # completions nil or 1, succeeded 1
0/3        # completions 3, succeeded 1
1/3        # completions 3, succeeded 1
0/1 of 30  # parallelism of 30, completions is nil
```

Update describe to show the completion time and the duration.
2018-06-26 09:37:29 -04:00
Kubernetes Submit Queue 1f4f0123ed
Merge pull request #64812 from hzxuzhonghu/audit-useragent
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add user-agent to audit-logging

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

Add User-Agent to audit event.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Add user-agent to audit-logging.
```
2018-06-25 22:16:08 -07:00
Guoliang Wang 0d6c51656e enable etcdv3 client prometheus metics 2018-06-26 08:08:19 +08:00
immutablet 0100891168 Add support for linux abstract socket namespace. 2018-06-25 09:41:14 -07:00
Kubernetes Submit Queue f01eaef77f
Merge pull request #65057 from sttts/sttts-apiexitensions-coreapi
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: enable CoreAPI options needed for admission

Admission webhooks need the client and the shared informers for kube resources. The comment is invalid and we have to enable the CoreAPI options.

This PR is important to run apiextensions-apiserver in a standalone integration test setup.
2018-06-24 22:17:15 -07:00
fisherxu 68ec856b45 collapse the resource version parse 2018-06-25 10:13:32 +08:00
Nikhita Raghunath 764ae69671 client-go/examples/fake-client: add doc.go to fix go build warnings
The fakeclient package does not have any non-test go files. This
causes `go build` to give a warning: `no non-test Go files in ...`.
This also causes the publishing bot to fail.

This PR adds a dummy doc.go file in the package to avoid this warning.
2018-06-24 21:07:22 +05:30
Mikhail Mazurskiy bfe313d5f3
Add missing error handling in schema-related code 2018-06-23 21:06:32 +10:00
Kubernetes Submit Queue 21912b396c
Merge pull request #65288 from mbohlool/crd_flaky_test
Automatic merge from submit-queue (batch tested with PRs 64122, 64936, 65288, 65383). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Consume watch event for all versions of CRD

The new test code to fix flaky test were considered CRD version but failed to consume watch cache event in all versions.

Fixes #64571

@sttts @liggitt
2018-06-22 19:03:19 -07:00
Cong Ding 3bacb04a5f cleanup: remove deadcode 2018-06-22 17:46:05 -07:00
Jeff Grafton b42e9125c4 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton 347c3612c9 Set gazelle:importmap_prefix for everything under staging/src 2018-06-22 16:22:57 -07:00
Jeff Grafton 095a9e53ca Use new go_genrule from kubernetes/repo-infra based on go_path 2018-06-22 16:22:57 -07:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jeff Grafton f31183fa3d Set gazelle:prefix on staging/src and remove sed hack 2018-06-22 16:22:18 -07:00
Jeff Grafton a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Jeff Grafton 01f94051c8 Remove the go_default_library_protos filegroups using buildozer 2018-06-22 16:22:18 -07:00
Kubernetes Submit Queue 3a266a1b3f
Merge pull request #65368 from deads2k/server-17-discovery
Automatic merge from submit-queue (batch tested with PRs 61330, 64793, 64675, 65059, 65368). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

legacy api endpoints only support v1 ever

The legacy API endpoint should only ever have a v1.  This removes flexibility we don't need or want.

@kubernetes/sig-api-machinery-pr-reviews 
@sttts 

```release-note
NONE
```
2018-06-22 14:52:44 -07:00
Mehdy Bohlool 335d42165f Consume watch event for all versions of CRD 2018-06-22 11:20:15 -07:00
Kubernetes Submit Queue 456f85e736
Merge pull request #65324 from nikhita/fix-nits-json-case-sensitive
Automatic merge from submit-queue (batch tested with PRs 65339, 65343, 65324, 65335, 65367). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix k8s json package import name

Fixes nits found while cherry-picking https://github.com/kubernetes/kubernetes/pull/65034 in https://github.com/kubernetes/kubernetes/pull/65298.

**Release note**:

```release-note
NONE
```

/cc sttts liggitt caesarxuchao
2018-06-22 10:31:17 -07:00
Kubernetes Submit Queue 1308d9a380
Merge pull request #65343 from cfork/typo
Automatic merge from submit-queue (batch tested with PRs 65339, 65343, 65324, 65335, 65367). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: fix typo introduced in #57366

fix typo introduced in #57366

```release-note
NONE
```
2018-06-22 10:31:14 -07:00
David Eads b063e9f85e legacy api endpoints only support v1 ever 2018-06-22 08:58:32 -04:00
Kubernetes Submit Queue 8008c7dad9
Merge pull request #65291 from misterikkit/fake-client
Automatic merge from submit-queue (batch tested with PRs 65301, 65291, 65307, 63845, 65313). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add client-go example using fake client in test.

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

This adds an example showing the steps needed to get a working
SharedInformerFactory with a fake client for testing.


**Special notes for your reviewer**:
I had a really hard time figuring out how to use this utility correctly. I don't think this example is sufficient documentation, but it's a good start.

**Release note**:

```release-note
NONE
```
/sig api-machinery
/kind documentation
2018-06-22 03:08:10 -07:00
Nikhita Raghunath b38e1a9e42 Allow more fields at root of CRD schema if status is enabled
Currently, we allow only properties, required and description at the
root of the CRD schema when the status subresource is enabled.

We can also include some other fields, even though sometimes they
might not make sense (but they don't harm).

The main idea is that when validation schema for status is extracted
as properties["status"], validation for status is not lost.
2018-06-22 15:16:22 +05:30
Kubernetes Submit Queue ac78ec23a1
Merge pull request #64805 from hanxiaoshuai/cleanup0606
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unused code in runtime/scheme_test.go

**What this PR does / why we need it**:
remove unused code in runtime/scheme_test.go
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-21 23:47:52 -07:00
Kubernetes Submit Queue 3ab6ced72b
Merge pull request #65260 from dixudx/fix_ScaleIOVolumeSource_spec
Automatic merge from submit-queue (batch tested with PRs 65064, 65218, 65260, 65241, 64372). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix scale io volume source spec

**What this PR does / why we need it**:
> FSType 
Implicitly inferred to be "ext4" if unspecified.

Actually the default value to "xfs".

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-06-21 21:12:16 -07:00
Kubernetes Submit Queue 881b8423b9
Merge pull request #65206 from xmudrii/sample-apiserver-rbac
Automatic merge from submit-queue (batch tested with PRs 65187, 65206, 65223, 64752, 65238). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

sample-apiserver: Add RBAC roles and ClusterRoleBindings for Admission Webhooks

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

When you run the `sample-apiserver` using the [manifests provided in the artifacts directory](https://github.com/kubernetes/sample-apiserver/tree/master/artifacts/example), you will get the following errors, related to insufficient permissions to list Namespaces and Admission Webhooks:
```
E0619 07:43:06.422862       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1.Namespace: namespaces is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list namespaces at the cluster scope
E0619 07:43:06.423981       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.MutatingWebhookConfiguration: mutatingwebhookconfigurations.admissionregistration.k8s.io is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list mutatingwebhookconfigurations.admissionregistration.k8s.io at the cluster scope
E0619 07:43:07.424130       1 reflector.go:205] k8s.io/sample-apiserver/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1beta1.ValidatingWebhookConfiguration: validatingwebhookconfigurations.admissionregistration.k8s.io is forbidden: User "system:serviceaccount:wardle:apiserver" cannot list validatingwebhookconfigurations.admissionregistration.k8s.io at the cluster scope
```

This PR adds two manifests, `rbac.yaml` containing the RBAC rules, and `rbac-bind.yaml` used to bind roles to the `wardle` service account.

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

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

/assign @sttts @deads2k 
/sig api-machinery
2018-06-21 19:48:06 -07:00
xuzhonghu f0b1f1c2f6 limit User-Agent max length 1024 and add ...TRUNCATED suffix 2018-06-22 09:59:38 +08:00
Kubernetes Submit Queue 01bc75c291
Merge pull request #65199 from tallclair/maxage
Automatic merge from submit-queue (batch tested with PRs 65152, 65199, 65179, 64598, 65216). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix MaxAge default audit log option

Fix typo in flag default.

```release-note
NONE
```
2018-06-21 18:20:09 -07:00
Cong Ding 42a19a3cb8 apiserver: fix typo introduced in #57366 2018-06-21 16:45:19 -07:00
Kubernetes Submit Queue 8ba32978b7
Merge pull request #64539 from cfork/lease
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

etcd: reuse leases for keys in a time window

Reuse leases for keys in a time window, to reduce the overhead to etcd
caused by using massive number of leases

Fixes #47532

```release-note
NONE
```
2018-06-21 15:25:02 -07:00
Jonathan Basseri aed487b42d Add client-go example using fake client in test.
This adds an example showing the steps needed to get a working
SharedInformerFactory with a fake client for testing.
2018-06-21 14:18:39 -07:00
Kubernetes Submit Queue d7db405b30
Merge pull request #65099 from sttts/sttts-apiserver-auth-error-context
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiserver: add context to authn/authz kubeconfig errors

Before this the user only saw messages about in-cluster config, but didn't know which.
2018-06-21 13:59:19 -07:00
Kubernetes Submit Queue 7b53aca70d
Merge pull request #65140 from sttts/sttts-crd-update-test
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: add update to testSimpleCRUD (again?)

Did we ever have that before cleanups/refactorings?
2018-06-21 13:59:12 -07:00
Kubernetes Submit Queue ed47d75f75
Merge pull request #65116 from sttts/sttts-apiextensions-crd-example-meta-types
Automatic merge from submit-queue (batch tested with PRs 65116, 61718, 65140, 65128, 65099). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: add AddToGroupVersion call to CRD example register.go

Avoid `v1.ListOptions is not suitable for converting to ...` message in CRD client on List.

https://github.com/kubernetes/kubernetes/pull/57243 did the same for the sample-controller.
2018-06-21 13:59:05 -07:00
Kubernetes Submit Queue d371d70028
Merge pull request #65026 from spew/fix-poll-immediate-docs
Automatic merge from submit-queue (batch tested with PRs 65265, 64822, 65026, 65019, 65077). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Correct several mistakes in the comments/doc for PollImmediate.

**What this PR does / why we need it**:
The wait.PollImmediate(...) docs refer to the Poll(...) function by mistake which is confusing. This PR fixes that issue.

**Release note**:

```release-note
Corrected a mistake in the documentation for wait.PollImmediate(...)
```
2018-06-21 11:25:13 -07:00
Kubernetes Submit Queue 418a0e6c29
Merge pull request #65265 from sttts/sttts-sample-apiserver-pkg
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

staging-repos: add note that these are to be imported as k8s/*

Fixes https://github.com/kubernetes/sample-controller/issues/17
Fixes https://github.com/kubernetes/sample-controller/issues/20
2018-06-21 11:13:50 -07:00
Nikhita Raghunath 0623068f6c Fix k8s json package import name 2018-06-21 22:55:17 +05:30
Cong Ding 163529bc20 etcd: reuse leases for keys in a time window
Reuse leases for keys in a time window, to reduce the overhead to etcd
caused by using massive number of leases

Fixes #47532
2018-06-21 10:17:48 -07:00
Kubernetes Submit Queue 9d97913e75
Merge pull request #65027 from liggitt/etcd-health-check
Automatic merge from submit-queue (batch tested with PRs 64140, 64898, 65022, 65037, 65027). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use actual etcd client for /healthz/etcd checks

* avoids redialing etcd on every health check (which makes slow DNS a false-positive healthz failure)
* ensures etcd TLS setup is correct (errors verifying the etcd API or sending client credentials manifest as healthz failures)
* ensures the etcd cluster is actually responsive

fixes #64909

```release-note
Etcd health checks by the apiserver now ensure the apiserver can connect to and exercise the etcd API
```
2018-06-21 05:40:24 -07:00
Kubernetes Submit Queue d1f5cb2348
Merge pull request #65050 from sttts/sttts-deepcopy-update
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Bump gengo to include uniform pointer deepcopy

This bumps k8s.io/gengo with uniform pointer support in deepcopy-gen.

Fixes https://github.com/kubernetes/code-generator/issues/45.
2018-06-21 04:15:16 -07:00
Kubernetes Submit Queue 8850871891
Merge pull request #63700 from zjj2wry/leaderelection
Automatic merge from submit-queue (batch tested with PRs 64895, 64938, 63700, 65050, 64957). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

enhance leaderelection code

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-21 04:15:13 -07:00
Dr. Stefan Schimanski 943405d3d2 sample-apiserver: add note that the pkg is k8s.io/sample-apiserver 2018-06-21 12:53:12 +02:00
Kubernetes Submit Queue 83ad4d9e96
Merge pull request #65001 from liggitt/quiet-logs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Quiet verbose apiserver logs

In our production environments, these three lines accounted for ~10 logged lines per second at --v=2

Something that verbose per-request should be at a higher verbosity log level

/cc @eparis
/sig api-machinery
2018-06-21 02:38:19 -07:00
Kubernetes Submit Queue 56a2d2f578
Merge pull request #64883 from liggitt/legacy-printer
Automatic merge from submit-queue (batch tested with PRs 64285, 63660, 63661, 63662, 64883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix up legacy printer table adapter

As server-side printing is more widespread, downstream consumers will start leaning on this adapter to transform client-side printers to server-side printers.

This PR:
* Set the name format correctly on column 0
* Tolerates case-differences in the column 0 name (many old printers used NAME)
* Set ListMeta continue/resourceVersion/selfLink correctly when adapting a legacy printer

/cc @smarterclayton 

```release-note
NONE
```
2018-06-21 01:19:30 -07:00
Kubernetes Submit Queue 1a75395da8
Merge pull request #63668 from atlassian/jsoniter-error-handling
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Report parsing error in json serializer

**What this PR does / why we need it**:
Fixes missing error reporting in json parsing using the json-iterator library. Also introduces a private copy of the library config to partially shield from external mutations. https://github.com/json-iterator/go/issues/265. 

**Special notes for your reviewer**:
Found while working on refactoring in https://github.com/kubernetes/kubernetes/pull/63284.

**Release note**:
```release-note
NONE
```
/kind bug
/sig api-machinery
/cc wojtek-t liggitt
2018-06-20 21:21:35 -07:00
Kubernetes Submit Queue 571b9beac5
Merge pull request #57932 from atlassian/cancellable-leader-election
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Cancellable leader election

**What this PR does / why we need it**:
Adds ability to cancel leader election. Useful in integration tests where the whole app is started and stopped in each test.

**Special notes for your reviewer**:
I used the `context` package - it is impossible/hard to achieve the same behaviour with just channels without spawning additional goroutines but it is trivial with `context`. See `acquire()` and `renew()` methods.

**Release note**:

```release-note
NONE
```
/kind enhancement
/sig api-machinery
2018-06-20 17:22:22 -07:00
Kubernetes Submit Queue ed6c8b7326
Merge pull request #65256 from liggitt/crd-schema-openapi
Automatic merge from submit-queue (batch tested with PRs 65256, 64236, 64919, 64879, 57932). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix CRD OpenAPI schema

fixes #65243
depends on https://github.com/kubernetes/kube-openapi/pull/84

without this PR, kubectl complains about creating this CRD with a validation schema (which worked in 1.10):
```yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: resources.mygroup.example.com
spec:
  group: mygroup.example.com
  version: v1alpha1
  scope: Namespaced
  names:
    plural: resources
    singular: resource
    kind: Kind
    listKind: KindList
  validation:
    openAPIV3Schema:
      properties:
        spec:
          type: array
          items:
            type: number
```

> error: error validating "/Users/jliggitt/projects/snippets/crd/crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): unknown field "type" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "Schema" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray, ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.items): missing required field "JSONSchemas" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray]; if you choose to ignore these errors, turn validation off with --validate=false

that is because the types used to serialize JSONSchema require custom marshaling/unmarshaling, and the OpenAPI generator was not informed of that, so it produced this:
```json
{
    "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray": {
    "description": "JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.",
    "required": [
     "Schema",
     "JSONSchemas"
    ],
    "properties": {
     "JSONSchemas": {
      "type": "array",
      "items": {
       "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
      }
     },
     "Schema": {
      "$ref": "#/definitions/io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"
     }
    }
   }
}
```

OpenAPI isn't able to represent oneOf/anyOf types correctly currently. Until it can, we definitely shouldn't publish a schema containing required fields which aren't even part of the JSON serialization. This PR implements custom openapi type functions, which omit the properties/required/schema attributes for four specific JSONSchema types. This allows kubectl to continue creating these objects without complaining.

/sig api-machinery
/assign @sttts

```release-note
fixed incorrect OpenAPI schema for CustomResourceDefinition objects
```
2018-06-20 17:22:08 -07:00
Kubernetes Submit Queue 1a061a7d3f
Merge pull request #64915 from sttts/sttts-getownerrefs-no-deepcopy
Automatic merge from submit-queue (batch tested with PRs 58690, 64773, 64880, 64915, 64831). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apimachinery: unify accessors to not deepcopy

The Get/SetOwnerReferences accessor funcs do deepcopies, in contrast to all other accessor funcs of metav1.ObjectMeta. For unstructured.Unstructured we naturally do deepcopies. 

In other words: the interface does guarantee neither the first nor the second. 

This PR documents this and remove the unneccessary deepcopy for owner references (which leads to huge heap allocation e.g. in the DaemonSet controller).

This is for post-1.11. **do not assign a milestone**.

```dev-release-note
The metav1.ObjectMeta accessor does not deepcopy owner references anymore. In general, the accessor interface does not enforce deepcopy nor does it forbid it (e.g. for unstructured.Unstructured).
```
2018-06-20 14:21:21 -07:00
Jordan Liggitt f78230881c
stop returning invalid json fields in CRD OpenAPI schemas 2018-06-20 16:22:20 -04:00
Jordan Liggitt 102bc90120
bump(k8s.io/kube-openapi): 91cfa479c814065e420cee7ed227db0f63a5854e 2018-06-20 16:20:27 -04:00
Kubernetes Submit Queue 02c7325eb9
Merge pull request #60626 from nikhita/quota-01-remove-todo
Automatic merge from submit-queue (batch tested with PRs 64882, 64692, 64389, 60626, 64840). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[minor] apimachinery: remove note for quota serialization

Fixes #53503 

We are way ahead of 1.5 now.

**Release note**:

```release-note
NONE
```

/cc sttts
2018-06-20 10:03:32 -07:00
Kubernetes Submit Queue f637a259ea
Merge pull request #63625 from liggitt/discovery-cleanup-2
Automatic merge from submit-queue (batch tested with PRs 64416, 63625, 60967, 64767, 64588). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Collapse memcached discovery client onto parallelized discovery method

```release-note
NONE
```
2018-06-20 07:12:18 -07:00
Kubernetes Submit Queue b309d18a48
Merge pull request #64506 from wgliang/master.simple-string
Automatic merge from submit-queue (batch tested with PRs 64688, 64451, 64504, 64506, 56358). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

replace fmt.Sprintf(%s, i.Type()) with i.Type().String()

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

replace fmt.Sprintf(%s, i.Type()) with i.Type().String()


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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-20 05:48:19 -07:00
Cao Shufeng 162499515c fix a TODO in ValidatingAdmissionWebhook 2018-06-20 18:32:33 +08:00
Kubernetes Submit Queue 27c327cd33
Merge pull request #64100 from JacobTanenbaum/InstallPathHandler-tests
Automatic merge from submit-queue (batch tested with PRs 63580, 63744, 64541, 64502, 64100). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve unit tests for InstallPathHandler()

When adding InstallPathHandler it was suggested to follow-up with an improvement to the unit tests. deads2k suggested that the testing for InstallPathHandler() follow closer to what is already implemented for InstallHandler(). 



**What this PR does / why we need it**:
Increases the testing around new functionality InstallPathHandler

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-20 01:32:41 -07:00
Kubernetes Submit Queue d0a2bfd22e
Merge pull request #64548 from hzxuzhonghu/patch-1
Automatic merge from submit-queue (batch tested with PRs 64142, 64426, 62910, 63942, 64548). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove inaccurate comment about watch timeout

when watch timeout, the tcp connection does not close, it is reused for another new watch.
But this makes users misunderstanding.

**Release note**:

```release-note
NONE
```
2018-06-20 00:05:22 -07:00
Di Xu 871673f51b auto-generated files 2018-06-20 13:34:50 +08:00
Kubernetes Submit Queue 6559b98f64
Merge pull request #64163 from JacobTanenbaum/LoopbackHostPort
Automatic merge from submit-queue (batch tested with PRs 64252, 64307, 64163, 64378, 64179). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Modify LoopbackHostPort() so it returns an IPv6 Loopback address when given [::] 

Currently when LoopbackHostPort() is called with 0.0.0.0 and [::] it returns the first loopback
address returned from net.InterfaceAddrs() which is typically 127.0.0.1 (golang does not
specify an order that interfaces are returned). It would be more appropriate if when calling
LoopbackHostPort() with [::] that an IPv6 loopback address is returned, this prevents some cert.
generation failures.



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-19 21:45:14 -07:00
Di Xu bb1a9f511f add default value to ScaleIOVolumeSource spec 2018-06-20 11:26:41 +08:00
Marko Mudrinić 33d31e4a55
sample-apiserver: Add RBAC roles and ClusterRoleBindings for Admission Webhooks 2018-06-19 10:16:13 +02:00
Tim Allclair 3dae49c697
Fix MaxAge default audit log option 2018-06-18 14:37:37 -07:00
Dr. Stefan Schimanski 927d1b1045 apiextensions: expect IsNotFound errors for disabled versions in testSimpleCRUD 2018-06-18 17:24:42 +02:00
Dr. Stefan Schimanski 1daa99029b apiextensions: add update to testSimpleCRUD (again?) 2018-06-18 17:24:13 +02:00
Mikhail Mazurskiy b76e512f8f
Report parsing error in json serializer 2018-06-18 21:46:17 +10:00
Kubernetes Submit Queue a12cade52c
Merge pull request #64796 from mbohlool/crd_versioning_crd_test
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CRD Test: Fix resource creation/deletion for multi-version CRDs

During CRD testing setup, a setup instance CRD is created and watched to make sure the watch cache is prime. The deletion watch event for this instance can result in test failure for any watch test as they expect exact watch events. Previous code did not take multiple versioned CRDs into account. This change will make sure we wait for deletion for all versions before continue with any test.

@sttts @liggitt 

Fixes #64571
2018-06-15 14:22:07 -07:00
Kubernetes Submit Queue 32003df3fb
Merge pull request #65092 from sttts/sttts-crd-registry-objectmeta-deepcopy
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

apiextensions: fix concurrent map access copying items' ObjectMeta in UnstructuredList

The list endpoint sets the self-link. If we do not create a (shallow) copy of ObjectMeta this will mutate the cached objects.

Background: native objects like PodList have a `Items []Pod` field which implicitly shallow-copies ObjectMeta. UnstructuredList only shallow-copies Unstructured, but shares all the JSON data including ObjectMeta, i.e. the Object pointer points to the value in the cache.

Fixes https://github.com/kubernetes/kubernetes/issues/59478
2018-06-15 11:39:35 -07:00
Jordan Liggitt 486f42d2a4
decode crd objectmeta properly 2018-06-15 09:42:52 -04:00
Dr. Stefan Schimanski cd10f28ac1 apiextensions: fix concurrent map access copying items' ObjectMeta in Unstructured
The list+get endpoints sets the self-link. If we do not create a (shallow)
copy of ObjectMeta this will mutate the cached objects.
2018-06-15 15:17:25 +02:00
Mehdy Bohlool 602ddef158 Fix check for CRD watch priming 2018-06-14 16:14:51 -07:00
Kubernetes Submit Queue a2de1398f8
Merge pull request #65034 from caesarxuchao/json-case-sensitive
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make kubernetes json serializer case sensitive

This PR imported the latest jsoniterator library so that case sensitivity during unmarhsaling is optional. The PR also set Kubernetes json serializer to be case sensitive.

Kubernetes json serializer had been case sensitive for 1.1-1.7 as we were using ugorji. This PR restores the behavior.

Fix #64612.

```release-notes
Kubernetes json deserializer is now case-sensitive as it was before 1.8.
If your config files contains fields with wrong case, the config files will be now invalid.
```
2018-06-14 15:41:26 -07:00
Dr. Stefan Schimanski 9dfa97c595 apiextensions: add AddToGroupVersion call to CRD example register.go
Avoid `v1.ListOptions is not suitable for converting to ...` message in CRD client on List.
2018-06-14 22:32:35 +02:00
Chao Xu 7b0ffb8410 make json serializer case sensitive 2018-06-14 12:29:27 -07:00
Chao Xu dd69be30a5 vendor the latest json-iterator 2018-06-14 12:29:27 -07:00
Dr. Stefan Schimanski 99eda24de0 apiserver: add context to authn/authz kubeconfig errors 2018-06-14 15:31:02 +02:00
Andrew Lytvynov 2c0f043957 Re-use private key after failed CSR
If we create a new key on each CSR, if CSR fails the next attempt will
create a new one instead of reusing previous CSR.

If approver/signer don't handle CSRs as quickly as new nodes come up,
they can pile up and approver would keep handling old abandoned CSRs and
Nodes would keep timing out on startup.
2018-06-13 13:12:43 -07:00
Dr. Stefan Schimanski 1c67e1dcf3 apiextensions: enable CoreAPI options needed for admission 2018-06-13 16:40:20 +02:00
Dr. Stefan Schimanski 1208437f84 Update generated files 2018-06-13 12:35:13 +02:00
Dr. Stefan Schimanski d1bff9f8f4 bump(k8s.io/gengo): dcbe4570f0cf6efbc583a5321c8f9390f71a544d 2018-06-13 12:35:13 +02:00
xuzhonghu a8b0ccc70c add ut for audit useragent 2018-06-13 17:35:41 +08:00
Jordan Liggitt b39cd00982
Use actual etcd client for /healthz/etcd checks 2018-06-12 22:17:39 -04:00
Cao Shufeng 42b93ab724 [trivial] fix option help message.
s/andif/and if/
2018-06-13 09:07:34 +08:00
Rob Leidle 6ce74e4548 Correct several mistakes in the comments/doc for PollImmediate. 2018-06-12 11:21:26 -07:00
Jordan Liggitt 862f8567bb
Quiet verbose apiserver logs 2018-06-11 22:32:46 -04:00
Dmitry Rozhkov 4a72e17bd2 fix field removal in mutating admission webhooks
A mutating admission controller webhook doesn't remove object fields
when instructed to.

E.g. when the JSON patch

  [
    {"op": "remove", "path": "/spec/containers/0/resources/limits/fpga-arria10"},
    {"op": "add", "path": "/spec/containers/0/resources/limits/fpga-interface-id-524abcf", "value": 1}
  ]

is applied to this pod

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  restartPolicy: Never
  containers:
    -
      name: test-pod-container
      image: ubuntu:bionic
      imagePullPolicy: IfNotPresent
      command: [ "ls", "-l", "/" ]
      resources:
        limits:
          fpga-arria10: 1

in order to replace the resource name "fpga-arria10" with something understandable
by the device plugin the resulting pod spec still contains the old field plus
a new one. The resulting pod looks like

apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  restartPolicy: Never
  containers:
    -
      name: test-pod-container
      image: ubuntu:bionic
      imagePullPolicy: IfNotPresent
      command: [ "ls", "-l", "/" ]
      resources:
        limits:
          fpga-arria10: 1
          fpga-interface-id-524abcf: 1

The patch unmarshals patched JSON into a new empty object instead of
existing one. Otherwise JSON unmarshaling reuses existing maps, keeping
existing entries as specified in the "encoding/json" standard package.
2018-06-11 12:22:31 +03:00
xuzhonghu b5990b78cb auto gen 2018-06-09 10:29:46 +08:00
Dr. Stefan Schimanski f0aca942c6 apimachinery: unify accessors to not deepcopy 2018-06-08 14:04:57 +02:00