Commit Graph

1090 Commits

Author SHA1 Message Date
Jordan Liggitt
334b50415a Run resource discovery in parallel
Kubernetes-commit: d037b0893fa9313b9b5b111c22d49bf3c859a9d1
2018-05-07 15:54:25 -04:00
Kubernetes Publisher
62c4633c17 Merge pull request #63565 from roycaihw/bump-kube-openapi-dep
Automatic merge from submit-queue (batch tested with PRs 59034, 63565, 63533). 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 kube-openapi dependency

picks: https://github.com/kubernetes/kube-openapi/pull/67
ref: https://github.com/kubernetes/kubernetes/issues/63494

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 3663dc757e05fb79f23a14ad4f2ba832d6e5962c
2018-05-09 18:27:28 +00:00
Kubernetes Publisher
9124a4f71a Merge pull request #63364 from deads2k/api-16-scheme
Automatic merge from submit-queue (batch tested with PRs 63364, 63464). 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>.

simplify api registration

The current registration and groupmeta is only use to determine a preferred ordering to versions.  The scheme already knows about all versions, so this simply makes that knowledge official.  After doing that, the announce, registered, and apimachinery/pkg/apimachinery all drop out.

With this change we'll be able to create `install` packages for each external apigroup that accept a scheme and have suggested orderings.  This will make it possible to close the consistency gap with kubectl, client, and apiserver.

@kubernetes/sig-api-machinery-pr-reviews
@lavalamp @smarterclayton @liggitt @sttts

```release-note
NONE
```

Kubernetes-commit: f929502282b370ceb3adae4816074142d6702c8b
2018-05-09 02:27:12 +00:00
Kubernetes Publisher
c7b9128fb6 Merge pull request #63507 from deads2k/cli-50-tidyup
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). 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 client based restmappers to client-go

Moves the client-based restmappers to client-go where everyone who needs them can have access.

```release-note
the shortcuts which were moved server-side in at least 1.9 have been removed from being hardcoded in kubectl
```

@kubernetes/sig-cli-maintainers @kubernetes/sig-api-machinery-pr-reviews

Kubernetes-commit: c27335fe3e75ef3d680dc5f470b16764564dc3b5
2018-05-09 02:26:50 +00:00
Kubernetes Publisher
e06cc6501b Merge pull request #60445 from oracle/for/upstream/master/60444
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). 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 fake client generation for non-namespaced subresources

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

Fixes code generation for non-namespaced subresources fake clients.

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

**Special notes for your reviewer**:

**Release note**:

```dev-release-note
Fixes fake client generation for non-namespaced subresources
```

/cc @mfojtik @liggitt

I'm not sure the best way to add tests for this. Any pointers?

Kubernetes-commit: 8203d35ea830b02a542c3099e302d58344a86305
2018-05-09 02:26:50 +00:00
Haowei Cai
7a2dcd71b0 generated
Kubernetes-commit: 18fd392c1358fccdac0905e29ae957b2ddcd213a
2018-05-08 17:27:17 -07:00
David Eads
1c9ae1b2ac move client based restmappers to client-go
Kubernetes-commit: dd97a7bc59c913c71730dba8b8de274820466417
2018-05-07 15:41:13 -04:00
Kubernetes Publisher
8296aa1708 Merge pull request #61154 from hanxiaoshuai/bugfix0314
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>.

catch err when Watch testResource failed in func TestWatchCallNonNamespace

