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
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.
SubscriptionsByProvidercurrently returns one subscription per provider. This discards earlier subscriptions when multiple subscriptions share the sameProviderNode. 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: ChangeSubscriptionsByProviderso it retains all subscriptions for each provider node.internal/consistency/diff/spock_diff.go: UpdatecompareSubscriptionsto compare all subscriptions for the reciprocal provider.SubscriptionPairandSubscriptionDiff: Redesign the model as needed to represent multiple subscription pairs.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
ProviderNode.Backlinks