<p>We wrote some Go code to talk to our Kubernetes cluster and fetch the IP of a Service exposed. We do it like so:</p>

<pre><code>(import "gopkg.in/kubernetes/kubernetes.v1/pkg/client/restclient")
(import kubectl "gopkg.in/kubernetes/kubernetes.v1/pkg/client/unversioned")

 svc, err := c.Services(k8sNS).Get(svcName)
 if err != nil {
   panic(l.Errorf("Could not retrieve svc details. %s", err.Error()))
 }
 svcIP := svc.Status.LoadBalancer.Ingress[0].IP
</code></pre>

<p><code>go get</code> works fine, and our script executes when we do <code>go run ...</code> and everybody is happy. Now, as of yesterday (from the time this question is posted) on the same script - <code>go get</code> fails. The error is like so:</p>

<pre><code>[09.07.2016 10:56 AM]$ go get
package k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install: cannot find package "k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install" in any of:
        /usr/local/go/src/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install (from $GOROOT)
        /home/ckotha/godir/src/k8s.io/kubernetes/pkg/apis/authentication.k8s.io/install (from $GOPATH)
</code></pre>

<p>We have not specifically used <code>authentication</code> package in our code. Are we importing kubernetes libraries correctly? is there another way to do this ?</p>

<p><code>ls</code> on <code>$GOPATH/k8s.io/kubernetes/pkg/apis/</code> and found this:</p>

<pre><code>:~/godir/src/k8s.io/kubernetes/pkg/apis
[09.07.2016 10:53 AM]$ ls
abac  apps  authentication  authorization  autoscaling  batch  certificates  componentconfig  extensions  imagepolicy  OWNERS  policy  rbac  storage
</code></pre>

<p>It looks like a package you imported has changed.</p>

<p>You can update existing repositories:</p>

<pre><code>go get -u
</code></pre>

<blockquote>
  <p>The -u flag instructs get to use the network to update the named
  packages and their dependencies.  By default, get uses the network to
  check out missing packages but does not use it to look for updates to
  existing packages.</p>
</blockquote>

<p>You do use <a href="http://labix.org/gopkg.in" rel="nofollow">gopkg.io</a> to pin the version to v1, but I think you want to be more specific, eg, v1.3.6 (EDIT: this won't work because gopkg.in doesn't permit package selectors more specific than the major version.). </p>

<p>Alternatively, a good way to ensure code stays the same is to compile your binary and execute that, instead of using <code>go run</code>.</p>
