0

Trying to understand how one builds a tool consuming the Openshift Origin and Kubernetes APIs (I'm new to Go). It seems that I have a version of Kubernetes installed from Openshift and another version installed by godep and I'm getting all sorts of exciting version mismatches.

Here's my code so far:

package main

import (
    kclient "k8s.io/kubernetes/pkg/client/unversioned"
    client "github.com/openshift/origin/pkg/client"
)

func main() {
    config := kclient.Config{
        Host: "...",
    }

    client.SetOpenShiftDefaults(&config)
    client := client.NewOrDie(&config)
}

I then did a go get github.com/openshift/origin which I can see has a copy of Kubernetes in it's Godeps/_workspace/src directory.

However when I do a godep save I get:

godep: Package (k8s.io/kubernetes/pkg/client/unversioned) not found

If I do a go get to install Kubernetes I get a version that doesn't match with the version used by Openshift. What's the correct way to do this?

Danielle Madeley
  • 2,616
  • 1
  • 19
  • 26
  • Just guessing here, but: Try a `godep restore` with the `github.com/openshift/origin` package, which should install the packaged Kubernetes to your `GOPATH`. Then a `godep save` in your package. – mrd0ll4r Mar 02 '16 at 07:02
  • I discovered for the moment I can `export GOPATH=$GOPATH:${godep path}` which is letting me get the job done. – Danielle Madeley Mar 02 '16 at 09:41

0 Answers0