dell / csm

Dell Container Storage Modules (CSM)
Apache License 2.0
68 stars 15 forks source link

[BUG]: dellctl crashes on a "backup get" when a trailing "/" is added to the namespace #691

Closed EZandboer closed 1 year ago

EZandboer commented 1 year ago

Bug Description

When running:

dellctl backup get -n application-mobility/

there is a panic as a result:

panic: runtime error: invalid memory address or nil pointer dereference

Logs

`root@k3s-001:~/yelb# dellctl restore get -n application-mobility NAME BACKUP STATUS CREATED COMPLETED restore-from-k3s-to-openshift-yelb-k3s-01 yelb-k3s-01 Completed 2023-02-21 06:15:58 -0500 EST NA restore-from-k3s-to-openshift-yelb-k3s-01-001 yelb-k3s-01 Completed 2023-02-21 06:15:58 -0500 EST NA restore-from-k3s-to-openshift-yelb-k3s-02 yelb-k3s-01 Completed 2023-02-21 06:15:58 -0500 EST NA restore-from-k3s-to-openshift-yelb-k3s-03 yelb-k3s-01 Completed 2023-02-23 09:06:53 -0500 EST NA root@k3s-001:~/yelb# dellctl restore get -n application-mobility/ FATAL Error: failed to get restores, error: invalid namespace "application-mobility/": [may not contain '/'] root@k3s-001:~/yelb# dellctl backup get -n application-mobility NAME STATUS CREATED EXPIRES STORAGE LOCATION DATA MOVER CLONED TARGET CLUSTERS backup-test-1 Completed 2023-02-21 04:28:59 -0500 EST 2023-03-23 02:44:26 -0400 EDT default Restic false yelb-k3s-01 Completed 2023-02-23 09:01:01 -0500 EST 2023-03-25 10:00:59 -0400 EDT default Restic false root@k3s-001:~/yelb# dellctl backup get -n application-mobility/ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x60 pc=0x12f59c5]

goroutine 1 [running]: eos2git.cec.lab.emc.com/DevCon/csm-cli/pkg/display.getBackupListTableRows(0x0) /root/release-0.1.0/csm-cli/pkg/display/app-mobility.go:95 +0x45 eos2git.cec.lab.emc.com/DevCon/csm-cli/pkg/display.PrintTable({0x190e598?, 0x0?}) /root/release-0.1.0/csm-cli/pkg/display/display.go:168 +0x2a5 eos2git.cec.lab.emc.com/DevCon/csm-cli/cmd/app-mobility/backup.newGetCmd.func1(0xc000354f00?, {0xc000290ea0, 0x0, 0x2}) /root/release-0.1.0/csm-cli/cmd/app-mobility/backup/get.go:55 +0x1c5 github.com/spf13/cobra.(Command).execute(0xc000354f00, {0xc000290e60, 0x2, 0x2}) /root/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:876 +0x67b github.com/spf13/cobra.(Command).ExecuteC(0xc0002f7900) /root/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:990 +0x3b4 github.com/spf13/cobra.(*Command).Execute(...) /root/go/pkg/mod/github.com/spf13/cobra@v1.5.0/command.go:918 eos2git.cec.lab.emc.com/DevCon/csm-cli/cmd.Execute() /root/release-0.1.0/csm-cli/cmd/root.go:29 +0x1e main.main() /root/release-0.1.0/csm-cli/main.go:58 +0x19 root@k3s-001:~/yelb# `

Screenshots

No response

Additional Environment Information

not relevant

Steps to Reproduce

perform this command:

dellctl backup get -n application-mobility/

Expected Behavior

In parallel to a "dellctl restore get" command this would be the expected output:

FATAL Error: failed to get backups, error: invalid namespace "application-mobility/": [may not contain '/']

CSM Driver(s)

CSI driver for Unity

Installation Type

Helm3: version.BuildInfo{Version:"v3.10.3", GitCommit:"835b7334cfe2e5e27870ab3ed4135f136eecc704", GitTreeState:"clean", GoVersion:"go1.18.9"}

Container Storage Modules Enabled

Application-mobility v0.2.0 dellctl v0.1.0

Container Orchestrator

K3s: v1.25.4+k3s1

Operating System

Debian GNU/Linux 10 (buster)

csmbot commented 1 year ago

@EZandboer: Thank you for submitting this issue!

The issue is currently awaiting triage. Please make sure you have given us as much context as possible.

If the maintainers determine this is a relevant issue, they will remove the needs-triage label and assign an appropriate priority label.


We want your feedback! If you have any questions or suggestions regarding our contributing process/workflow, please reach out to us at container.storage.modules@dell.com.

tdawe commented 1 year ago

/sync

csmbot commented 1 year ago

link: 11947

tdawe commented 1 year ago

Fixed