Commit Graph

101 Commits

Author SHA1 Message Date
halfcrazy
b6a34c5a00 fix typo in client-go
Kubernetes-commit: 86801dee64215e76080fe8df83ffd1fb7df9e093
2018-02-01 02:33:45 +08:00
Jeff Grafton
fe985a55a2 Autogenerate BUILD files
Kubernetes-commit: efee0704c60a2ee3049268a41535aaee7f661f6c
2017-12-23 13:06:26 -08:00
David Xia
f17d6594e8 examples: Make messages more informative
by including pod name and namespace

Kubernetes-commit: f344f50fca28e79ac67e25527b1add9bf418f957
2017-12-08 14:25:46 -06:00
John Kelly
d6f3ab164c client-go: fix err scope in CRUD example
This fixes some scope isses that were introduced by shadowing vars inside anonymous functions as well as using a naked return.
Fixed by using unique err names and explicitly returning errors.
Additional improvement is using the HomeDir() util function provided by client-go instead of including a helper function at the bottom of this example.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: e71c9f1b4beb06bcd3694163e6bf1764fb49edd6
2017-10-08 13:28:22 -04:00
John Kelly
ddf6c35ca5 client-go: use retry util in CRUD example
This updates the create-update-delete-deployment example with the following:
Make use of client-go retry util in Update() steps instead of simple for loops.
Using RetryOnConflict is generally better practice as it won't become stuck in a retry loop and uses exponential backoff to prevent exhausting the apiserver.
Instead of changing annotations to demonstrate Updates/Rollbacks, change the container image as it is less confusing for readers and a better real-world example.
Improve comments and README to reflect above changes.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: 94f5bcf6f77d5b35074dfab47b5de37096d8ee00
2017-10-05 19:07:57 -04:00
John Kelly
4e80b27156 client-go: Update CRUD example
This updates the create-update-delete-deployment example with the following:
Add rollback step to demonstrate rolling back deployments with client-go.
Modify the for-loops used in both Update steps to Get() the latest version
of the Deployment from the server before attempting Update().
This is necessary because the object returned by Create() does
not have the new resourceVersion, causing the initial Update() to always fail
due to conflicting resource versions. Putting the Get() at the top of the
loop seems to fix this bug.
Make -kubeconfig flag optional if config is in default location, using the
same method found in the out-of-cluster example.

Patch is motivated by effort to improve client-go examples.

Signed-off-by: John Kelly <jekohk@gmail.com>

Kubernetes-commit: ce73088a718c30d8a3577f5d0521584b9c201e69
2017-10-04 18:01:49 -04:00
Jeff Grafton
c92755ea3b update BUILD files
Kubernetes-commit: aee5f457dbfd70c2d15c33e392dce6a3ca710116
2017-10-12 13:52:10 -07:00
Jeff Grafton
5da217e5c4 Use buildozer to delete licenses() rules except under third_party/
Kubernetes-commit: a7f49c906df816123e7d4ccbd4cebab411519465
2017-08-29 12:51:55 +00:00
Jeff Grafton
fa2ceb7462 Use buildozer to remove deprecated automanaged tags
Kubernetes-commit: 33276f06be5e872bf53ca62a095fcf0a6b6c11a8
2017-08-29 12:51:55 +00:00
Jeff Grafton
f921a73942 Run hack/update-bazel.sh to generate BUILD files
Kubernetes-commit: 3579017b865ddbc5449d6bba87346f086e4b93ff
2017-08-29 12:50:17 +00:00
supereagle
24f566f085 use the core client with version
Kubernetes-commit: edce96c5b6bd4cee6ae6c05934e5078b0920d143
2017-07-29 13:45:46 +00:00
Dr. Stefan Schimanski
847cceef55 client-go: remove TPR example
Kubernetes-commit: b34464241d61941b4331727fdca8927b574de25b
2017-07-16 03:58:41 +00:00
Nikhita Raghunath
5b6f5174d8 Update CR example in client-go
Remove custom-resources directory from client-go

Add TPR example back

Mention CRD is successor to TPR

