Skip to content

go mod fails on go 1.13 because of invalid pseudo-version #462

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

Closed
Skarlso opened this issue Oct 3, 2019 · 8 comments
Closed

go mod fails on go 1.13 because of invalid pseudo-version #462

Skarlso opened this issue Oct 3, 2019 · 8 comments

Comments

@Skarlso
Copy link
Contributor

Skarlso commented Oct 3, 2019

Once arango switches to go 1.13 the build will fail with this error:

go: github.com/coreos/[email protected] requires
        github.com/prometheus/[email protected]+incompatible requires
        k8s.io/[email protected]+incompatible: invalid pseudo-version: preceding tag (v2.0.0-alpha.0) not found

This related to this:

golang/go#33546 from go.

And here is the related prometheus issue for it:

prometheus/prometheus#6048

TL;DR arango needs to get the commit ID instead of the version because prometheus doesn't care about go's API compatilibity restrictions.

@Skarlso
Copy link
Contributor Author

Skarlso commented Oct 3, 2019

Ah, another one:

kubernetes/client-go#670

Which means the official standpoint is:

Kubernetes only supports go 1.12 for now. It's a known issue that there are several problems with > 1.13, see kubernetes/kubernetes#78845 (comment) for more details.

@bcmills
Copy link

bcmills commented Oct 3, 2019

Which means the official standpoint is:

Note also kubernetes/kubernetes#79384 (comment):

k8s.io/kubernetes is not primarily intended to be consumed as a module. Only the published subcomponents are (and go get works properly with those).

If you want to consume k8s.io/kubernetes as a module, you'd probably need to add require directives for matching versions of all of the subcomponents, rather than using go get

So it's a bit misleading to say that Kubernetes only supports Go 1.12. Rather, Kubernetes only supports use of their published subcomponents on 1.13, and presumably only at tagged releases, and still uses 1.12 internally.

@Skarlso
Copy link
Contributor Author

Skarlso commented Oct 3, 2019

Hey, thanks for chiming in! 😊

Yes that's true. But also Kube is facing some other issues involved in switching to 1.13. But that's fine. Arango is still using 1.14 or so so its not like this is next week's trouble.

@RoyCrivolotti
Copy link

I'm facing the issue above myself right now! My Dockerfile used to work fine, but now I'm getting the following error. Maybe you could give me a hand pointing out how I might go about fixing the compatibility issue I seem to be facing.

Step 12/14 : RUN go get -d ./... &&     go build -o operator &&     cp operator /bin/operator
 ---> Running in 911a78212ed5
go: github.com/prometheus/[email protected]+incompatible requires
        k8s.io/[email protected]+incompatible: invalid pseudo-version: preceding tag (v2.0.0-alpha.0) not found
The command '/bin/sh -c go get -d ./... &&     go build -o operator &&     cp operator /bin/operator' returned a non-zero code: 1

This is my Dockerfile

FROM golang:alpine

RUN set -ex && \
    apk update && \
    apk -U upgrade && \
    apk add curl && \
    apk add git

RUN mkdir -p /operator && \
    mkdir -p /temp

RUN curl -L -k https://github.com/coreos/prometheus-operator/archive/v0.31.1.tar.gz > operator.tar.gz && \
    tar -xzvf operator.tar.gz --strip-components=1 -C /operator

RUN rm operator.tar.gz

COPY promcfg.go /temp/promcfg.go 

WORKDIR /temp

RUN yes | cp -rf promcfg.go /operator/pkg/prometheus/promcfg.go

WORKDIR /operator/cmd/operator

RUN go get -d ./... && \
    go build -o operator && \
    cp operator /bin/operator

RUN rm -rf /temp && \
    rm -rf /operator

ENTRYPOINT ["/bin/operator"]

@bcmills
Copy link

bcmills commented Dec 16, 2019

@RoyCrivolotti, per https://golang.org/doc/go1.13#version-validation, try (in your go.mod file):

replace k8s.io/client-go v2.0.0-alpha.0.0.20181121191925-a47917edff34+incompatible => k8s.io/client-go a47917edff34

and then run go mod tidy or similar to resolve that to a corrected pseudo-version.

@RoyCrivolotti
Copy link

IDK exactly where that line is, aka what file it's in, so I'll comment the layers crashing the build, do the rest of the work work, get into the container with bash, and search in the uncompressed files for the line you say with grep or something. Thanks a lot for your help 😄

@bcmills
Copy link

bcmills commented Dec 17, 2019

No, I mean literally add that line somewhere in your module's go.mod file. 😉

@RoyCrivolotti
Copy link

Oh hahaha my bad, yeah that fixed it 100%. I didn't know where the go.mod file would be since I've never used this, so I just wen into the container with busybox sh when running the container to see the path to the file, and then performed a patch and run the tidy command. Seriously, thanks a lot!

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

4 participants