Skip to content

Conversation

@ajanikow
Copy link
Collaborator

No description provided.

@cla-bot cla-bot bot added the cla-signed label Nov 26, 2025
@ajanikow ajanikow requested a review from Copilot November 26, 2025 12:01
Copilot finished reviewing on behalf of ajanikow November 26, 2025 12:04
@ajanikow ajanikow force-pushed the bugfix/platform/ensure_topology_affinity_rules branch from 4f729a5 to c77ed7f Compare November 26, 2025 12:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This bugfix corrects the topology affinity rules for Gateway pods in ArangoDB deployments. The PR adds topology affinity rule merging that was previously missing from Gateway pods and fixes an incorrect pod affinity configuration where Gateway pods were mistakenly configured to have affinity with DBServers instead of Coordinators.

Key changes:

  • Added topology affinity rules support to Gateway pods (PodAntiAffinity, PodAffinity, and NodeAffinity)
  • Corrected Gateway pod affinity from DBServers to Coordinators
  • Added topology package import
Comments suppressed due to low confidence (1)

pkg/deployment/resources/pod_creator_gateway_pod.go:28

  • The topology import should be grouped with other internal imports after the standard library imports and external imports. Following Go convention, imports should be ordered as: stdlib, blank line, external, blank line, internal. The topology import should be moved to line 35 (after the pod import).
import (
	"context"
	"fmt"
	"math"
	"os"


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 81 to +87
a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)

a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)

Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering of affinity rule merging is inconsistent with the pattern used in MemberArangoDPod.GetPodAffinity() (lines 354-356 in pod_creator_arangod.go). In ArangoDPod, GroupSpec.Affinity is merged before topology rules, but here topology rules are merged after GroupSpec.Affinity. For consistency and to ensure GroupSpec rules can override topology rules, the topology merge should happen at line 84 (before GroupSpec.Affinity).

Suggested change
a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)
a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)
a = kresources.MergePodAffinity(a, topology.GetTopologyAffinityRules(m.context.GetName(), m.Status, m.Group, m.Member).PodAffinity)
a = kresources.MergePodAffinity(a, m.GroupSpec.Affinity)

Copilot uses AI. Check for mistakes.
@ajanikow ajanikow force-pushed the bugfix/platform/ensure_topology_affinity_rules branch from c77ed7f to d27821f Compare November 26, 2025 14:47
@ajanikow ajanikow merged commit 788269b into master Nov 26, 2025
3 checks passed
@ajanikow ajanikow deleted the bugfix/platform/ensure_topology_affinity_rules branch November 26, 2025 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants