onosproject / onos-cli

Command-line interface for ONOS (µONOS Architecture)
Apache License 2.0
18 stars 29 forks source link

Fix create relation bug #321

Open shaopeng-lin opened 1 year ago

shaopeng-lin commented 1 year ago

Hi, I found a bug when creating a relation from cli. `onos-cli-b987f85dd-snhxn:~$ onos topo create relation entity1 entity2 panic: runtime error: index out of range [2] with length 2

goroutine 1 [running]: github.com/onosproject/onos-cli/pkg/topo.runCreateRelationCommand(0xc0004a4c00?, {0xc000470dc0, 0x2, 0x2?}) /build/pkg/topo/create.go:60 +0x99 github.com/spf13/cobra.(Command).execute(0xc0004a4c00, {0xc000470d80, 0x2, 0x2}) /build/vendor/github.com/spf13/cobra/command.go:940 +0x862 github.com/spf13/cobra.(Command).ExecuteC(0xc00049c000) /build/vendor/github.com/spf13/cobra/command.go:1068 +0x3bd github.com/spf13/cobra.(*Command).Execute(...) /build/vendor/github.com/spf13/cobra/command.go:992 github.com/onosproject/onos-cli/pkg/cli.Execute() /build/pkg/cli/root.go:38 +0x1e main.main() /build/cmd/onos/main.go:12 +0x17`

And this pull request is a fix. Thanks.

onf-cla-manager[bot] commented 1 year ago

Hi @shaopeng-lin, this is the ONF bot 🤖 I'm glad you want to contribute to our projects! However, before accepting your contribution, we need to ask you to sign a Contributor License Agreement (CLA). You can do it online, it will take only a few minutes:

✒️ 👉 https://cla.opennetworking.org

After signing, make sure to add your Github user ID shaopeng-lin to the agreement.

For more information or help:" https://wiki.opennetworking.org/x/BgCUI

gab-arrobo commented 10 months ago

@shaopeng-lin, are you planning to sign the CLA? If not, we might need to close your PR.