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

Newest Go API version cannot be downloaded by tag #2634

Open
MegaRedHand opened this issue Jan 17, 2025 · 3 comments
Open

Newest Go API version cannot be downloaded by tag #2634

MegaRedHand opened this issue Jan 17, 2025 · 3 comments
Labels
bug Something isn't working papercut sdk for bugs/FRs relating to our SDK

Comments

@MegaRedHand
Copy link

What's your CLI version?

v2.1.0

Description & steps to reproduce

Trying to update the dependency to the latest version fails. I tried in multiple ways, but the only way I got it to work is by specifying the commit:

$ go get github.com/kurtosis-tech/kurtosis/api/golang@84e2fe2
go: downloading github.com/kurtosis-tech/kurtosis/api/golang v1.4.4-0.20250116034716-84e2fe2b35f5
go: downloading github.com/kurtosis-tech/kurtosis v1.4.2-0.20250116034716-84e2fe2b35f5
go: upgraded github.com/kurtosis-tech/kurtosis/api/golang v1.4.3 => v1.4.4-0.20250116034716-84e2fe2b35f5

I tried with @v2.1.0:

$ go get github.com/kurtosis-tech/kurtosis/api/[email protected]
go: github.com/kurtosis-tech/kurtosis/api/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/kurtosis-tech/kurtosis/api/golang/v2")

@v2.1.0, and appending a /v2 to the url:

$ go get github.com/kurtosis-tech/kurtosis/api/golang/[email protected]
go: github.com/kurtosis-tech/kurtosis/api/[email protected]: invalid version: module contains a go.mod file, so module path must match major version ("github.com/kurtosis-tech/kurtosis/api/golang/v2")

with the release tag (2.1.0):

$ go get github.com/kurtosis-tech/kurtosis/api/[email protected]
go: module github.com/kurtosis-tech/[email protected] found (v1.4.2-0.20250116034716-84e2fe2b35f5), but does not contain package github.com/kurtosis-tech/kurtosis/api/golang

Deleting the dependency and adding it again also doesn't work: it just adds the old v1.4.3 version to go.mod.

Desired behavior

I expected that running:

go get -u github.com/kurtosis-tech/kurtosis/api/golang

would update the Go API to the latest version. Using it after running that returns:

failed to initialize kurtosis context: An error occurred validating the Kurtosis engine API version
 --- at /Users/mega/.asdf/installs/golang/1.23.4/packages/pkg/mod/github.com/kurtosis-tech/kurtosis/api/[email protected]/engine/lib/kurtosis_context/kurtosis_context.go:88 (NewKurtosisContextFromLocalEngine) ---
Caused by: An API version mismatch was detected between the running engine version '2.1.0' and the engine version this Kurtosis SDK library expects, '1.4.3'. You should:
  1) upgrade your Kurtosis CLI to latest using the instructions at https://docs.kurtosis.com/upgrade
  2) use the Kurtosis CLI to restart your engine via 'kurtosis engine restart'
  3) upgrade your Kurtosis SDK library using the instructions at https://github.com/kurtosis-tech/kurtosis-engine-api-lib
 --- at /Users/mega/.asdf/installs/golang/1.23.4/packages/pkg/mod/github.com/kurtosis-tech/kurtosis/api/[email protected]/engine/lib/kurtosis_context/kurtosis_context.go:512 (validateEngineApiVersion) ---

What is the severity of this bug?

Papercut; this bug is frustrating, but I have a workaround.

What area of the product does this pertain to?

SDK: the Software Development Kit libraries - Typescript, Go, etc.

@MegaRedHand MegaRedHand added the bug Something isn't working label Jan 17, 2025
@github-actions github-actions bot added papercut sdk for bugs/FRs relating to our SDK labels Jan 17, 2025
@tedim52
Copy link
Contributor

tedim52 commented Jan 17, 2025

Was able to reproduce this. investigating

@tedim52
Copy link
Contributor

tedim52 commented Jan 17, 2025

Ah it seems like the path declared in go.mod needs to be updated with /v2 to support major version 2. https://go.dev/blog/v2-go-modules

@tedim52
Copy link
Contributor

tedim52 commented Jan 18, 2025

Addressing this here: #2635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working papercut sdk for bugs/FRs relating to our SDK
Projects
None yet
Development

No branches or pull requests

2 participants