fix: fixed NPR when validating Kafka name#1009
Merged
craicoverflow merged 1 commit intoredhat-developer:mainfrom Sep 1, 2021
alexal:fix/http_npr_body
Merged
fix: fixed NPR when validating Kafka name#1009craicoverflow merged 1 commit intoredhat-developer:mainfrom alexal:fix/http_npr_body
craicoverflow merged 1 commit intoredhat-developer:mainfrom
alexal:fix/http_npr_body
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been testing rhoas CLI and found the following NPR. Here is the fix.
❯ ./rhoas kafka create
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x248874d]
goroutine 1 [running]:
github.com/redhat-developer/app-services-cli/pkg/kafka.(*Validator).ValidateNameIsAvailable(0xc0008d0168, 0x2616a40, 0xc0003bb560, 0x0, 0x0)
/Users/allyse/Dev/app-services-cli/pkg/kafka/kafka_util.go:109 +0x12d
github.com/AlecAivazis/survey/v2.Ask(0xc00072b3d0, 0x1, 0x1, 0x25bd7c0, 0xc0006a0100, 0xc0001e9408, 0x2, 0x2, 0x0, 0x0)
/Users/allyse/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/survey.go:329 +0x402
github.com/AlecAivazis/survey/v2.AskOne(...)
/Users/allyse/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/survey.go:251
github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/create.promptKafkaPayload(0xc00023bb00, 0x0, 0x0, 0x0)
/Users/allyse/Dev/app-services-cli/pkg/cmd/kafka/create/create.go:291 +0x3f1
github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/create.runCreate(0xc00023bb00, 0x0, 0x0)
/Users/allyse/Dev/app-services-cli/pkg/cmd/kafka/create/create.go:156 +0x189e
github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/create.NewCreateCommand.func1(0xc000630500, 0x385c928, 0x0, 0x0, 0x0, 0x0)
/Users/allyse/Dev/app-services-cli/pkg/cmd/kafka/create/create.go:109 +0x167
github.com/spf13/cobra.(*Command).execute(0xc000630500, 0x385c928, 0x0, 0x0, 0xc000630500, 0x385c928)
/Users/allyse/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc00040f180, 0x2b7c628, 0x3, 0xc00040f180)
/Users/allyse/go/pkg/mod/github.com/spf13/[email protected]/command.go:974 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
/Users/allyse/go/pkg/mod/github.com/spf13/[email protected]/command.go:902
main.main()
/Users/allyse/Dev/app-services-cli/cmd/rhoas/main.go:49 +0x2aa