scaleway/scaleway-sdk-go

Panic on empty DNS record name

adontz opened this issue · 1 comments

When DNS record name is empty scw utility panics

scw dns record delete valid.dns.zone.name name="" type=CNAME --output json

produces

---------------------------------------------------------------------------------------
An error occurred, we are sorry, please consider opening a ticket on github using: 'scw feedback bug'
Give us as many details as possible so we can reproduce the error and fix it.
---------------------------------------------------------------------------------------
stacktrace from panic: 
goroutine 1 [running]:
runtime/debug.Stack()
        /opt/hostedtoolcache/go/1.17.13/x64/src/runtime/debug/stack.go:24 +0x65
main.cleanup(0xc000228fc0)
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:38 +0x85
panic({0xa10380, 0xfd1660})
        /opt/hostedtoolcache/go/1.17.13/x64/src/runtime/panic.go:1038 +0x215
github.com/scaleway/scaleway-cli/v2/internal/core.(*Printer).printJSON(0xc00023b8c0, {0x0, 0x0})
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/printer.go:235 +0x1e1
github.com/scaleway/scaleway-cli/v2/internal/core.(*Printer).Print(0xc00023b8c0, {0x0, 0x0}, 0xbcb898)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/printer.go:150 +0x8f
github.com/scaleway/scaleway-cli/v2/internal/core.Bootstrap(0xc00048bed0)
        /home/runner/work/scaleway-cli/scaleway-cli/internal/core/bootstrap.go:222 +0xfcb
main.main()
        /home/runner/work/scaleway-cli/scaleway-cli/cmd/scw/main.go:59 +0x291

runtime error: invalid memory address or nil pointer dereference

Hello thanks for reporting, it is an issue with scaleway CLI, I created your issue on the correct repository if you want to follow it