mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Merge pull request #85995 from nikhita/semver-tags-instructions
client-go: update INSTALL.md to include semver tags
This commit is contained in:
commit
4f52ccaf39
@ -52,14 +52,30 @@ go mod init
|
|||||||
|
|
||||||
### Add client-go as a dependency
|
### Add client-go as a dependency
|
||||||
|
|
||||||
Indicate which version of `client-go` your project requires (replace `kubernetes-1.15.0` with the desired version):
|
Indicate which version of `client-go` your project requires:
|
||||||
|
|
||||||
|
- If you are using Kubernetes versions >= `v1.17.0`, use a corresponding
|
||||||
|
`v0.x.y` tag. For example, `k8s.io/client-go@v0.17.0` corresponds to Kubernetes `v1.17.0`:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
go get k8s.io/client-go@kubernetes-1.15.0
|
go get k8s.io/client-go@v0.17.0
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also use a non-semver `kubernetes-1.x.y` tag to refer to a version
|
||||||
|
of `client-go` corresponding to a given Kubernetes release. Prior to Kubernetes
|
||||||
|
`v1.17.0` these were the only tags available for use with go modules.
|
||||||
|
For example, `kubernetes-1.16.3` corresponds to Kubernetes `v1.16.3`.
|
||||||
|
However, it is recommended to use semver-like `v0.x.y` tags over non-semver
|
||||||
|
`kubernetes-1.x.y` tags to have a seamless experience with go modules.
|
||||||
|
|
||||||
|
- If you are using Kubernetes versions < `v1.17.0` (replace `kubernetes-1.16.3` with the desired version):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go get k8s.io/client-go@kubernetes-1.16.3
|
||||||
```
|
```
|
||||||
|
|
||||||
You can now import and use the `k8s.io/client-go` APIs in your project.
|
You can now import and use the `k8s.io/client-go` APIs in your project.
|
||||||
The next time you `go build`, `go test`, or `go run` your project,
|
The next time you `go build`, `go test`, or `go run` your project,
|
||||||
`k8s.io/client-go` and its dependencies will be downloaded (if needed),
|
`k8s.io/client-go` and its dependencies will be downloaded (if needed),
|
||||||
and detailed dependency version info will be added to your `go.mod` file
|
and detailed dependency version info will be added to your `go.mod` file
|
||||||
(or you can also run `go mod tidy` to do this directly).
|
(or you can also run `go mod tidy` to do this directly).
|
||||||
|
Loading…
Reference in New Issue
Block a user