CNTRLPLANE-3568: test(e2e): verify AWS additional-tags propagation to guest infrastruc…#8712
CNTRLPLANE-3568: test(e2e): verify AWS additional-tags propagation to guest infrastruc…#8712mgencur wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@mgencur: This pull request references CNTRLPLANE-3568 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an AWS-only E2E test, EnsureInfrastructureResourceTagsTest, that runs for AWS HostedClusters with AWS spec tags (excluding keys starting with "kubernetes.io"). The test fetches the guest cluster's configv1.Infrastructure (infrastructure/cluster), asserts AWS platform status and non-empty ResourceTags, verifies each expected tag exists, and checks the status tag list length matches the filtered expected set. The file imports configv1 and registers the new test in RegisterHostedClusterAWSTests. Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8712 +/- ##
==========================================
+ Coverage 41.50% 41.54% +0.04%
==========================================
Files 758 758
Lines 93689 93838 +149
==========================================
+ Hits 38882 38986 +104
- Misses 52070 52107 +37
- Partials 2737 2745 +8 see 9 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@test/e2e/v2/tests/hosted_cluster_aws_test.go`:
- Around line 131-138: Rename user-facing strings in the
EnsureGuestInfrastructureResourceTagsTest function to use "hosted cluster"
terminology: replace occurrences of "guest cluster infrastructure resource" and
"guest infrastructure resource tags test" with phrasing like "infrastructure
resource in the hosted cluster" or "hosted cluster infrastructure resource tags
test" (update the When/It descriptions and any Skip message). Ensure the
function name and any log/test labels remain unchanged unless you want to also
rename the function; focus on updating the human-readable test descriptions
inside EnsureGuestInfrastructureResourceTagsTest and the Skip message that
checks hc.Spec.Platform.Type.
- Around line 160-181: The test uses incorrect "guest cluster"/"guest
infrastructure" wording in its Expect diagnostic messages; update the messages
in the block that calls ValidateHostedClusterClient() / GetHostedClusterClient()
and checks infra.Status.PlatformStatus.AWS.ResourceTags so that "guest cluster"
becomes "hosted cluster" and "guest infrastructure" becomes "infrastructure in
the hosted cluster" (or "hosted cluster infrastructure") — specifically change
the Expect failure text for the Get() call and the two later Expect message
strings that mention the cluster/infrastructure to the corrected terminology.
- Around line 140-158: The test currently fails if no AWS resource tags exist by
asserting specTags and expectedTags are non-empty; instead, change the checks in
the HostedCluster tag verification to Skip the test when preconditions are
absent: inspect specTags (and the computed expectedTags) in the test body
(symbols: specTags, expectedTags, HostedCluster hc) and call Skip("no AWS
resource tags configured; skipping test") when either is empty rather than using
Expect(...).NotTo(BeEmpty()), ensuring the test remains read-only and only
verifies existing state.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 337450e5-3b8e-42c5-a0b0-9e0a69486882
📒 Files selected for processing (1)
test/e2e/v2/tests/hosted_cluster_aws_test.go
093459a to
1471ac1
Compare
Recommended Improvements
|
…ture Add a v2 e2e test that reads the HostedCluster's spec.platform.aws.resourceTags and verifies they appear in the guest cluster's infrastructure/cluster .status.platformStatus.aws.resourceTags. Tags with the kubernetes.io prefix are filtered to match the production logic in support/globalconfig/infrastructure.go. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1471ac1 to
ef4ee5c
Compare
Done. Also fixed the other two suggestion. |
|
@mgencur: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enxebre, mgencur The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
mehabhalodiya
left a comment
There was a problem hiding this comment.
Have we verified that one of the existing AWS v2 E2E lanes provisions a HostedCluster with spec.platform.aws.resourceTags configured? Otherwise, this test may always skip and never provide coverage.
This is probably the most important thing to verify.
This run if from a different PR and includes the resoiurceTags: When you put lgtm CI will run E2E tests and we'll see it on this PR as well. |
…ture
What this PR does / why we need it:
Add a v2 e2e test that reads the HostedCluster's spec.platform.aws.resourceTags and verifies they appear in the guest cluster's infrastructure/cluster .status.platformStatus.aws.resourceTags. Tags with the kubernetes.io prefix are filtered to match the production logic in support/globalconfig/infrastructure.go.
Covers https://redhat.atlassian.net/browse/CNTRLPLANE-3568
The original test logic has a few more assertions but they are already tested in other parts of the E2E test suite. This new PR only covers what was left - propagating resource tags from HostedCluster to Infrastructure on guest cluster.
Which issue(s) this PR fixes:
Fixes
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit