Automatic merge from submit-queue
Fix yet another bug in OpenAPI extension generation
A comment extension for a type is ignored if the type already has extensions (e.g. GVK).
Automatic merge from submit-queue (batch tested with PRs 45364, 45369, 45323)
Fix namespace deletion log in e2e test framework.
**What this PR does / why we need it**:
Current log message for namespace deletion will show under wrong condition.
**Which issue this PR fixes**
**Release note**:
NONE
Automatic merge from submit-queue (batch tested with PRs 45364, 45369, 45323)
kubeadm: edit apiserver flags for storage-backend
**What this PR does / why we need it**: Since storage-backend defaults to etcd3 in 1.6 (see https://github.com/kubernetes/kubernetes/pull/36229), no need to have a flag defining the default.
**Special notes for your reviewer**: /cc @luxas
**Release note**:
```release-note
NONE
```
Automatic merge from submit-queue
[Federation] Record events in federated updater
Controllers for federated types were previously recording events when generating the list of operations. This change delegates responsibility for recording events to the federated updater so that events are recorded when the operations are actually executed, and ensures consistency across recording of both operation initiation and failure.
The deletion helper was similarly updated to rely on the federated updater for event recording. To support this change to the deletion helper, controllers have been updated to provide a namespace qualified name via the objNameFunc function to ensure that the updater can record events for deletions with the same detail as for add and update operations.
cc: @kubernetes/sig-federation-pr-reviews @perotinus
Automatic merge from submit-queue (batch tested with PRs 45309, 45376)
kubeadm: Fix the tainting of the master node
**What this PR does / why we need it**:
Currently, kubeadm unintentionally removes Taints set with the kubelet flag `--register-with-taints` when creating a new Taint slice instead of appening the existing one. This PR fixes that behavior.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
**Special notes for your reviewer**:
This should be a cherrypick candidate for v1.6 cc @enisoc
**Release note**:
```release-note
kubeadm: Fix invalid assign statement so it is possible to register the master kubelet with other initial Taints
```
@jbeda @dmmcquay @mikedanese @krousey PTAL, very straightforward PR
Automatic merge from submit-queue (batch tested with PRs 45309, 45376)
Allow passing --enable-kubernetes-alpha to GKE e2e tests
**What this PR does / why we need it**:
This allows us to pass --enable-kubernetes-alpha when running GKE e2e tests.
**Release note**:
```
NONE
```
@dchen1107
Automatic merge from submit-queue
De-flaking E2E: PersistentVolumes[Disruptive] - restart kubelet via service manager CLI
Current process for restarting the kubelet accesses `/etc/init.d/kubelet`, which is not a common path across OSes. This PR changes the behavior of `kubeletCommand()` to instead attempt restarting the kubelet service through the system manager CLI. It first attempts a systemd call, then falls back to sysVinit. If neither calls work, the test exits.
This PR _does not_ remove `[Flaky]`. Right now, the test fails consistently in the gci-gce-flaky suite. After merge, I'll monitor the test grid for ~week. If no flakes appear, I'll submit a pr to pull the Flaky tag off.
Additional Changes
- Improved error messages
- Cleanup on failure in `initTestCase`
Fixes#44933
**Release note**:
```release-note
NONE
```
Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238)
expose kubelet authentication and authorization builders
The kubelet authentication and authorization builder methods are useful for consumers.
@liggitt
Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238)
Remove redundent GetObjectKind() defined on types
Embedding TypeMeta is enough.
Automatic merge from submit-queue (batch tested with PRs 45362, 45159, 45321, 45238)
Remove the use of registry in fake clientset
Addressing https://github.com/kubernetes/kubernetes/pull/42095#issuecomment-298136406
The fake clientset needed registry for multiple reasons, and this PR removed these needs:
1. translate GroupVersionResource to GroupVersionKind, the internal `tracker` (a fake apiserver) stores the objects in a map and the key is gvk. This PR changes the map key to be gvr.
2. client-go/testing/fixture.go had a function `checkNamespaced`, which used the registry as the ground truth to verify if the request send by client is properly namespace scoped. Every unit test that used the generated fake clientset would eventually call this function to verify the request sent by the fake clietnset. Such a check is useless, this PR removed `checkNamespaced` completely.
3. When the `tracker` reacted to a fake List request, it asked the registry to translate GVR to GVK, and created a list of type `GVK+"List"`. This PR lets the ListActionImpl specify the GVK explicitly to get rid of the need of the GVR to GVK translation.
(the first commit is #45180)
Automatic merge from submit-queue
federation: Fix federated service deletion in kubectl tests
A copy-paste mistake happened and was overlooked in PR #45265. fixing it now.
**Release note**:
```
NONE
```
cc @nikhiljindal @kubernetes/sig-federation-bugs
Automatic merge from submit-queue
remove useless code in kubelet
**What this PR does / why we need it**:
This code has logical error as the etc-hosts file will be recreated even it already exists. In addition, if do not recreate etc-hosts file when it exists, the pod ip in it will be out of date when pod ips change. So remove this code as it is not needed.
**Which issue this PR fixes**:
**Special notes for your reviewer**:
xrefer: #44481, #44473
**Release note**:
```release-note
NONE
```
Automatic merge from submit-queue
use our own serve mux that directs how we want
alternative to https://github.com/kubernetes/kubernetes/pull/44405
I really wanted to avoid writing my own, but the gorilla mux works via redirect, which would be a change. This does exact pattern matches only unless someone explicitly requests a prefix match.
@liggitt happier?
Automatic merge from submit-queue (batch tested with PRs 45316, 45341)
Move hollow-node's initContainer from annotation to field
In 1.6, we have moved init containers spec from beta annotation to field. Updating this in kubemark hollow-node.
This should solve issues with setting of default fields (like ImagePullPolicy) in the container spec for older versions of apiservers too (as annotation->field change has been cherry picked for older releases too). We noticed this issue in https://github.com/kubernetes/kubernetes/issues/45290 where an old apiserver apparently wasn't setting default ImagePullPolicy for container spec inside annotations.
cc @wojtek-t @gmarek @gamename
Automatic merge from submit-queue (batch tested with PRs 45316, 45341)
Pass NoOpLegacyHost to dockershim in --experimental-dockershim mode
This allows dockershim to use network plugins, if needed.
/cc @Random-Liu
Automatic merge from submit-queue
Deployment e2e fixes
* don't expect availability on Deployment creations
* switch to framework.Logf everywhere for consistency
* better use of Expect
Automatic merge from submit-queue (batch tested with PRs 45285, 45162)
mounter.go: format return err.
**What this PR does / why we need it**:
when an error returned is nil, it's preferred to explicitly return nil.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
**Special notes for your reviewer**:
**Release note**:
```release-note
NONE
```
Automatic merge from submit-queue
use of --local should completely eliminate communication with API server
This PR is a bug fix for #45223
It allows --local flag to completely avoid communication with api server.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
fixes#45223
This is a simple change, to set the value of boolean flag "local" on o.Local variable
Automatic merge from submit-queue
[WIP] Skip resize of nf_conntrack/parameters/hashsize if not necessary
**What this PR does / why we need it**:
Linux does not support writing to `/sys/module/nf_conntrack/parameters/hashsize` when the writer process is not in the initial network namespace
(https://github.com/torvalds/linux/blob/v4.10/net/netfilter/nf_conntrack_core.c#L1795-L1796).
Usually that's fine. But in some configurations such as with https://github.com/kinvolk/kubeadm-nspawn, kube-proxy is in another netns.
Therefore, check if writing in hashsize is necessary and skip the writing if not.
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
**Special notes for your reviewer**:
**Release note**:
```release-note
```
Automatic merge from submit-queue
Adding note on how to use datastore cluster for volume provisioning
**What this PR does / why we need it**:
Recently https://github.com/kubernetes/kubernetes/pull/44868 is merged which allows using datastore cluster for static and dynamic PVs.
Sample is required in the Read me file to help user, how they can specify path in the yaml for datastore within cluster.
**Which issue this PR fixes**
fixes # https://github.com/vmware/kubernetes/issues/129
**Special notes for your reviewer**:
@BaluDontu @tusharnt
**Release note**:
```release-note
NONE
```