Kubernetes-commit: bfa9ce4308ca897711eb1b822bd5f0e31bbef31d
2017-06-28 00:06:45 +00:00
Chao Xu
8fa00ce039 run hack/update-all
Kubernetes-commit: 60604f8818aecbc9c3736fbc32747cc0a535bc80
2017-06-28 00:06:44 +00:00
Chao Xu
d82cfb70dd run hack/update-staging-client-go, somehow we copied listers/<authn,authz,imagepolicy>
Kubernetes-commit: ffe74d1fe749b5887711f70af24e1375856f2520
2017-06-28 00:06:44 +00:00
Chao Xu
1e9caa8e14 run root-rewrite-import-client-go-api-types
Kubernetes-commit: f2d3220a11111f86b2f481e70e3c1ca4f5896f44
2017-06-28 00:06:44 +00:00
Nikhita Raghunath
9476066ae2 Fix typo in cross-repo link
Kubernetes-commit: 731a1ccb44f5d7f0ffb6d52550b0a735f92e85fb
2017-06-28 00:06:44 +00:00
Marc Sluiter
83b93de35a run update-bazel.sh
Kubernetes-commit: 92ac232790afefad522016f76b48dbb697a8e0f7
2017-06-20 17:28:45 +00:00
Marc Sluiter
6620bd1af9 Added namespace and better pod name in client go example
Kubernetes-commit: a71bb87ec714276264282197c99bbd3f86fd7b55
2017-06-20 17:28:45 +00:00
Marc Sluiter
ecd7406c9f Updated error handling example based on PR feedback
Kubernetes-commit: 601ab10dbd08debca4b8a835f8dea00a26666060
2017-06-20 17:28:45 +00:00
Marc Sluiter
2c59aca317 Added example for status errors in go client
Kubernetes-commit: 8ca1732023621063d1c91205cdf0efa4b03b5a30
2017-06-20 17:28:45 +00:00
Dr. Stefan Schimanski
7e76c26781 Fix cross-repo link
Kubernetes-commit: 2aa87e4fee7f78b2e567111835c9e14505cf3892
2017-06-17 22:03:57 +00:00
Ahmet Alp Balkan
6df6f2148a clientgo/examples: add ToC for examples
Also add authenticate- prefix to auth samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: 62d1251874cb259d38d727300ac4b2646c4122c8
2017-06-16 22:03:56 +00:00
Dr. Stefan Schimanski
99b01357a0 client-go: deprecate TPR example and add CRD example
Kubernetes-commit: e2b50ac9b817dfb49c146b9423d1ee9a5da97cb2
2017-06-13 20:38:48 +00:00
Christoph Blecker
a8d18952cb Update docs/ URLs to point to proper locations
Kubernetes-commit: 1bdc7a29aee051ccef4bb21dcd9d43ee47b2a5d8
2017-06-13 20:38:47 +00:00
Ahmet Alp Balkan
11c69ac127 clientgo/examples/out-of-cluster: add instructions
Adding instructions for out-of-cluster example and making it work without
specifying the -kubeconfig argument if the home directory can be inferred.

This is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: e59f05fe0ee6980c4bdaae76f5a77ef884bd2da1
2017-06-13 20:38:46 +00:00
Ahmet Alp Balkan
8787fb55e2 client-go: Add CRUD Deployment sample
This sample adds sample code for create/list/replace/delete operations for
Deployment resource for client-go library. This patch also contains
documentation explaining what the example application does and how it can be
executed.

This patch is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: d75710f9f4d2e74979f6da07de31b02fae0392b0
2017-06-13 20:38:46 +00:00
Steven E. Harris
a5e25d7218 Remove redundant third-party type registration
Since NewSchemeBuilder registers the supplied Scheme transformation
functions synchronously, there's no need for a subsequent call
to (*SchemeBuilder).Register against the same instance.

Kubernetes-commit: 3a8e44bda80f74d674bf2df0b87cb4562a3587a0
2017-06-13 20:38:44 +00:00
Steven E. Harris
87c960d69b Copyedit third-party resource registration example
Kubernetes-commit: fe3ca9a6eba9b39a305b8cdffc2fbc7a66b812da
2017-06-13 20:38:44 +00:00
Ahmet Alp Balkan
8efad6dbf0 clientgo/examples/in-cluster: add instructions to run the example
This patch adds instructions for how to run the in-cluster client-go example.
To make this example executable, providing a Dockerfile and build steps so
that it can directly be run on minikube.

