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

silk-datastore-syncer: fix assignment to entry in nil map in Metadata field #105

Merged
merged 2 commits into from
Dec 19, 2023

Conversation

gmllt
Copy link
Member

@gmllt gmllt commented Dec 19, 2023

Trying to fix panic assignment to entry in nil map in silk-datastore-syncer code.

When unmarshalling container infos in corresponding struct datastore.Container, Metadata map isn't always instantiated, resulting in a panic error when silk-datastore-syncer tries to store a log_config entry into it.

The panic encountered using v3.30.0 (same on v3.39.0) :

panic: assignment to entry in nil map

goroutine 1 [running]:
main.main()
/var/vcap/data/compile/silk-datastore-syncer/src/code.cloudfoundry.org/silk-datastore-syncer/main.go:106 +0xf52

@gmllt gmllt requested a review from a team as a code owner December 19, 2023 10:54
@MarcPaquette
Copy link
Contributor

Hi @gmllt
Would it be possible to devise a test case for this code change?
Thanks,
@MarcPaquette

Copy link

linux-foundation-easycla bot commented Dec 19, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@gmllt gmllt force-pushed the fix-assignement-to-nil-map branch from aab7f0d to 5dbde8f Compare December 19, 2023 16:00
@gmllt
Copy link
Member Author

gmllt commented Dec 19, 2023

@MarcPaquette, I've added a test.

@MarcPaquette MarcPaquette merged commit 16c9af6 into cloudfoundry:develop Dec 19, 2023
1 check passed
@MarcPaquette
Copy link
Contributor

Thanks for the contribution @gmllt !

@gmllt gmllt deleted the fix-assignement-to-nil-map branch December 19, 2023 16:53
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.

2 participants