Skip to content

Commit ca36822

Browse files
committed
client-go: update INSTALL.md to include semver tags
1 parent 93c9085 commit ca36822

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

staging/src/k8s.io/client-go/INSTALL.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,30 @@ go mod init
5252

5353
### Add client-go as a dependency
5454

55-
Indicate which version of `client-go` your project requires (replace `kubernetes-1.15.0` with the desired version):
55+
Indicate which version of `client-go` your project requires:
56+
57+
- If you are using Kubernetes versions >= `v1.17.0`, use a corresponding
58+
`v0.x.y` tag. For example, `k8s.io/[email protected]` corresponds to Kubernetes `v1.17.0`:
5659

5760
```sh
58-
go get k8s.io/[email protected]
61+
go get k8s.io/[email protected]
62+
```
63+
64+
You can also use a non-semver `kubernetes-1.x.y` tag to refer to a version
65+
of `client-go` corresponding to a given Kubernetes release. Prior to Kubernetes
66+
`v1.17.0` these were the only tags available for use with go modules.
67+
For example, `kubernetes-1.16.3` corresponds to Kubernetes `v1.16.3`.
68+
However, it is recommended to use semver-like `v0.x.y` tags over non-semver
69+
`kubernetes-1.x.y` tags to have a seamless experience with go modules.
70+
71+
- If you are using Kubernetes versions < `v1.17.0` (replace `kubernetes-1.16.3` with the desired version):
72+
73+
```sh
74+
go get k8s.io/[email protected]
5975
```
6076

6177
You can now import and use the `k8s.io/client-go` APIs in your project.
6278
The next time you `go build`, `go test`, or `go run` your project,
6379
`k8s.io/client-go` and its dependencies will be downloaded (if needed),
6480
and detailed dependency version info will be added to your `go.mod` file
65-
(or you can also run `go mod tidy` to do this directly).
81+
(or you can also run `go mod tidy` to do this directly).

0 commit comments

Comments
 (0)