You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gatewayapi,ir,xds/translator: naming and comment cleanup from code review
- Rename btpClusterSettingsHasSettings to btpSpecHasClusterScopedFields
(and its test) - the old name read as testing "ClusterSettings" the
struct, when it actually checks the whole BackendTrafficPolicySpec for
any CDS-scoped field.
- Trim ir.BackendCluster.Merged's doc comment to a one-liner, consistent
with the struct's other fields.
- Rewrite singleResolvedClusterName's comment: frame the registry-lookup
indirection as xds/translator defensively protecting itself against
not-necessarily-well-formed data from an earlier layer, rather than
tracing specific (and driftable) legit code paths that could produce a
ref-without-registration.
- Rename mergeIncompatibleForRule/mergeIncompatibleForNonWeightedRule to
mergeIncompatibleForWeightedRule/mergeIncompatibleForSingleClusterRule -
the old names read as a general case and a negated special case of it,
when they're actually independent implementations for two route-type
families distinguished by whether their route action supports weighted
clusters. Split mergeIncompatibleForSingleClusterRule's combined boolean
into guard clauses with a comment per condition, matching the sibling
function's established style.
- mergeIncompatibleForWeightedRule: add a comment to the len(backendRefs)
<= 1 guard, and restructure the final ConsistentHash condition into an
explicit if/return true with a trailing return false, for consistency
with the other guard clauses. Its position (checked before session
persistence, fallback backend, and ConsistentHash) is intentional and
unchanged: those three checks protect a multi-backend pool from
fragmenting, which doesn't apply when there's nothing to fragment.
Signed-off-by: Muhammad Waqar <waqar.hameed08@gmail.com>
0 commit comments