Bug: Prevent nil pointer panic in deployment metadata updates
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
Bug: Prevent nil pointer panic in deployment metadata updates
Description
UpdateSharedMetadata() and UpdatePluginMetadata() in
pkg/datastore/deploymentstore.go can panic when called with a
deployment whose MetadataV2 field is nil.
Both methods access fields of MetadataV2 without first checking whether
the pointer has been initialized.
Affected Functions
UpdateSharedMetadata()UpdatePluginMetadata()
File:
pkg/datastore/deploymentstore.go
Current Behavior
When MetadataV2 == nil, calling UpdateSharedMetadata() results in a
nil pointer dereference while accessing:
d.MetadataV2.Shared
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/datastore/deploymentstore.go by reading UpdateSharedMetadata() and UpdatePluginMetadata(). Reproduce each path with a deployment whose MetadataV2 is nil, then verify both methods complete without a nil pointer panic while preserving their metadata-update behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 74/100