Skip to content

Bug: Prevent nil pointer panic in deployment metadata updates #7228

Description

@anubhavsingh2106

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions