Commit Graph

1103 Commits

Author SHA1 Message Date
David Eads
77541e5cb7 add subresource support for the dynamic client
Kubernetes-commit: 82e32d2a3260807237a69bc40fb371db640d26fc
2018-05-09 12:52:12 -04:00
Kubernetes Publisher
b4efb2d46b Merge pull request #59727 from wgliang/master.time
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>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:

Kubernetes-commit: 7eb88f11d23d2be7dc3a91f727a1a77a0abac5e8
2018-05-11 14:29:34 +00:00
Kubernetes Publisher
cf2db96347 Merge pull request #63613 from deads2k/cli-52-builderclient
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>.

 construct resource.Builder from kubeconfig flags

updates the resource.Builder to be constructed from the kubeconfig flags struct/interface that we now have.

@kubernetes/sig-cli-maintainers
@juanvallejo @soltysh

```release-note
NONE
```

Kubernetes-commit: 7e75a09db6dc13218b4f5e06493115ae96f83774
2018-05-10 18:29:26 +00:00
Kubernetes Publisher
b2243688f8 Merge pull request #60200 from dixudx/clientgo_openstack_config
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>.

read openstack auth config from client config

**What this PR does / why we need it**:
> // TODO: read/persist client configuration(OS_XXX env vars) in config

/sig openstack

**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 @dims
**Release note**:

```release-note
read openstack auth config from client config
```

Kubernetes-commit: 9dcbdc3d459ec6b2bb149a9f4f3c0d1348113e4a
2018-05-10 18:29:03 +00:00
Kubernetes Publisher
638bb430f4 Merge pull request #61976 from atlassian/ticker-with-stop
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>.

Stop() for Ticker to enable leak-free code

**What this PR does / why we need it**:
I wanted to use the clock package but the `Ticker` without a `Stop()` method is a deal breaker for me.

**Release note**:
```release-note
NONE
```
/kind enhancement
/sig api-machinery

Kubernetes-commit: d42df4561a6c754120e9b46b37c032a57ca92a9a
2018-05-10 06:27:21 +00:00
Kubernetes Publisher
9cabba1998 Merge pull request #63602 from deads2k/cli-54-categories
Automatic merge from submit-queue (batch tested with PRs 59284, 63602). 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>.

 category expansion can only come from the server

A couple release ago we moved category expansion to the server instead of hardcoding it in the client.  Similar to restmappings, there is no valid client-side expansion anymore, so this removes the code that hardcoded the list and moves the category expansion to the same package as our discovery based restmappers.

@kubernetes/sig-cli-maintainers

```release-note
NONE
```

Kubernetes-commit: ca92b73a659bf92c3051765a6ea5bc8c12069975
2018-05-09 22:27:11 +00:00
Kubernetes Publisher
de3c9b6cf8 Merge pull request #63502 from liggitt/parallel-discovery
Automatic merge from submit-queue (batch tested with PRs 62354, 62934, 63502). 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>.

Run resource discovery in parallel

best viewed ignoring whitespace (https://github.com/kubernetes/kubernetes/pull/63502/files?w=1)

on high-latency connections, serializing resource discovery requests across group versions can take significant amounts of time. this parallelizes the network request portion of the discovery call

xref #63368

```release-note
NONE
```

Kubernetes-commit: 234939dced42952045fc2a42b74a805affcff965
2018-05-09 18:27:48 +00: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
David Eads
3fb1070233 construct resource.Builder from kubeconfig flags
Kubernetes-commit: 1f5357034b4a8ef4ed68f0c2415e280601968e91
2018-05-09 13:53:07 -04:00
David Eads
37c8d52754 category expansion can only come from the server
Kubernetes-commit: ad87219b2cba1d22ac2a808568da7322775972ae
2018-05-09 11:12:32 -04:00
David Eads
0c30aacc9d move category expansion types to restmapper package
Kubernetes-commit: 37f6cb723017edb46117d64d70c827a2d8c93b59
2018-05-09 11:01:49 -04: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
Jordan Liggitt
334b50415a Run resource discovery in parallel
Kubernetes-commit: d037b0893fa9313b9b5b111c22d49bf3c859a9d1
2018-05-07 15:54:25 -04: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