Commit Graph

9 Commits

Author SHA1 Message Date
Patrick Ohly
70a4950f35 remove import doc comments
The "// import <path>" comment has been superseded by Go modules.
We don't have to remove them, but doing so has some advantages:

- They are used inconsistently, which is confusing.
- We can then also remove the (currently broken) hack/update-vanity-imports.sh.
- Last but not least, it would be a first step towards avoiding the k8s.io domain.

This commit was generated with
   sed -i -e 's;^package \(.*\) // import.*;package \1;' $(git grep -l '^package.*// import' | grep -v 'vendor/')

Everything was included, except for
   package labels // import k8s.io/kubernetes/pkg/util/labels
because that package is marked as "read-only".

Kubernetes-commit: 8a908e0c0bd96a3455edf7e3b5f5af90564e65b0
2024-12-02 14:43:58 +01:00
José Carlos Chávez
76174b8af8 chore: adds consistent vanity import to files and provides tooling for verifying and updating them. (#120642)
* chore: drops update vanity imports from script.

* chore: changes copyright year to 2024.

* chore: makes lint happy.

Kubernetes-commit: 6d6398ef9266abce3518a4c9a3d4e4d8feeffdc1
2024-02-08 13:38:07 +00:00
Haowei Cai
7dddf976b8 fix the fake client example: how to handle a race between the fake client and informer
Note that the fake client isn't designed to work with informer. It
doesn't support resource version. It's encouraged to use a real client
in an integration/E2E test if you need to test complex behavior with
informer/controllers.

Kubernetes-commit: 942bc9b32e39bb9c6ca045c02b48cc84dfa86633
2020-10-26 22:50:32 -07:00
Mike Danese
6659ae5216 generated: run refactor
Kubernetes-commit: 25651408aeadf38c3df7ea8c760e7519fd37d625
2020-02-08 12:30:21 -05:00
Mike Danese
60a0346672 generated: run refactor
Kubernetes-commit: 3aa59f7f3077642592dc8a864fcef8ba98699894
2020-02-07 18:16:47 -08:00
Tomas Nozicka
1abd19a10b Fix client-go fake client example flake
Kubernetes-commit: 0b116d915f12181e36f02ed3a87767513074e270
2019-03-06 08:36:15 +01:00
Jordan Liggitt
e6881e4a02 Update client callers to use explicit versions
Kubernetes-commit: d1e865ee341ba37469efed8c935e22e2b483eec2
2019-02-22 10:27:46 -05:00
Nikhita Raghunath
933d577128 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.

Kubernetes-commit: 764ae69671428987d77898b2d3c48c6c003e2fd4
2018-06-24 21:04:07 +05:30
Jonathan Basseri
c72a3893b1 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.

Kubernetes-commit: aed487b42d1b49df9ac01f7234896f6d1b4da166
2018-06-20 18:35:57 -07:00