OCPBUGS-126492: aws: fix destroy hang when custom service endpoints target a different region #11034
All Vouch review confidence checks passed
Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 310 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.343
Real PR Conversation Timeline
1 comments
"Review active on #11034"
general
weight: 0.35
sadasu
Summary
When
openshift-install destroy clusterruns on a cluster with custom service endpoints (e.g., for a private VPC endpoint), the destroy process can hang indefinitely if the install region differs from the partition's global region (which it almost always does).Root Cause
The installer creates secondary tagging clients for global regions (e.g.,
us-east-1for Route53 hosted zone lookups). These clients were receiving the user's customServiceEndpointlist, which is specific to the install region. SinceServiceEndpointhas no region dimension, the endpoint resolver would set the URL to the install-region endpoint while the SigV4 signing region was set to the global region, causing an authentication failure.The persistent auth error caused
FindTaggedResourcesToDeleteto retain the failing tag client on every poll iteration, keepingloopErrornon-nil and preventing thewait.PollImmediateUntilcondition from ever being satisfied. SinceRun()usescontext.Background()(no deadline), the destroy process looped forever.Fix
Adds an
endpointsForRegion()helper method that returns custom endpoints only when the target region matches the install region. For cross-region tagging clients,nilendpoints are passed, so the AWS SDK resolves the default endpoint for that region.This ensures:
Testing
endpointsForRegion()covering all region match/mismatch scenariosgo vetandgofmtpass clean/jira refresh
Related: OCPBUGS-86052
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
AWS cluster removal now selects configured service endpoints based on the requested region. In the installation region, configured endpoints remain unchanged; in other regions, tagging endpoints are excluded while other endpoints, including STS where available, are preserved.
* This selection applies to assumed-role and cross-region tagging requests. Other AWS requests continue to use all configured endpoints.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->