Home Explore Blog CI



kubernetes

7th chunk of `content/en/blog/_posts/2018-01-00-Introducing-Client-Go-Version-6.md`
515bf4983c89a80a4cab89d8a2878b3a2ffb923e3a7378fe00000001000007f9
(If you are still running client-go version 4 and want to play it safe by not skipping a release, now is a good time to check out [this excellent blog post](https://medium.com/@andy.goldstein/upgrading-kubernetes-client-go-from-v4-to-v5-bbd5025fe381) describing how to upgrade to version 5, put together by our friends at Heptio.)  

Before starting, it is important to understand that client-go depends on two other Kubernetes projects: [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) and [k8s.io/api](https://github.com/kubernetes/api). In addition, if you are using CRDs, you probably also depend on [k8s.io/apiextensions-apiserver](https://github.com/kubernetes/apiextensions-apiserver) for the CRD client. The first exposes lower-level API mechanics (such as schemes, serialization, and type conversion), the second holds API definitions, and the third provides APIs related to CustomResourceDefinitions. In order for client-go to operate correctly, it needs to have its companion libraries vendored in correspondingly matching versions. Each library repository provides a branch named release-_\<version\>_ where _\<version\>_ refers to a particular Kubernetes version; for client-go version 6, it is imperative to refer to the _release_-1.9 branch on each repository.  

Assuming the latest version 5 patch release of client-go being vendored through dep, the Gopkg.toml manifest file should look something like this (possibly using branches instead of versions):  



```





[[constraint]]


  name = "k8s.io/api"

  version = "kubernetes-1.8.1"


[[constraint]]

  name = "k8s.io/apimachinery"

  version = "kubernetes-1.8.1"


[[constraint]]

  name = "k8s.io/apiextensions-apiserver"

  version = "kubernetes-1.8.1"


[[constraint]]

  name = "k8s.io/client-go"




  version = "5.0.1"

 ```


Note that some of the libraries could be missing if they are not actually needed by the client.  

Upgrading to client-go version 6 means bumping the version and tag identifiers as following ( **emphasis** given):  

Title: Client-go Dependencies and Upgrading with Dep
Summary
This section discusses upgrading to client-go version 6 using `dep`. It highlights the dependencies of client-go, including `k8s.io/apimachinery`, `k8s.io/api`, and `k8s.io/apiextensions-apiserver`, and emphasizes the importance of using matching versions of these libraries. An example Gopkg.toml file is provided, illustrating how to specify the correct versions or branches for these dependencies when using client-go version 5. The section concludes by mentioning that upgrading to client-go version 6 involves updating the version and tag identifiers.