**What this PR does / why we need it**:
catch err when Watch testResource failed in func TestWatchCallNonNamespace
**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 #
[#61155](https://github.com/kubernetes/kubernetes/issues/61155)
**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

Kubernetes-commit: 89542d9ec97febf16d14319002d1b164a823bb8b
2018-05-07 14:28:00 +00:00
David Eads
6174473dce simplify api registration
Kubernetes-commit: c5445d3c56e06ab366b9cca34bd69c5cc386ec47
2018-05-07 08:32:20 -04:00
David Eads
5c71aff0f3 generated
Kubernetes-commit: 7b4f97aca3f47aed1161a20636a1a078a63c9fd9
2018-05-07 08:32:03 -04:00
Kubernetes Publisher
bf62f5b7d6 Merge pull request #63421 from liggitt/discover-completions
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>.

Cache preferred resources, use in kubectl resource name autocomplete

Fixes #63145
Fixes https://github.com/kubernetes/kubectl/issues/357
Alternative to #61928

* starts to unify preferred resource logic on top of ServerGroups()/ServerResourcesForGroupVersion() methods
* allows indicating a cached list of resources is acceptable when calling `kubectl api-resources` (default is still to rediscover)
* uses `kubectl api-resources` in bash completion

```sh
$ kubectl get [TAB][TAB]
apiservices.apiregistration.k8s.io                            networkpolicies.extensions
certificatesigningrequests.certificates.k8s.io                networkpolicies.networking.k8s.io
clusterrolebindings.rbac.authorization.k8s.io                 nodes
clusterroles.rbac.authorization.k8s.io                        persistentvolumeclaims
componentstatuses                                             persistentvolumes
configmaps                                                    poddisruptionbudgets.policy
controllerrevisions.apps                                      pods
cronjobs.batch                                                podsecuritypolicies.extensions
customresourcedefinitions.apiextensions.k8s.io                podsecuritypolicies.policy
daemonsets.apps                                               podtemplates
daemonsets.extensions                                         replicasets.apps
deployments.apps                                              replicasets.extensions
deployments.extensions                                        replicationcontrollers
endpoints                                                     resourcequotas
events                                                        rolebindings.rbac.authorization.k8s.io
events.events.k8s.io                                          roles.rbac.authorization.k8s.io
horizontalpodautoscalers.autoscaling                          secrets
ingresses.extensions                                          serviceaccounts
initializerconfigurations.admissionregistration.k8s.io        services
jobs.batch                                                    statefulsets.apps
limitranges                                                   storageclasses.storage.k8s.io
mutatingwebhookconfigurations.admissionregistration.k8s.io    validatingwebhookconfigurations.admissionregistration.k8s.io
namespaces                                                    volumeattachments.storage.k8s.io
```

```release-note
NONE
```

Kubernetes-commit: 068b7befa926d376634c79cbba3d210c1dc596fe
2018-05-04 18:28:09 +00:00
Kubernetes Publisher
998a5ff4b9 Merge pull request #63405 from dims/update-to-latest-gophercloud-may-3-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>.

Update to latest Gophercloud

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

periodic update to latest gophercloud. The changes are as follows:
6da026c32e...781450b3c4

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

Kubernetes-commit: bc56947e8dd89d70735384239c4e5d0c2c9fe8eb
2018-05-04 18:27:44 +00:00
Jordan Liggitt
46ab86af26 Make ServerPreferred[Namespaced]Resources logic and caches consistent
Kubernetes-commit: 74b7cec0c6b1355615097be4068500761a9893fd
2018-05-03 23:34:09 -04:00
Kubernetes Publisher
7e5a9c2cb4 Merge pull request #63346 from roycaihw/bump-kube-openapi
Automatic merge from submit-queue (batch tested with PRs 61455, 63346, 63130, 63404). 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 kube-openapi dependency

**What this PR does / why we need it**:
Pick up https://github.com/kubernetes/kube-openapi/pull/64

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/sig api-machinery
/cc @mbohlool @liggitt

Kubernetes-commit: 89e6895e1c550658b7c145436868b70fb3cabbcd
2018-05-04 02:27:28 +00:00
Davanum Srinivas
d17062c637 Update to latest Gophercloud
6da026c32e...781450b3c4

Kubernetes-commit: ddfcf1e193b573db17097e88201d717ac9ac1630
2018-05-03 15:47:58 -04:00
Haowei Cai
835de9289c Bump kube-openapi dependency
Kubernetes-commit: 212814a0c6625d9359afbdbfa50f8e187e59fc0e
2018-05-01 17:33:27 -07:00
Kubernetes Publisher
01d6a1350d Merge pull request #63253 from deads2k/client-05-dynamic-update
Automatic merge from submit-queue (batch tested with PRs 63152, 63253). 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 dynamic client slightly easier to use and add fakes

Tweaks the dynamic client to make it more "normal" for resources to namespaces.  Adds a fake dynamic client.

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

```release-note
NONE
```

Kubernetes-commit: 8e99d621e95c38d6e773a631c7179915ed952a2f
2018-05-01 18:26:48 +00:00
Kubernetes Publisher
e26238c324 Merge pull request #63238 from CaoShuFeng/toCurl
Automatic merge from submit-queue (batch tested with PRs 63153, 63238). 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 curl header

partially reverts kubernetes/kubernetes#60925

such command cause a 406 status code from api-server
```
curl   -H "Accept: 'application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json'"
```

this works fine:
```
curl  -H "Accept: application/json;as=Table;v=v1beta1;g=meta.k8s.io, application/json"
```

**Release note**:
```
NONE
```

Kubernetes-commit: a8a963c98396ef8b5cd08911d0d4d7edbfff78fd
2018-04-28 14:26:14 +00:00
Kubernetes Publisher
8b5d933521 Merge pull request #63169 from smarterclayton/limit_dependencies
Automatic merge from submit-queue (batch tested with PRs 63251, 59166, 63250, 63180, 63169). 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>.

Break a generic package dependency to core/api/v1

It is not necessary for this package to depend on core/v1.

Kubernetes-commit: 625bce3ff6be2753cd9d27ef5fc2051cf2a45f85
2018-04-28 14:25:55 +00:00
Kubernetes Publisher
9e6dfd5187 Merge pull request #63203 from deads2k/api-07-versioninterface
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 versioning interface

Builds on prior restmapping/converter separation to completely remove the versioning interface which isn't needed.

intersection of @kubernetes/sig-api-machinery-pr-reviews and @kubernetes/sig-cli-maintainers  again

```release-note
NONE
```

Kubernetes-commit: 6b9cf21d9f23fa596db19f0f7981fbb7261fc2b6
2018-04-28 14:25:54 +00:00
Kubernetes Publisher
3fd815dfa7 Merge pull request #63189 from hzxuzhonghu/master
Automatic merge from submit-queue (batch tested with PRs 61804, 63189). 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 simple dynamic client instead of deprecated client pool

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

Use simple dynamic client through all integration test.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

Kubernetes-commit: b75d6464c8f04d5526ab633e75675f1c728f8606
2018-04-28 14:25:54 +00:00
Cao Shufeng
f71f3da0d1 fix curl header
Kubernetes-commit: 084eb9b42906736002c285ac88c0dfcfbfb87a63
2018-04-27 15:56:03 +08:00
xuzhonghu
2b0acf6f5a fix bug in dynamicResourceClient.UpdateStatus should encode
Kubernetes-commit: 9e8ce9535d9ce46791304e4ea3d1694e09b9ae9f
2018-04-27 14:07:11 +08:00
David Eads
1f41b75933 add fake dynamic client
Kubernetes-commit: 121b698492fcf546c9264b27d086b18d915c607f
2018-04-26 15:36:07 -04:00
David Eads
7757aaeb14 make dynamic client slightly easier to use
Kubernetes-commit: 5ff923c7f931a34632df1f5a5400adbec33d49bf
2018-04-27 11:29:05 -04:00
Kubernetes Publisher
e18ef65b0f Merge pull request #63063 from feiskyer/azure-new-sdk
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 Azure Go SDK to stable version

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

Kubernetes is using a beta version of Azure Go SDK now. If there are bugs in them, it's hard to upgrade because Azure Go SDK won't release new patches for pre-released SDK versions. We should upgrade Go SDK to stable version (e.g. v14.6.0)

Refer #62249

Refer Azure/azure-sdk-for-go#1586

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

**Special notes for your reviewer**:

This PR includes changes in #61972, but with a newer go-autorest version.

**Release note**:

```release-note
Upgrade Azure Go SDK to stable version (v14.6.0)
```

Kubernetes-commit: cc845246e4afe82271d4f8160badbe11f4c7a929
2018-04-26 06:27:42 +00:00
Kubernetes Publisher
34472877d4 Merge pull request #62805 from awly/take-reviews
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 awly as reviewer in several subtrees

```release-note
NONE
```

Kubernetes-commit: 9e52d14eb9db297523ec5541a1131856a498f518
2018-04-26 06:27:22 +00:00
Kubernetes Publisher
f0d1126290 Merge pull request #63059 from ceshihao/upgrade_json_package_fix_base64_newline
Automatic merge from submit-queue (batch tested with PRs 59965, 59115, 63076, 63059). 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 dep json-iterator/go to fix base64 decode bug

**What this PR does / why we need it**:
upgrade dep `json-iterator/go` to fix base64 decode bug #62742

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

**Special notes for your reviewer**:
Just upgrade `json-iterator/go` to latest which includes base64 decode fix https://github.com/json-iterator/go/pull/266
No other code changes

**Release note**:

```release-note
None
```

Kubernetes-commit: 3dbcd1ddcee786f443f89a82514bbd9c6ad06c99
2018-04-26 06:27:21 +00:00
Clayton Coleman
a6f5cf653e restclient should not depend on api/core/v1
Kubernetes-commit: 847edc0e27054f1bf7771ba8d412b10bfd533f90
2018-04-25 18:51:38 -04:00
Kubernetes Publisher
95a2d0bcbb Merge pull request #63075 from deads2k/api-05-eliminate-indirection
Automatic merge from submit-queue (batch tested with PRs 62982, 63075, 63067, 62877, 63141). 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>.

eliminate indirection from type registration

Some years back there was a partial attempt to revamp api type registration, but the effort was never completed and this was before we started splitting schemes. With separate schemes, the idea of partial registration no longer makes sense.  This pull starts removing cruft from the registration process and pulls out a layer of indirection that isn't needed.

@kubernetes/sig-api-machinery-pr-reviews
@lavalamp @cheftako @sttts @smarterclayton

Rebase cost is fairly high, so I'd like to avoid this lingering.

/assign @sttts
/assign @cheftako

```release-note
NONE
```

Kubernetes-commit: 97287177ee2b603f13f1028ef7f053f4795351f7
2018-04-25 22:27:25 +00:00
Clayton Coleman
7130d1acc2 client-go should not take a dependency on the v1 api lightly
These constants will never change, and tools/ should not be depending on
core/api/v1 (there is nothing v1 specific about them).

Kubernetes-commit: aa9fd2bf11ae6be922b5b0fe45f5254c40366b2e
2018-04-25 18:02:30 -04:00
Kubernetes Publisher
82253abe83 Merge pull request #62913 from deads2k/client-04-dynamic
Automatic merge from submit-queue (batch tested with PRs 63137, 62913). 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 a simple dynamic client that is easy to use

The dynamic client has annoyed me for the last time!  The existing one takes arguments at odd levels, requires lots of information to instantiate, does some weird pool thing, and uses unusual types.  This creates an interface like this:

```go

type DynamicInterface interface {
	ClusterResource(resource schema.GroupVersionResource) DynamicResourceInterface
	NamespacedResource(resource schema.GroupVersionResource, namespace string) DynamicResourceInterface
}

type DynamicResourceInterface interface {
	Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Update(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	UpdateStatus(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Delete(name string, options *metav1.DeleteOptions) error
	DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
	Get(name string, options metav1.GetOptions) (*unstructured.Unstructured, error)
	List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*unstructured.Unstructured, error)
}
```

You create it from just a `rest.Config`, no mapper, no path resolving func, no trying to set up codecs ahead of time, no unnecessary pool.  It just works.

I updated the namespace controller to use it and I updated the existing dynamic client to leverage it so that I get all their tests for "free".

@kubernetes/sig-api-machinery-pr-reviews
@liggitt @smarterclayton @bparees @sttts @ironcladlou I know each of us has struggled with the dynamic client in our time.
@lavalamp @caesarxuchao This is vastly simplifying.  I'm eager to drop the old `ClientPool`.  client-go will technically have another incompatible semver this release.  I'm up for changing it in tree.

```release-note
client-go developers: the new dynamic client is easier to use and the old is deprecated, you must switch.
```

Kubernetes-commit: 5d7569d6649777ef999fc37c480276cdb830dbd4
2018-04-25 18:27:09 +00:00
ceshihao
cfcdaaea85 runhack/update-staging-godeps.sh
Kubernetes-commit: 3fde7d6844c540439d30eb356ef0a12af23bd50f
2018-04-25 16:11:21 +00:00
David Eads
7205c0679a remove versioning interface
Kubernetes-commit: e2fc5cf259463f896213afdef15d58ef9a91eb35
2018-04-25 10:55:17 -04:00
Kubernetes Publisher
3df37beef0 Merge pull request #63086 from soltysh/discovery_timeout
Automatic merge from submit-queue (batch tested with PRs 63129, 63066, 60009, 63136, 63086). 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 discovery default timeout test

/assign @sttts

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

Kubernetes-commit: a53df4d90565d9adc8352758c99d7aa0d0624394
2018-04-25 14:27:25 +00:00
Kubernetes Publisher
d36be08adf Merge pull request #63010 from deads2k/api-04-metadataaccessor
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 confusing flexibility for metadata interpretation

Metadata accessors are coded in.  This means that we don't need to inject flexibility, the flexibility is already present based on what your code relies up.  This removes the per-individual resource injection which simplifies all calling code.

intersection of @kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cli-maintainers

```release-note
NONE
```

Kubernetes-commit: 6fbca94faec5d21630d076853e5f883b4a630412
2018-04-25 10:27:26 +00:00
David Eads
2e1683e1a1 add easy to use dynamic client
Kubernetes-commit: 3632037e600d82a954c05ecd4f9cb6f1ca93d41c
2018-04-24 13:41:40 -04:00
Maciej Szulik
581437501a Fix discovery default timeout test
Kubernetes-commit: af2353f8a3ab06ca105d15a0b1b27605e4093da5
2018-04-24 17:05:56 +02:00
David Eads
f849531fe2 eliminate indirection from type registration
Kubernetes-commit: e7fbbe0e3c91f34836b999e695aa133503cfdae5
2018-04-24 08:21:23 -04:00
Pengfei Ni
e6f1c09a62 Update vendors for client-go
Kubernetes-commit: 058b619040c469dcbe5d92bdaa8da975d23f141d
2018-04-24 14:42:06 +08:00
Kubernetes Publisher
3631461fc7 Merge pull request #62152 from smarterclayton/use_client_store
Automatic merge from submit-queue (batch tested with PRs 63001, 62152, 61950). 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>.

When bootstrapping a client cert, store it with other client certs

The kubelet uses two different locations to store certificates on
initial bootstrap and then on subsequent rotation:

* bootstrap: certDir/kubelet-client.(crt|key)
* rotation:  certDir/kubelet-client-(DATE|current).pem

Bootstrap also creates an initial node.kubeconfig that points to the
certs. Unfortunately, with short rotation the node.kubeconfig then
becomes out of date because it points to the initial cert/key, not the
rotated cert key.

Alter the bootstrap code to store client certs exactly as if they would
be rotated (using the same cert Store code), and reference the PEM file
containing cert/key from node.kubeconfig, which is supported by kubectl
and other Go tooling. This ensures that the node.kubeconfig continues to
be valid past the first expiration.

Example:

```
bootstrap:
  writes to certDir/kubelet-client-DATE.pem and symlinks to certDir/kubelet-client-current.pem
  writes node.kubeconfig pointing to certDir/kubelet-client-current.pem
rotation:
  writes to certDir/kubelet-client-DATE.pem and symlinks to certDir/kubelet-client-current.pem
```

This will also allow us to remove the wierd "init store with bootstrap cert" stuff, although I'd prefer to do that in a follow up.

@mikedanese @liggitt as per discussion on Slack today

```release-note
The `--bootstrap-kubeconfig` argument to Kubelet previously created the first bootstrap client credentials in the certificates directory as `kubelet-client.key` and `kubelet-client.crt`.  Subsequent certificates created by cert rotation were created in a combined PEM file that was atomically rotated as `kubelet-client-DATE.pem` in that directory, which meant clients relying on the `node.kubeconfig` generated by bootstrapping would never use a rotated cert.  The initial bootstrap certificate is now generated into the cert directory as a PEM file and symlinked to `kubelet-client-current.pem` so that the generated kubeconfig remains valid after rotation.
```

Kubernetes-commit: 939c0783e191a940d009399f7d6d00251feb025a
2018-04-23 22:27:04 +00:00
David Eads
c726896549 remove confusing flexibility for metadata interpretation
Kubernetes-commit: 0710f72c65ad23e7a3726b345898ef4aaaac26fa
2018-04-23 10:23:01 -04:00
Kubernetes Publisher
7455e67b76 Merge pull request #62649 from liggitt/loopback-routing
Automatic merge from submit-queue (batch tested with PRs 50899, 62649). 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 webhook service routing resolves kubernetes.default.svc correctly

Going through the normal endpoint resolve path isn't correct in multi-master scenarios

The auth wrapper is pulling from LoopbackClientConfig, the service resolver should do the same

```release-note
Fixes the kubernetes.default.svc loopback service resolution to use a loopback configuration.
```

Kubernetes-commit: 9c25da64f0f302f69fb14af486bc181cce22293b
2018-04-21 02:25:56 +00:00
Kubernetes Publisher
f123460f11 Merge pull request #62733 from soltysh/discovery_timeout
Automatic merge from submit-queue (batch tested with PRs 62876, 62733, 62827). 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 a default request timeout for discovery client

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1546117

Adds a default request timeout to requests made by the discovery client.
This prevents a command from hanging indefinitely due to one or multiple calls
to the apiserver taking longer than usual when when a --request-timeout flag value
has not been set.

/assign @deads2k @juanvallejo

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

Kubernetes-commit: 6da4355ad543411fcfef8320f4fbbc3d47bb0302
2018-04-21 02:25:36 +00:00
Kubernetes Publisher
58bdd5cade Merge pull request #60709 from deads2k/client-02-fake-copy
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>.

deep copy fake client actions to avoid accidental mutation

I just got bit by this downstream.  Without a deep copy it is possible accidentally mutate the thing you created, thus invalidating your testing.  It's particularly nasty inside of a controller doing a loop on objects, making refs to them, and creating.  This works running in an actual process since we serialize and write, but fails unit tests since there is no serialization step.

@kubernetes/sig-api-machinery-bugs

```release-note
NONE
```

Kubernetes-commit: bfae47ad87807a6361e655f3620cbf2d9f2d6226
2018-04-20 18:26:01 +00:00
Kubernetes Publisher
467c17c87a Merge pull request #62412 from bhcleek/go1.10
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>.

generated code should pass go vet for go1.10

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

Update code generator and the code it generates to pass `go vet`.

go1.10 runs `go vet` whenever `go test` is run. Because of this, generated code for CRDs needs to pass `go vet`.

**Release note**:

```release-note
Code generated for CRDs now passes `go vet`.
```

Kubernetes-commit: 5dde701b876d1d0915314c3ed146e986c4327f7e
2018-04-20 14:26:06 +00:00
Kubernetes Publisher
9b46f3224a Merge pull request #62583 from vantuvt/testify_update
Automatic merge from submit-queue (batch tested with PRs 62726, 60085, 62583). 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 github.com/stretchr/testify to v1.2.1

cd $GOPATH/src/k8s.io/kubernetes
hack/godep-restore.sh
rm -rf Godeps
rm -rf vendor
hack/godep-save.sh

**What this PR does / why we need it**:
v1.2.1 of Testify includes new functions (e.g., ElementsMatch) that make it easier to compare data structures such as slices.

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

```

Kubernetes-commit: 4761788b2afa42a4573a6794902eb93fe666d5c5
2018-04-19 18:26:37 +00:00
Billie Cleek
2468a89fde regenerate fakes
Kubernetes-commit: 95ad9009c33a664bfbc3f2a9836148f9efbde851
2018-04-18 16:09:36 -07:00
Andrew Lytvynov
f99e02d6b7 Add awly as reviewer in several subtrees
Kubernetes-commit: ff85d34d4e815ced406a9442fb9966b947dd0638
2018-04-18 12:22:04 -07:00
Kubernetes Publisher
c75e967654 Merge pull request #59317 from CaoShuFeng/assert_Equal
Automatic merge from submit-queue (batch tested with PRs 62448, 59317, 59947, 62418, 62352). 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 assert.Equal argument order

Reference:
https://godoc.org/github.com/stretchr/testify/assert#Equal

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

Kubernetes-commit: 60141cdfd919f608da9e7d1083f9831694ba540f
2018-04-18 02:25:39 +00:00