civo / cli

Our Command Line Interface (CLI) for interacting with your Civo resources
Apache License 2.0
171 stars 83 forks source link

Create Node-Pool panics but continues to work anyway #354

Open NerdyShawn opened 7 months ago

NerdyShawn commented 7 months ago

I attempted to add a net new medium node-pool (name=mids) to an existing cluster in NYC1 that panics it seems when the name is less than 6 characters

civo k8s node-pool create test01 --name mids -s g4s.kube.medium -n 1
panic: runtime error: slice bounds out of range [:6] with length 4

goroutine 1 [running]:
github.com/civo/cli/cmd/kubernetes.glob..func15(0x1af85e0?, {0xc000278a80, 0x1, 0x7?})
    /home/runner/work/cli/cli/cmd/kubernetes/kubernetes_nodepool_create.go:78 +0x7d0
github.com/spf13/cobra.(*Command).execute(0x1af85e0, {0xc000278a10, 0x7, 0x7})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:854 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1aea960)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/civo/cli/cmd.Execute()
    /home/runner/work/cli/cli/cmd/root.go:121 +0x25
main.main()
    /home/runner/work/cli/cli/main.go:27 +0x17

Trying to view this later via the cli show command produces the same panic' output on the problematic node-pool

Pool (45e0f0):
+---------------------------------------------+---------------+--------+----------------+-----------+----------+---------------+
| Name                                        | IP            | Status | Size           | Cpu Cores | RAM (MB) | SSD disk (GB) |
+---------------------------------------------+---------------+--------+----------------+-----------+----------+---------------+
| k3s-test01-c25a-69f91e-node-pool-3356-jq89x |               | ACTIVE | g4s.kube.large |         4 |     8192 |            60 |
+---------------------------------------------+---------------+--------+----------------+-----------+----------+---------------+
| k3s-test01-c25a-69f91e-node-pool-3356-cqtup | 212.2.242.113 | ACTIVE | g4s.kube.large |         4 |     8192 |            60 |
+---------------------------------------------+---------------+--------+----------------+-----------+----------+---------------+

Labels:
kubernetes.civo.com/node-pool=45e0f0d6-bd7a-494e-b9ae-2e334653e182
kubernetes.civo.com/node-size=g4s.kube.large
panic: runtime error: slice bounds out of range [:6] with length 4

goroutine 1 [running]:
github.com/civo/cli/cmd/kubernetes.glob..func27(0x1af9ae0?, {0xc0003620d0, 0x1, 0x1?})
    /home/runner/work/cli/cli/cmd/kubernetes/kubernetes_show.go:187 +0x61e8
github.com/spf13/cobra.(*Command).execute(0x1af9ae0, {0xc0003620b0, 0x1, 0x1})
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:854 +0x663
github.com/spf13/cobra.(*Command).ExecuteC(0x1aea960)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x39c
github.com/spf13/cobra.(*Command).Execute(...)
    /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/civo/cli/cmd.Execute()
    /home/runner/work/cli/cli/cmd/root.go:121 +0x25
main.main()
    /home/runner/work/cli/cli/main.go:27 +0x17

This 4 letter node-pool is READY though image

NerdyShawn commented 7 months ago

Woops, I just realized I already submitted this via #344 as well