This is part of the body of work improving the client library samples.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>

Kubernetes-commit: 8604ed6d9906ebfb33206b55467db41c87e9f148
2017-06-13 20:38:43 +00:00
Dr. Stefan Schimanski
bdefb3c11a Update generated files
Kubernetes-commit: b498019f2f7aebe1c0e5c0d7a825069e25650fc6
2017-05-12 17:21:59 +00:00
Dr. Stefan Schimanski
a46cb79cf4 client-go tpr example: round trip external tpr types
Kubernetes-commit: fb2298de18eee7cb3d677143d3dd2cfde440aa6a
2017-05-12 17:21:59 +00:00
Nail Islamov
8d49905c48 ThirdPartyResource client-go example: added TPR controller example, code cleanup and integration test
Kubernetes-commit: a6c97715ed7e24581dd9a02a256d57e56b70ac44
2017-05-12 17:21:59 +00:00
Chao Xu
384737846d bazel
Kubernetes-commit: 958903509c29fdfe216c0bbf0abce1ce0abd59a6
2017-04-28 20:28:26 +00:00
Chao Xu
cf012f20d0 easy changes
Kubernetes-commit: 3fa7b7824abbf3daec1189b118b91b5bb726958f
2017-04-28 20:28:25 +00:00
Roman Mohr
3e24501bb6 client-go workqueue example
Demonstrates how to compose a controller out of cache.Controller,
cache.Indexer and a workqueue.

Kubernetes-commit: b39b3ba01675828c13bc0dea67d5114b4c225644
2017-04-21 20:28:22 +00:00
Mike Danese
9a45999fa0 autogenerated
Kubernetes-commit: a05c3c0efdc5822049e34b1a5a1ee259c5fb1906
2017-04-15 20:28:18 +00:00
Dr. Stefan Schimanski
5cca8d5380 hack/verify-staging-imports.sh: check that plugins are not imported by default
Kubernetes-commit: 792d1f3dc0bd45ab63c59cfee298bfc4b898a914
2017-04-12 20:28:20 +00:00
Chao Xu
c04eceb596 adding note about examples only work with the code in the same branch 2017-03-06 22:30:23 -08:00
Chao Xu
088dc4a30d manually sync with k8s.io/kubernetest at 17375fc59fff39135af63bd1750bb07c36ef873b, k8s.io/apimachinery at d90aa2c8531f13b0ca734845934c10dcb6a56ca7 2017-02-23 12:27:32 -08:00
Kubernetes Publisher
7ac1236194 published by bot
(https://github.com/kubernetes/test-infra/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is ab794c612853e6c6dfda63594cb5d74914e7e151
2017-02-03 22:09:57 +00:00
Daniel Smith
b7db396afa Fix examples that don't build 2017-02-01 16:28:36 -08:00
Chao Xu
b8fd850e88 fix thirdparty example 2016-12-14 11:52:08 -08:00
Daisuke Fujita
b51b7defab Make third-party example buildable 2016-11-15 10:47:29 +09:00
Daisuke Fujita
e60355686b Make in-cluster example buildable 2016-11-15 10:43:26 +09:00
Daisuke Fujita
d83a7abb0c Make out-of-cluster example buildable 2016-11-15 10:42:44 +09:00
Will Farrington
d6263b114f
Add README 2016-11-04 15:21:23 -04:00
Will Farrington
6fb6707824
Add an example for standard CRUD operations with ThirdPartyResources 2016-11-04 14:50:22 -04:00
Chao Xu
19897ef4d2 add back examples 2016-10-21 12:16:47 -07:00
Kubernetes Publisher
75399f68c8 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is e56cfc5322138aa23e6418ee30a6ab54c7c6fe8c
2016-10-21 04:44:19 +00:00
Kubernetes Publisher
3ccba384d5 published by bot
copied from https://github.com/kubernetes/kubernetes.git
last commit is f6eb28765f85dcd9e0b3b6c094605e7fff779e42
2016-09-01 12:54:21 +00:00