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

Tanka init fail #1023

Closed
Its-Alex opened this issue May 10, 2024 · 3 comments
Closed

Tanka init fail #1023

Its-Alex opened this issue May 10, 2024 · 3 comments

Comments

@Its-Alex
Copy link

What's wrong?

When I try to use tk init I got an error with k8s-libsonnet:

Steps to reproduce

$ tk init

System information

6.8.8-arch1-1

Software version

Tanka: 2024/05/03 10:40:21 tk version v0.26.0
jb: v0.5.1

Configuration

No response

Logs

$ tk init --log-level trace -f
GET https://github.com/grafana/jsonnet-libs/archive/249e94b853952d0155d3ac4ce17c5fdbd90f779c.tar.gz 200
GET https://github.com/jsonnet-libs/docsonnet/archive/6ac6c69685b8c29c54515448eaca583da2d88150.tar.gz 200
GET https://github.com/jsonnet-libs/k8s-libsonnet/archive/bf9a62cfd32a58c071b8410bfcdec058475dd25e.tar.gz 200
panic: rename /home/itsalex/Documents/tk/vendor/.tmp/28d5d0cf4e0847d16afe3035627683a6750259751/1.20 /home/itsalex/Documents/tk/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.20: no such file or directory

goroutine 1 [running]:
github.com/jsonnet-bundler/jsonnet-bundler/pkg.(*GitPackage).Install(0xc00038e090, {0x829ee8?, 0xc00001c128}, {0xc0000147e0, 0x2a}, {0xc0000147b0, 0x21}, {0x7ffdca18cb5c, 0x4})
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/git.go:228 +0x1a9d
github.com/jsonnet-bundler/jsonnet-bundler/pkg.download({{0xc000010500, 0x0}, {0x7ffdca18cb5c, 0x4}, {0x0, 0x0}, 0x0, {0x0, 0x0}}, {0xc0000147b0, ...}, ...)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:309 +0x3b1
github.com/jsonnet-bundler/jsonnet-bundler/pkg.ensure(0x20?, {0xc0000147b0, 0x21}, {0x0, 0x0}, 0x0?)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:234 +0x61d
github.com/jsonnet-bundler/jsonnet-bundler/pkg.Ensure({0xc0000a5fb0?, 0x0?}, {0xc0000147b0, 0x21}, 0x0?)
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/pkg/packages.go:55 +0x54
main.installCommand({0xc000018064?, 0x7a64a2?}, {0x79370b, 0x6}, {0xc0000b44c0, 0x3, 0x0?}, 0x0, {0x0, 0x0})
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/install.go:85 +0x46d
main.Main()
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/main.go:87 +0xd27
main.main()
        /home/metalmatze/src/github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb/main.go:39 +0x19
Installing k.libsonnet: exit status 2
Directory structure set up! Remember to configure the API endpoint:
`tk env set environments/default --server=https://127.0.0.1:6443`
Errors occurred while initializing the project. Check the above logs for details.
@dan-os
Copy link
Contributor

dan-os commented May 13, 2024

This issue was was recently fixed by #1010 but has not been shipped yet.

In the meantime, you can manually set your kubernetes version like so:

tk init --k8s 1.29

Hope this helps!

@Its-Alex
Copy link
Author

@dan-os Hello, I wanted to use version 1.20, that doesn't work with that version, can you help me know how to make it works with a version before 1.26 ?

@Its-Alex
Copy link
Author

Its-Alex commented May 14, 2024

I found a solution, using this jsonnetfile.json:

{
  "version": 1,
  "dependencies": [
    {
      "source": {
        "git": {
          "remote": "https://github.com/grafana/jsonnet-libs.git",
          "subdir": "ksonnet-util"
        }
      },
      "version": "master"
    },
    {
      "source": {
        "git": {
          "remote": "https://github.com/jsonnet-libs/docsonnet.git",
          "subdir": "doc-util"
        }
      },
      "version": "master"
    },
    {
      "source": {
        "git": {
          "remote": "https://github.com/jsonnet-libs/k8s-libsonnet.git",
          "subdir": "1.20"
        }
      },
      "version": "5c83a9a2b08fa055cfc62d9f59270161dd729596"
    }
  ],
  "legacyImports": true
}

And setting version to a commit of k8s-libsonnet before the drop of kubernetes 1.20, I can do a jb install successfully.

I leave a comment in jsonnet-libs/k8s#417 (comment) to explain that supported version are not emphasised.

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