fix(aws): stamp CreatedBy=isvtest on volumes, CSI, and VPC fixtures - #559
fix(aws): stamp CreatedBy=isvtest on volumes, CSI, and VPC fixtures#559abegnoche wants to merge 2 commits into
Conversation
Orphaned EBS volumes were invisible to the CreatedBy=isvtest cleanup sweeps because the tag was never applied to them. RunInstances does not copy instance tags onto the root volume, and the EBS CSI driver only stamps its own kubernetes.io/* tags, so a detached root volume or a PVC whose PV outlived its cluster billed indefinitely with no way to attribute it to the suite. Tag the volume resource type alongside the instance via a shared owned_tag_specifications helper, stamp CreatedBy onto dynamically provisioned CSI volumes and the static CSI volume, add the tag to the FSx Lustre security group and the EKS Terraform stack, and surface a failed old-root-volume delete in the reinstall JSON instead of only on stderr. Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
Post-create tagging left a window where an interrupted network setup could orphan a VPC with only a Name tag. Apply ownership via TagSpecifications on create so cleanup sweeps can always find them. Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.com>
📝 WalkthroughWalkthroughAWS resource creation and launch paths now apply consistent ChangesAWS ownership tracking
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-07-27 19:22:56 UTC | Commit: cf38508 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@isvctl/configs/providers/aws/scripts/bare_metal/reinstall_instance.py`:
- Around line 481-494: Update the post-success cleanup branch in the reinstall
flow around delete_with_retry so a failed old-volume deletion sets
result["success"] to false, causing the command to return exit code 1. Introduce
and use a dedicated swap_completed state to ensure failure cleanup does not
delete new_volume_id, which is already the active root volume.
In `@isvctl/configs/providers/aws/scripts/network/create_vpc.py`:
- Around line 121-126: The strict fake create_subnet method in
test_aws_network_scripts.py must accept the TagSpecifications keyword used by
create_vpc. Update that test double to capture and assert the creation-time
subnet tag specification, while preserving its existing subnet behavior and
validations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: d8bc744c-9d79-4e69-8da5-be8cabce2317
📒 Files selected for processing (10)
isvctl/configs/providers/aws/scripts/bare_metal/launch_instance.pyisvctl/configs/providers/aws/scripts/bare_metal/reinstall_instance.pyisvctl/configs/providers/aws/scripts/common/ec2.pyisvctl/configs/providers/aws/scripts/common/fsx.pyisvctl/configs/providers/aws/scripts/eks/setup.shisvctl/configs/providers/aws/scripts/eks/terraform/main.tfisvctl/configs/providers/aws/scripts/network/create_vpc.pyisvctl/configs/providers/aws/scripts/vm/launch_instance.pyisvctl/tests/providers/aws/test_aws_network_scripts.pyisvctl/tests/providers/aws/test_aws_verified_reuse.py
Summary
RunInstancestime (instance tags are not copied to volumes), and surface failed old-root deletes from bare-metal reinstall in JSONCreatedBy=isvteston FSx Lustre SGs, static CSI volumes, dynamic EBS CSI volumes (tagSpecification_1), and EKS Terraform default/local tagsTagSpecificationsincreate_vpc.pyso interrupted network setup cannot leave untagged shared VPCsTest plan
make lint/uvx pre-commit run -amake test(prior commit) and targeted AWS provider tests for ownership tagging / network scriptsvm/bare_metallaunch showsCreatedBy=isvteston the root volumecreate_networkVPC/subnets/SG carryCreatedBy=isvtestat create timeCreatedBy=isvtestSummary by CodeRabbit
Improvements
Tests