Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

godep on imagebuilder causes problems with old packages #8

Closed
surajssd opened this issue Aug 22, 2016 · 2 comments
Closed

godep on imagebuilder causes problems with old packages #8

surajssd opened this issue Aug 22, 2016 · 2 comments

Comments

@surajssd
Copy link

I have written this script, following README. But with this I get issues while compiling, about fsouza/go-dockerclient used from different locations when doing godep restore and godep save it causes some conflicts with the dependencies used in imagebuilder, as github.com/docker/docker/builder/command not found, it seems to have been removed from upstream docker.

    docker "github.com/fsouza/go-dockerclient"
...
    "github.com/openshift/imagebuilder/dockerclient"
    deployapi "github.com/openshift/origin/pkg/deploy/api"
)

func buildImagesRemote(buildDirPath string, imageName string) error {
    f, err := os.Open(filepath.Join(buildDirPath, "Dockerfile"))
    if err != nil {
        return err
    }
    defer f.Close()

    client, err := docker.NewClientFromEnv()
    if err != nil {
        logrus.Fatal(err)
    }
    e := dockerclient.NewClientExecutor(client)
    e.Out, e.ErrOut = os.Stdout, os.Stderr
    e.AllowPull = true
    e.Directory = buildDirPath
    e.Tag = imageName
    e.AuthFn = nil // ... pass a function to retrieve authorization info
    e.LogFn = func(format string, args ...interface{}) {
        fmt.Fprintf(e.ErrOut, "--> %s\n", fmt.Sprintf(format, args...))
    }

    buildErr := e.Build(f, map[string]string)
    if err := e.Cleanup(); err != nil {
        fmt.Fprintf(e.ErrOut, "error: Unable to clean up build: %v\n", err)
    }
    return nil
}

But when compiling I get errors as:

+ go build -tags experimental -o kompose ./cli/main/
# github.com/skippbox/kompose/pkg/transformer/kubernetes
pkg/transformer/kubernetes/k8sutils.go:55: cannot use client (type
*"github.com/skippbox/kompose/vendor/github.com/fsouza/go-dockerclient".Client) as type
*"github.com/openshift/imagebuilder/vendor/github.com/fsouza/go-dockerclient".Client in
argument to dockerclient.NewClientExecutor
pkg/transformer/kubernetes/k8sutils.go:65: type map[string]string is not an expression

Tried doing godep restore and godep save ./... but then facing this issue of

$ godep save ./...
godep: Package (github.com/docker/docker/builder/command) not found
@smarterclayton
Copy link
Contributor

In order for you to build, you'll need to resolve your differences from the go-dockerclient. You can do that by deleting the vendor directory under image builder for go-dockerclient.

@smarterclayton
Copy link
Contributor

This seems weird - all of that should be vendor protected. Either way I've merged the 1.12 vendoring and it should be better now. Reopen if this continues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants