Skip to content

fix(serviceaccount): initialize annotations map in ReplicateDataFrom to avoid nil panic#423

Open
AruneshDwivedi wants to merge 1 commit into
mittwald:masterfrom
AruneshDwivedi:fix/serviceaccount-nil-annotations
Open

fix(serviceaccount): initialize annotations map in ReplicateDataFrom to avoid nil panic#423
AruneshDwivedi wants to merge 1 commit into
mittwald:masterfrom
AruneshDwivedi:fix/serviceaccount-nil-annotations

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

ReplicateDataFrom wrote ReplicatedAt/ReplicatedFromVersion annotations into targetCopy without guaranteeing the map was non-nil. When the target ServiceAccount had no annotations (nil map from DeepCopy), this panicked with an assignment to entry in nil map. The map is now allocated when nil, mirroring the guard already present in ReplicateObjectTo.

…to avoid nil panic

ReplicateDataFrom wrote ReplicatedAt/ReplicatedFromVersion annotations
into targetCopy without guaranteeing the map was non-nil. When the target
ServiceAccount had no annotations (nil map from DeepCopy), this panicked
with an assignment to entry in nil map. The map is now allocated when nil,
mirroring the guard already present in ReplicateObjectTo.

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
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.

1 participant