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

Rename metapatch var in applyAllocationToGameServer #2198

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/gameserverallocations/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down