Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid out of range panic when destination type is not set #253

Merged
merged 1 commit into from
Feb 23, 2023

Conversation

ChunyiLyu
Copy link
Collaborator

@ChunyiLyu ChunyiLyu commented Feb 23, 2023

Context

info.DestinationType[0] panics if DestinationType is empty

github.com/michaelklishin/rabbit-hole/v2.(*Client).DeleteBinding(0x0?, {0x14b24d8?, 0x0?}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, ...}, ...})
    	/Users/clyu/workspace/rabbit-hole/bindings.go:218 +0x2ce
    github.com/michaelklishin/rabbit-hole/v2.glob..func2.49.1()
    	/Users/clyu/workspace/rabbit-hole/rabbithole_test.go:1795 +0x65
    github.com/onsi/ginkgo/internal/leafnodes.(*runner).runSync(0xc00068a460?)
    	/Users/clyu/go/pkg/mod/github.com/onsi/ginkgo@v1.16.5/internal/leafnodes/runner.go:113 +0xb1
    github.com/onsi/ginkgo/internal/leafnodes.(*runner).run(0x0?)
    	/Users/clyu/go/pkg/mod/github.com/onsi/ginkgo@v1.16.5/internal/leafnodes/runner.go:64 +0x125
    github.com/onsi/ginkgo/internal/leafnodes.(*ItNode).Run(0x1095560?)
    	/Users/clyu/go/pkg/mod/github.com/onsi/ginkgo@v1.16.5/internal/leafnodes/it_node.go:26 +0x7b
    github.com/onsi/ginkgo/internal/spec.(*Spec).runSample(0xc00026b590, 0xc0000eda40?, {0x14b4100, 0xc0000a2940})

Rename newBindingPath helper to bindingPath

Relates to a bug reported in: rabbitmq/messaging-topology-operator#555

- info.DestinationType[0] panics if it's an empty string
- rename newBindingPath helper to bindingPath
@michaelklishin michaelklishin merged commit 5aa2074 into main Feb 23, 2023
@michaelklishin michaelklishin deleted the fix-delete-binding-panic branch February 23, 2023 12:38
@michaelklishin michaelklishin added this to the 2.13.0 milestone Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants