From 2864e198833e82f3d5d6bf83bcd778d9e4e3c186 Mon Sep 17 00:00:00 2001 From: Mark Mandel Date: Tue, 27 Jul 2021 15:29:43 -0700 Subject: [PATCH] Rename metapatch var in applyAllocationToGameServer Minor fix from a PR comment that I had in the backlog but hadn't submitted yet. Fix for https://github.com/googleforgames/agones/pull/2148#discussion_r656488359 --- pkg/gameserverallocations/allocator.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/gameserverallocations/allocator.go b/pkg/gameserverallocations/allocator.go index c66f6c4ae1..20c762027f 100644 --- a/pkg/gameserverallocations/allocator.go +++ b/pkg/gameserverallocations/allocator.go @@ -570,22 +570,22 @@ func (c *Allocator) allocationUpdateWorkers(ctx context.Context, workerCount int // applyAllocationToGameServer patches the inputted GameServer with the allocation metadata changes, and updates it to the Allocated State. // Returns the updated GameServer. -func (c *Allocator) applyAllocationToGameServer(ctx context.Context, fam allocationv1.MetaPatch, gs *agonesv1.GameServer) (*agonesv1.GameServer, error) { +func (c *Allocator) applyAllocationToGameServer(ctx context.Context, mp allocationv1.MetaPatch, gs *agonesv1.GameServer) (*agonesv1.GameServer, error) { // patch ObjectMeta labels - if fam.Labels != nil { + if mp.Labels != nil { if gs.ObjectMeta.Labels == nil { - gs.ObjectMeta.Labels = make(map[string]string, len(fam.Labels)) + gs.ObjectMeta.Labels = make(map[string]string, len(mp.Labels)) } - for key, value := range fam.Labels { + for key, value := range mp.Labels { gs.ObjectMeta.Labels[key] = value } } if gs.ObjectMeta.Annotations == nil { - gs.ObjectMeta.Annotations = make(map[string]string, len(fam.Annotations)) + gs.ObjectMeta.Annotations = make(map[string]string, len(mp.Annotations)) } // apply annotations patch - for key, value := range fam.Annotations { + for key, value := range mp.Annotations { gs.ObjectMeta.Annotations[key] = value }