Skip to content

aro-hcp: add tenant-level cluster profiles for prow jobs that span tenant-level permissions#5097

Open
bennerv wants to merge 1 commit intoopenshift:mainfrom
bennerv:bvesel/add-aro-hcp-tenant-cluster-profiles
Open

aro-hcp: add tenant-level cluster profiles for prow jobs that span tenant-level permissions#5097
bennerv wants to merge 1 commit intoopenshift:mainfrom
bennerv:bvesel/add-aro-hcp-tenant-cluster-profiles

Conversation

@bennerv
Copy link
Copy Markdown

@bennerv bennerv commented Apr 9, 2026

These new cluster profiles will be used by periodic cleanup jobs in openshift/release to clean up orphaned app registrations with expired credentials across ARO-HCP tenants.

These are tenant-level cluster profiles for ARO HCP as opposed to subscription-scoped / environment specific ones.

These new cluster profiles will be used by periodic cleanup jobs
in openshift/release to clean up orphaned app registrations with
expired credentials across ARO-HCP tenants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 9, 2026 20:10
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Walkthrough

Added two new ClusterProfile constants for ARO HCP multi-tenant scenarios: ClusterProfileAROHCPRedHatTenant and ClusterProfileAROHCPMsftTestTenant. Updated the ClusterProfiles() function and extended ClusterType() and LeaseType() methods to handle the new profile mappings.

Changes

Cohort / File(s) Summary
ClusterProfile enhancements
pkg/api/types.go
Added two new ClusterProfile constants and updated ClusterProfiles(), ClusterType(), and LeaseType() methods to include mappings for the new "aro-hcp-red-hat-tenant" and "aro-hcp-msft-test-tenant" profiles with corresponding quota-slice lease types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@bennerv bennerv changed the title Add aro-hcp-red-hat-tenant and aro-hcp-msft-test-tenant cluster profiles aro-hcp: add tenant-level cluster profiles for prow jobs that span tenant-level permissions Apr 9, 2026
@openshift-ci openshift-ci bot requested review from jmguzik and psalajova April 9, 2026 20:12
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bennerv
Once this PR has been reviewed and has the lgtm label, please assign droslean for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds two new ARO-HCP tenant-level cluster profiles intended for periodic cleanup jobs (in openshift/release) to target orphaned app registrations with expired credentials.

Changes:

  • Introduced aro-hcp-red-hat-tenant and aro-hcp-msft-test-tenant cluster profile constants.
  • Registered the new profiles in the global ClusterProfiles() list.
  • Added ClusterType() and LeaseType() mappings for the new profiles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +2081 to +2084
case ClusterProfileAROHCPRedHatTenant:
return "aro-hcp-red-hat-tenant"
case ClusterProfileAROHCPMsftTestTenant:
return "aro-hcp-msft-test-tenant"
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

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

New ARO-HCP tenant profiles introduce new ClusterType values ("aro-hcp-red-hat-tenant" and "aro-hcp-msft-test-tenant"), but LeaseTypeFromClusterType’s allowlist (later in this file) does not include them. As a result, callers that convert from cluster-type -> lease-type will get invalid cluster type for these new profiles. Please add these two cluster types to the allowlist (or otherwise make the mapping handle them).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/api/types.go`:
- Around line 2081-2084: LeaseTypeFromClusterType() currently rejects the two
new cluster constants ClusterProfileAROHCPRedHatTenant and
ClusterProfileAROHCPMsftTestTenant that were added in the switch (which causes
"invalid cluster type" at runtime); update LeaseTypeFromClusterType to include
case branches for ClusterProfileAROHCPRedHatTenant and
ClusterProfileAROHCPMsftTestTenant and return the appropriate LeaseType values
(use the same LeaseType used for other ARO HCP-related cluster cases), ensuring
the function's switch covers these new constants and the default error remains
unchanged.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd04ade5-c7ad-482f-8438-038a8f3564d2

📥 Commits

Reviewing files that changed from the base of the PR and between 136ce6a and a52a7a1.

📒 Files selected for processing (1)
  • pkg/api/types.go

Comment on lines +2081 to +2084
case ClusterProfileAROHCPRedHatTenant:
return "aro-hcp-red-hat-tenant"
case ClusterProfileAROHCPMsftTestTenant:
return "aro-hcp-msft-test-tenant"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add the new ARO HCP tenant cluster types to LeaseTypeFromClusterType().

Lines 2081-2084 add new cluster type outputs, but LeaseTypeFromClusterType() still rejects both values. That creates an internal mapping inconsistency and can surface as invalid cluster type at runtime in conversion paths.

Suggested fix
--- a/pkg/api/types.go
+++ b/pkg/api/types.go
@@
-		"metal-redhat-gs", "aro-hcp-int", "aro-hcp-stg", "aro-hcp-prod", "aro-hcp-dev", "rosa-regional-platform-int", "hyperfleet-e2e",
+		"metal-redhat-gs", "aro-hcp-int", "aro-hcp-stg", "aro-hcp-prod", "aro-hcp-dev", "aro-hcp-red-hat-tenant", "aro-hcp-msft-test-tenant", "rosa-regional-platform-int", "hyperfleet-e2e",

As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/api/types.go` around lines 2081 - 2084, LeaseTypeFromClusterType()
currently rejects the two new cluster constants ClusterProfileAROHCPRedHatTenant
and ClusterProfileAROHCPMsftTestTenant that were added in the switch (which
causes "invalid cluster type" at runtime); update LeaseTypeFromClusterType to
include case branches for ClusterProfileAROHCPRedHatTenant and
ClusterProfileAROHCPMsftTestTenant and return the appropriate LeaseType values
(use the same LeaseType used for other ARO HCP-related cluster cases), ensuring
the function's switch covers these new constants and the default error remains
unchanged.

bennerv added a commit to bennerv/release that referenced this pull request Apr 9, 2026
…ions

Add new cluster profiles (aro-hcp-red-hat-tenant, aro-hcp-msft-test-tenant)
and a periodic job to clean up orphaned app registrations with expired
credentials left by e2e test runs.

Depends on openshift/ci-tools#5097 for cluster profile registration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 9, 2026

@bennerv: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/codegen a52a7a1 link true /test codegen
ci/prow/breaking-changes a52a7a1 link false /test breaking-changes
ci/prow/images a52a7a1 link true /test images
ci/prow/lint a52a7a1 link true /test lint

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants