semaphoreci / cli

Semaphore 2.0 Command Line Interface
Apache License 2.0
26 stars 13 forks source link

`sem edit mySecrets` crashes `sem` #57

Closed mactsouk closed 6 years ago

mactsouk commented 6 years ago
$ sem version
v0.5.0-preview1
$ sem edit mySecrets
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/renderedtext/sem/cmd.RunEdit(0x16dffc0, 0xc42004b120, 0x1, 0x1)
    /home/semaphore/go/src/github.com/renderedtext/sem/cmd/edit.go:26 +0xc4
github.com/renderedtext/sem/cmd.glob..func9(0x16dffc0, 0xc42004b120, 0x1, 0x1)
    /home/semaphore/go/src/github.com/renderedtext/sem/cmd/edit.go:16 +0x49
github.com/spf13/cobra.(*Command).execute(0x16dffc0, 0xc42004b0e0, 0x1, 0x1, 0x16dffc0, 0xc42004b0e0)
    /home/semaphore/go/src/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/spf13/cobra.(*Command).ExecuteC(0x16e0480, 0xc42012bf30, 0xc42012bf38, 0x13b448e)
    /home/semaphore/go/src/github.com/spf13/cobra/command.go:852 +0x334
github.com/spf13/cobra.(*Command).Execute(0x16e0480, 0x0, 0x16e06e0)
    /home/semaphore/go/src/github.com/spf13/cobra/command.go:800 +0x2b
github.com/renderedtext/sem/cmd.Execute()
    /home/semaphore/go/src/github.com/renderedtext/sem/cmd/root.go:37 +0x31
main.main()
    /home/semaphore/go/src/github.com/renderedtext/sem/main.go:6 +0x20
shiroyasha commented 6 years ago

Just to note, the issue is not connected to the mySecret but to the cli interface.

The answer to sem edit mySecret should be:

error: Unknown resource kind mySecrets.

The message will be fixed in 0.5.0-preview2

mactsouk commented 6 years ago

Yes it is not related to mySecret. Everything after sem edit that is unknown crashes it.

shiroyasha commented 6 years ago

fixed in https://github.com/renderedtext/sem/pull/56