Skip to content

[BUG] k3d version list -i ... -l 1 fails if ... doesn't match #1662

Description

@DDL-Kaiting-Chen

What did you do

k3d version list -i '^1\.333' -l 1 -o repo k3s

No version of K3s begins with 1.333.

What did you expect to happen

No output

Screenshots or terminal output

panic: runtime error: slice bounds out of range [:1] with capacity 0

goroutine 1 [running]:
github.com/k3d-io/k3d/v5/cmd.NewCmdVersionLs.func1(0x1400028c008, {0x1400044c5b0, 0x1?, 0x7?})
        github.com/k3d-io/k3d/v5/cmd/root.go:380 +0x7f0
github.com/spf13/cobra.(*Command).execute(0x1400028c008, {0x1400044c540, 0x7, 0x7})
        github.com/spf13/cobra@v1.8.0/command.go:987 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x140001cd508)
        github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.8.0/command.go:1039
github.com/k3d-io/k3d/v5/cmd.Execute()
        github.com/k3d-io/k3d/v5/cmd/root.go:148 +0x124
main.main()
        github.com/k3d-io/k3d/v5/main.go:27 +0x1c

Which OS & Architecture

arch: aarch64
cgroupdriver: cgroupfs
cgroupversion: "2"
endpoint: /var/run/docker.sock
filesystem: UNKNOWN
infoname: docker-desktop
name: docker
os: Docker Desktop
ostype: linux
version: 29.4.1

Which version of k3d

k3d version v5.8.3
k3s version v1.33.6-k3s1 (default)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions