Skip to content

[ci] use go mod instead of go get in spec.bats#4264

Merged
AkihiroSuda merged 1 commit intoopencontainers:mainfrom
lifubang:upgrade-spec.bat
Apr 30, 2024
Merged

[ci] use go mod instead of go get in spec.bats#4264
AkihiroSuda merged 1 commit intoopencontainers:mainfrom
lifubang:upgrade-spec.bat

Conversation

@lifubang
Copy link
Member

When we run integration test in go 1.22, it got an error:

 ✗ spec validator
   (in test file tests/integration/spec.bats, line 37)
     `GO111MODULE=auto go get github.com/xeipuuv/gojsonschema' failed
   runc spec (status=0):
   
   Cloning into 'runtime-spec'...
   HEAD is now at 36852b0 version: release v1.2.0
   go: go.mod file not found in current directory or any parent directory.
        'go get' is no longer supported outside a module.
        To build and install a command, use 'go install' with a version,
        like 'go install example.com/cmd@latest'
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.

Although we have not supported go 1.22 yet, but I think we should update the spec.bat first.

@lifubang lifubang mentioned this pull request Apr 29, 2024
Comment on lines +42 to +43
cd ../../
./runtime-spec/schema/validate "$SCHEMA" config.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe easier to do

./validate config-schema.json ../../config.json

(and remove cd and SCHEMA= above)

Long term, I guess, we need to fix runtime-spec to

  • embed config-schema.json into validate binary
  • add go.mod to runtime-spec
  • make it easier to use so go install github.com/opencontainers/runtime-spec/schema/validate@$SPEC_REF results in validate binary ready to be used.

Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: lifubang <lifubang@acmcoder.com>
@AkihiroSuda AkihiroSuda merged commit 7a017af into opencontainers:main Apr 30, 2024
@lifubang lifubang mentioned this pull request Jun 10, 2024
@lifubang lifubang deleted the upgrade-spec.bat branch October 15, 2024 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants