Skip to content

Support multiple Spock subscriptions per provider in topology comparison #164

Description

@coderabbitai

Summary

The Spock topology comparison currently assumes that a subscriber has at most one subscription for each provider node. Spock permits multiple subscriptions from the same target node to the same provider node. Each subscription can have independent replication sets and enablement state.

SubscriptionsByProvider currently returns one subscription per provider. This discards earlier subscriptions when multiple subscriptions share the same ProviderNode. The reciprocal subscription comparison can therefore omit configuration differences.

Required changes

Redesign the subscription comparison to retain and compare every subscription for each provider node.

Update these areas together:

  • internal/consistency/topology/spock.go: Change SubscriptionsByProvider so it retains all subscriptions for each provider node.
  • internal/consistency/diff/spock_diff.go: Update compareSubscriptions to compare all subscriptions for the reciprocal provider.
  • SubscriptionPair and SubscriptionDiff: Redesign the model as needed to represent multiple subscription pairs.
  • JSON output: Define and test the updated JSON contract for multi-subscription findings.

Rationale

A map from provider node to one subscription loses data when a target node has more than one subscription from that provider. The comparison must preserve differences in replication sets and subscription enablement for every subscription.

Acceptance criteria

  • The comparison does not discard subscriptions that share a ProviderNode.
  • The comparison reports differences for every subscription associated with a reciprocal provider.
  • The comparison behavior is deterministic.
  • Tests cover multiple subscriptions from one provider with distinct replication sets and enablement states.
  • Tests cover the revised JSON output contract.

Backlinks

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions