Skip to content

Revert "CNTRLPLANE-2205: Auto-detect shared role use and enable for e2e" - #7365

Merged
openshift-merge-bot[bot] merged 1 commit into
mainfrom
revert-7356-e2e-shared-role-2
Dec 10, 2025
Merged

Revert "CNTRLPLANE-2205: Auto-detect shared role use and enable for e2e"#7365
openshift-merge-bot[bot] merged 1 commit into
mainfrom
revert-7356-e2e-shared-role-2

Conversation

@sjenning

@sjenning sjenning commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Reverts #7356

There is some transient issue with the ingress-operator cloud cred secret not being reconciled.

Per TRT SOP, reverting to get jobs reliable again.


Note

Adds CLI flags to delete either the shared IAM role or per-component roles, refactors role deletion API/flows (incl. shared VPC), and makes shared role creation use inline policies; updates e2e defaults accordingly.

  • AWS IAM/CLI
    • Add --shared-role flag to cmd/cluster/aws destroy and cmd/infra/aws destroy-iam to choose deleting the shared IAM role vs per-component roles.
    • Pass AWSPlatform.SharedRole through to DestroyIAMOptions.
  • IAM Destroy Refactor
    • Change DestroyOIDCRole signature to return error and accept includeAssumePolicy boolean; update all call sites (incl. shared VPC roles).
    • Implement conditional deletion: shared-role when SharedRole is true; otherwise delete individual roles (e.g., openshift-ingress, control-plane-operator, etc.).
  • IAM Create (Shared Role)
    • For CreateSharedOIDCRole, attach all permissions as inline policies (remove managed policy attachment path) and add optional assume policy inline.
  • E2E
    • Stop forcing per-component roles in TestCreateCluster and remove default SharedRole setting from AWS test options.

Written by Cursor Bugbot for commit 0f08f53. This will update automatically on new commits. Configure here.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Dec 10, 2025
@openshift-ci-robot

openshift-ci-robot commented Dec 10, 2025

Copy link
Copy Markdown

@sjenning: This pull request references CNTRLPLANE-2205 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 story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Reverts #7356

There is some transient issue with the ingress-operator cloud cred secret not being reconciled.

Per TRT SOP, reverting to get jobs reliable again.

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.

@openshift-ci-robot

openshift-ci-robot commented Dec 10, 2025

Copy link
Copy Markdown

@sjenning: This pull request references CNTRLPLANE-2205 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 story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Reverts #7356

There is some transient issue with the ingress-operator cloud cred secret not being reconciled.

Per TRT SOP, reverting to get jobs reliable again.


[!NOTE]
Cursor Bugbot is generating a summary for commit 0f08f53. Configure here.

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.

@coderabbitai

coderabbitai Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes add a SharedRole flag to control AWS IAM role deletion behavior, updating the DestroyOIDCRole method signature and conditional destruction logic while simplifying shared OIDC role creation to exclusively use inline policies instead of ROSA-managed policies.

Changes

Cohort / File(s) Summary
AWS IAM destruction updates
cmd/cluster/aws/destroy.go, cmd/infra/aws/destroy_iam.go
Added SharedRole field to DestroyIAMOptions; changed DestroyOIDCRole signature from (client, name) → (removed bool, error) to (client, name, includeAssumePolicy bool) → error; updated DestroyOIDCResources to conditionally delete shared or individual component roles based on SharedRole flag; modified DestroySharedVPCRoles with includeAssumePolicy flags.
Shared OIDC role creation
cmd/infra/aws/iam.go
Simplified CreateSharedOIDCRole to always add policies as inline policies via PutRolePolicy; removed conditional ROSA-managed policy attachment logic.
Test configuration updates
test/e2e/create_cluster_test.go, test/e2e/util/options.go
Removed AWS-specific SharedRole = false enforcement in TestCreateCluster; removed SharedRole initialization in DefaultAWSOptions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Method signature change tracking: Verify all DestroyOIDCRole call sites pass the new includeAssumePolicy parameter correctly across destruction code paths.
  • Conditional deletion logic: Confirm the SharedRole flag properly routes between shared-role-only deletion and individual component role deletion branches.
  • Error propagation: Ensure error handling changes from the removed bool return value are correctly implemented throughout.
  • Test implications: Validate that removing SharedRole defaults doesn't introduce unexpected behavior in test scenarios or default cluster configurations.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-7356-e2e-shared-role-2

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci-robot

openshift-ci-robot commented Dec 10, 2025

Copy link
Copy Markdown

@sjenning: This pull request references CNTRLPLANE-2205 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 story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

Reverts #7356

There is some transient issue with the ingress-operator cloud cred secret not being reconciled.

Per TRT SOP, reverting to get jobs reliable again.


[!NOTE]
Adds CLI flags to delete either the shared IAM role or per-component roles, refactors role deletion API/flows (incl. shared VPC), and makes shared role creation use inline policies; updates e2e defaults accordingly.

  • AWS IAM/CLI
    • Add --shared-role flag to cmd/cluster/aws destroy and cmd/infra/aws destroy-iam to choose deleting the shared IAM role vs per-component roles.
    • Pass AWSPlatform.SharedRole through to DestroyIAMOptions.
  • IAM Destroy Refactor
    • Change DestroyOIDCRole signature to return error and accept includeAssumePolicy boolean; update all call sites (incl. shared VPC roles).
    • Implement conditional deletion: shared-role when SharedRole is true; otherwise delete individual roles (e.g., openshift-ingress, control-plane-operator, etc.).
  • IAM Create (Shared Role)
    • For CreateSharedOIDCRole, attach all permissions as inline policies (remove managed policy attachment path) and add optional assume policy inline.
  • E2E
    • Stop forcing per-component roles in TestCreateCluster and remove default SharedRole setting from AWS test options.

Written by Cursor Bugbot for commit 0f08f53. This will update automatically on new commits. Configure here.

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.

@openshift-ci
openshift-ci Bot requested review from bryan-cox and jparrill December 10, 2025 15:07
@openshift-ci openshift-ci Bot added the area/cli Indicates the PR includes changes for CLI label Dec 10, 2025
@openshift-ci

openshift-ci Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sjenning

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added area/platform/aws PR/issue for AWS (AWSPlatform) platform approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Indicates the PR includes changes for e2e testing and removed do-not-merge/needs-area labels Dec 10, 2025
@sjenning

Copy link
Copy Markdown
Contributor Author

/override ci/prow/e2e-aks
/override ci/prow/e2e-aks-4-20
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-kubevirt-aws-ovn-reduced

@openshift-ci

openshift-ci Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

@sjenning: Overrode contexts on behalf of sjenning: ci/prow/e2e-aks, ci/prow/e2e-aks-4-20, ci/prow/e2e-aws, ci/prow/e2e-aws-upgrade-hypershift-operator, ci/prow/e2e-kubevirt-aws-ovn-reduced

Details

In response to this:

/override ci/prow/e2e-aks
/override ci/prow/e2e-aks-4-20
/override ci/prow/e2e-aws
/override ci/prow/e2e-aws-upgrade-hypershift-operator
/override ci/prow/e2e-kubevirt-aws-ovn-reduced

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 kubernetes-sigs/prow repository.

@openshift openshift deleted a comment from openshift-ci Bot Dec 10, 2025
@openshift openshift deleted a comment from openshift-ci Bot Dec 10, 2025
@sjenning

Copy link
Copy Markdown
Contributor Author

/override ci/prow/e2e-aws-4-20

@openshift-ci

openshift-ci Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

@sjenning: Overrode contexts on behalf of sjenning: ci/prow/e2e-aws-4-20

Details

In response to this:

/override ci/prow/e2e-aws-4-20

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 kubernetes-sigs/prow repository.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
cmd/infra/aws/destroy_iam.go (1)

191-191: Unused parameter includeAssumePolicy.

The includeAssumePolicy parameter is never referenced within the function body. The function deletes all inline policies via ListRolePolicies (lines 222-248), which inherently includes assume policies, making this parameter ineffective.

Since this is a revert PR to restore job reliability, this can be addressed in a follow-up cleanup.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 23cb8b3 and 0f08f53.

📒 Files selected for processing (5)
  • cmd/cluster/aws/destroy.go (1 hunks)
  • cmd/infra/aws/destroy_iam.go (8 hunks)
  • cmd/infra/aws/iam.go (1 hunks)
  • test/e2e/create_cluster_test.go (0 hunks)
  • test/e2e/util/options.go (0 hunks)
💤 Files with no reviewable changes (2)
  • test/e2e/util/options.go
  • test/e2e/create_cluster_test.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.

Files:

  • cmd/cluster/aws/destroy.go
  • cmd/infra/aws/destroy_iam.go
  • cmd/infra/aws/iam.go
🧬 Code graph analysis (1)
cmd/cluster/aws/destroy.go (1)
api/hypershift/v1beta1/hostedcluster_types.go (1)
  • AWSPlatform (1188-1188)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Red Hat Konflux / hypershift-operator-main-on-pull-request
  • GitHub Check: Red Hat Konflux / hypershift-cli-mce-211-on-pull-request
  • GitHub Check: Red Hat Konflux / hypershift-release-mce-211-on-pull-request
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (6)
cmd/infra/aws/iam.go (1)

1032-1044: LGTM!

The simplified inline policy creation loop correctly attaches each binding's policy to the shared role. Error handling and logging are appropriate.

cmd/infra/aws/destroy_iam.go (4)

32-32: LGTM!

The SharedRole field is correctly added to control IAM deletion behavior, aligning with the broader SharedRole concept.


53-53: LGTM!

CLI flag correctly exposed for operator control.


151-185: LGTM!

The conditional deletion logic correctly handles both shared and individual role scenarios. The list of component roles matches those created in CreateOIDCResources.


360-366: LGTM!

The calls are consistent with the updated signature.

cmd/cluster/aws/destroy.go (1)

100-109: LGTM!

The SharedRole field is correctly passed through to DestroyIAMOptions, enabling consistent handling of shared vs. individual role deletion.

@sjenning

Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2025
@sjenning

Copy link
Copy Markdown
Contributor Author

Fix found #7366

@sjenning

Copy link
Copy Markdown
Contributor Author

/verified by @sjenning

@sjenning sjenning added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Dec 10, 2025
@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Dec 10, 2025
@openshift-ci-robot

Copy link
Copy Markdown

@sjenning: This PR has been marked as verified by @sjenning.

Details

In response to this:

/verified by @sjenning

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.

@sjenning sjenning added the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2025
@sjenning

Copy link
Copy Markdown
Contributor Author

/hold cancel

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2025
@openshift-merge-bot
openshift-merge-bot Bot merged commit e4909e1 into main Dec 10, 2025
21 checks passed
@openshift-ci

openshift-ci Bot commented Dec 10, 2025

Copy link
Copy Markdown
Contributor

@sjenning: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@celebdor
celebdor deleted the revert-7356-e2e-shared-role-2 branch February 6, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cli Indicates the PR includes changes for CLI area/platform/aws PR/issue for AWS (AWSPlatform) platform area/testing Indicates the PR includes changes for e2e testing jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants