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

fix nil pointer when gcp config is incorrect + normalize labels of stats #130

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

Issif
Copy link
Member

@Issif Issif commented Nov 29, 2020

Signed-off-by: Issif issif_github@gadz.org

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area config

/area outputs

/area tests

/area helm

What this PR does / why we need it:

When GCP configuration was incorrect, the output was not correctly disabled, it triggered a nil pointer dereference error at first event and a crash of falcosidekick.

2020/11/29 19:48:44 [ERROR] : GCP - Error while base64-decoding GCP Credentials
2020/11/29 19:48:44 [INFO]  : Enabled Outputs : 
2020/11/29 19:48:44 [INFO]  : Falco Sidekick is up and listening on port 2801
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x18ec417]

goroutine 26 [running]:
github.com/falcosecurity/falcosidekick/outputs.(*Client).GCPPublishTopic(0x0, 0xc000128000, 0x21, 0xc000126858, 0x5, 0xc000126880, 0x9, 0x0, 0xed755e410, 0x0, ...)
        /Users/thomas/Src/github/falcosidekick/outputs/gcp.go:52 +0x37
created by main.forwardEvent
        /Users/thomas/Src/github/falcosidekick/handlers.go:183 +0x2c5

Which issue(s) this PR fixes:

N/A

Fixes #

Special notes for your reviewer:

thanks to @leogr who spotted that bug

…ats with declared constants

Signed-off-by: Issif <issif_github@gadz.org>
@poiana poiana added the kind/bug Something isn't working label Nov 29, 2020
@poiana
Copy link

poiana commented Nov 29, 2020

@Issif: The label(s) area/config cannot be applied, because the repository doesn't have them

In response to this:

Signed-off-by: Issif issif_github@gadz.org

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area config

/area outputs

/area tests

/area helm

What this PR does / why we need it:

When GCP configuration was incorrect, the output was not correctly disabled, it triggered a nil pointer dereference error at fist event and a crash of falcosidekick.

2020/11/29 19:48:44 [ERROR] : GCP - Error while base64-decoding GCP Credentials
2020/11/29 19:48:44 [INFO]  : Enabled Outputs : 
2020/11/29 19:48:44 [INFO]  : Falco Sidekick is up and listening on port 2801
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x18ec417]

goroutine 26 [running]:
github.com/falcosecurity/falcosidekick/outputs.(*Client).GCPPublishTopic(0x0, 0xc000128000, 0x21, 0xc000126858, 0x5, 0xc000126880, 0x9, 0x0, 0xed755e410, 0x0, ...)
       /Users/thomas/Src/github/falcosidekick/outputs/gcp.go:52 +0x37
created by main.forwardEvent
       /Users/thomas/Src/github/falcosidekick/handlers.go:183 +0x2c5

Which issue(s) this PR fixes:

N/A

Fixes #

Special notes for your reviewer:

thanks to @leogr who spotted that bug

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

thank you!

@poiana
Copy link

poiana commented Nov 30, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented Nov 30, 2020

LGTM label has been added.

Git tree hash: 3fa0dc992d46f1a1b5e89d91d6076ebc626cdab1

@poiana poiana merged commit c4bd8d0 into master Nov 30, 2020
@poiana poiana deleted the fix-nil-pointer-gcp branch November 30, 2020 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants