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

go get failing due to nonexistent arangodb/arangosync repo #249

Closed
rglyons opened this issue Sep 6, 2018 · 3 comments
Closed

go get failing due to nonexistent arangodb/arangosync repo #249

rglyons opened this issue Sep 6, 2018 · 3 comments

Comments

@rglyons
Copy link

rglyons commented Sep 6, 2018

I'm trying to create arangodb clusters on kubernetes programmatically from yaml definitions (using k8s.io/client-go). In order to create custom arango resources from yaml, I need to register the arango CRD scheme with the client-go scheme. I tried to do so like this:

package example 

import (
    apiextscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
    arango "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
    "k8s.io/client-go/kubernetes/scheme"
)

func registerCustomSchemes() error {
    // register the CRD scheme to be able to create CRDs from yaml
    apiextscheme.AddToScheme(scheme.Scheme)
    // register the arango scheme to be able to create arango clusters from yaml
    arango.AddToScheme(scheme.Scheme)
}

func main() {
    registerCustomSchemes()
    // assume yamls is a slice of k8s object yaml definitions,
    // which includes object(s) with kind: ArangoDeployment
    for _, yaml := range yamls {
        obj, _, err := scheme.Codecs.UniversalDeserializer().Decode([]byte(yaml), nil, nil)
        // ... do something with obj
    }
}

With that context, you can see that I need to get the package github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme. I tried to do so using dep ensure, however the download fails. After digging into it, I found that this repo is importing packages from github.com/arangodb/arangosync - here's an example

github.com/arangodb/arangosync does not exist, and thus dep ensure and go get hang/fail looking for this dependency of github.com/arangodb/kube-arangodb

This is happening with release 0.2.2.
Here's the go get output -

go get "github.com/arangodb/kube-arangodb/pkg/generated/clientset/versioned/scheme"
# cd .; git clone https://github.com/arangodb/arangosync <GOPATH>/src/github.com/arangodb/arangosync
Cloning into '<GOPATH>/src/github.com/arangodb/arangosync'...
remote: Repository not found.
fatal: repository 'https://github.com/arangodb/arangosync/' not found
package github.com/arangodb/arangosync/pkg/retry: exit status 128

Any ideas?

@ewoutp
Copy link
Contributor

ewoutp commented Sep 7, 2018

We do not use go get for building, but you're correct about including it API wise.
I don't have a quick answer, but the code you need is here https://github.com/arangodb/kube-arangodb/tree/master/deps/github.com/arangodb/arangosync

I'll leave the issue open and we try to come up with a decent solution.

@ewoutp
Copy link
Contributor

ewoutp commented Sep 7, 2018

@rglyons we've made a small change in master where arangosync we're used that should have been kube-arangodb imports (with identical code). Please try it again with go get -u ...

@rglyons
Copy link
Author

rglyons commented Sep 7, 2018

@ewoutp Everything seems to be working now using dep ensure. Thanks for the quick response and turnaround!

@ewoutp ewoutp closed this as completed Sep 14, 2018
@ewoutp ewoutp reopened this Sep 14, 2018
@ewoutp ewoutp closed this as completed Sep 14, 2018
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