Merge pull request #85995 from nikhita/semver-tags-instructions

client-go: update INSTALL.md to include semver tags

Kubernetes-commit: 4f52ccaf39edcb1549920732368ce6298d281b94
This commit is contained in:
Kubernetes Publisher 2019-12-11 07:32:06 -08:00
commit a1d3d648d0
4 changed files with 27 additions and 11 deletions

4
Godeps/Godeps.json generated
View File

@ -348,11 +348,11 @@
},
{
"ImportPath": "k8s.io/api",
"Rev": "97f6f5b52064"
"Rev": "71a29d78ad4c"
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "adc6f4cd9e7d"
"Rev": "eca85dcd9994"
},
{
"ImportPath": "k8s.io/gengo",

View File

@ -52,10 +52,26 @@ go mod init
### 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
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.

8
go.mod
View File

@ -28,8 +28,8 @@ require (
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
google.golang.org/appengine v1.5.0 // indirect
k8s.io/api v0.0.0-20191210143730-97f6f5b52064
k8s.io/apimachinery v0.0.0-20191203211716-adc6f4cd9e7d
k8s.io/api v0.0.0-20191211145919-71a29d78ad4c
k8s.io/apimachinery v0.0.0-20191211000542-eca85dcd9994
k8s.io/klog v1.0.0
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f
sigs.k8s.io/yaml v1.1.0
@ -38,6 +38,6 @@ require (
replace (
golang.org/x/sys => golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // pinned to release-branch.go1.13
golang.org/x/tools => golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 // pinned to release-branch.go1.13
k8s.io/api => k8s.io/api v0.0.0-20191210143730-97f6f5b52064
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191203211716-adc6f4cd9e7d
k8s.io/api => k8s.io/api v0.0.0-20191211145919-71a29d78ad4c
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20191211000542-eca85dcd9994
)

4
go.sum
View File

@ -193,8 +193,8 @@ gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/api v0.0.0-20191210143730-97f6f5b52064/go.mod h1:WxerFZ1DOp5g/hA844ZoiGxrDSkaeY1Y4pBD58zoMsk=
k8s.io/apimachinery v0.0.0-20191203211716-adc6f4cd9e7d/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/api v0.0.0-20191211145919-71a29d78ad4c/go.mod h1:NFZ8ceF6tQoofQOWiVLLpMlbaBB9os8O8mgUEcC81L8=
k8s.io/apimachinery v0.0.0-20191211000542-eca85dcd9994/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg=
k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=