Skip to content

Add aws-us-east-1 cluster profile#5191

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
danilo-gemoli:chore/add-aws-us-east-1-profile
May 19, 2026
Merged

Add aws-us-east-1 cluster profile#5191
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
danilo-gemoli:chore/add-aws-us-east-1-profile

Conversation

@danilo-gemoli
Copy link
Copy Markdown
Contributor

@danilo-gemoli danilo-gemoli commented May 19, 2026

and move the cluster profile related types from pkg/api/types.go to pkg/api/clusterprofile.go.
I think cluster profile are important enough to live into its own file.

Summary

This PR adds support for an aws-us-east-1 cluster profile and refactors cluster-profile API surface out of pkg/api/types.go into a dedicated file pkg/api/clusterprofile.go.

Changes

  • Adds a new ClusterProfile constant for aws-us-east-1 and includes it in the ClusterProfiles() enumeration and associated helpers.
  • Moves ~1,300 lines of cluster-profile–related types and logic from pkg/api/types.go into pkg/api/clusterprofile.go. Moved items include:
    • Core type: type ClusterProfile string and 50+ exported profile constants.
    • Mapping and helper methods: Name(), ClusterType(), LeaseType(), IPPoolLeaseType(), IPPoolLeaseShouldValidateBranch(), GetDefaultClusterProfileSecretName(), LeaseTypeFromClusterType(), ClusterProfileFromParams().
    • Konflux-related configuration types: ClusterProfileKonfluxConfig, ClusterProfilesList (with Resolve()), ClusterProfilesMap, ClusterProfileDetails, ClusterProfileKonfluxOwner, ClusterProfileOwners, ClusterClaimOwnersMap.
    • ClusterProfileSetDetails migration/unmarshal logic and the new ClusterProfileSetDetailsNew structure with FindSetByProfile() and IsTestAllowlisted().
  • Adjusts pkg/api/types.go by removing the cluster-profile definitions and adding a new optional field Clone *bool to ContainerTestConfiguration.

Affected components and behavior

  • ci-operator / configuration layer: The API types used for job/config generation and cluster-selection logic are reorganized. All existing profile behavior is preserved, but the cluster-profile API now lives in its own file for easier maintenance.
  • Provisioning/lease/secret mapping: The new profile is available to code that maps profiles to cluster types, lease types, IP pool lease types, and default secret names—so provisioning and quota/lease selection that rely on those mappings will accept aws-us-east-1.
  • Konflux/profile-set resolution: The moved Konflux and profile-set logic (group expansion, deduplication, test allowlisting and schema migration) remains available from the new file and continues to drive profile-to-cluster resolution for owners and allowlists.

Practical impact for CI users and operators

  • Operators can request/target the aws-us-east-1 cluster profile in job configurations where supported; the system will map that profile to the appropriate cluster/lease/secret identifiers.
  • The refactor improves maintainability: cluster profile definitions and related resolution/migration logic are concentrated in pkg/api/clusterprofile.go, making future additions or fixes (e.g., new profiles or changes to allowlists) easier to review and extend.
  • The public API semantics are unchanged aside from the added aws-us-east-1 profile and the new optional Clone field in ContainerTestConfiguration; callers should not see behavioral regressions.

@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 May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: a6f73c32-9bbe-48d0-ac68-24aff99c6a59

📥 Commits

Reviewing files that changed from the base of the PR and between b486b15 and bdbb1a8.

📒 Files selected for processing (2)
  • pkg/api/clusterprofile.go
  • pkg/api/types.go
💤 Files with no reviewable changes (1)
  • pkg/api/types.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/api/clusterprofile.go

📝 Walkthrough

Walkthrough

Relocates cluster-profile API from pkg/api/types.go to pkg/api/clusterprofile.go, adding ClusterProfile type, enumerations, mapping helpers, Konflux resolution, and schema-migration/test-allowlist logic; also adds Clone to ContainerTestConfiguration and adjusts imports.

Changes

ClusterProfile API and refactoring

Layer / File(s) Summary
ClusterProfile core type and enumeration
pkg/api/clusterprofile.go
ClusterProfile string type and exported profile constants; enumerator and Name() accessor.
ClusterProfile mapping methods
pkg/api/clusterprofile.go
ClusterType(), LeaseType(), IPPoolLeaseType(), IPPoolLeaseShouldValidateBranch(), plus secret-name and lease-type helpers.
Parameter extraction and Konflux configuration
pkg/api/clusterprofile.go
ClusterProfileFromParams(); ClusterProfileKonfluxConfig, ClusterProfilesList, and (*ClusterProfilesList).Resolve() to expand cluster_groups into concrete sorted cluster lists and aggregate missing-group errors.
Profile set schema and test allowlisting
pkg/api/clusterprofile.go
ClusterProfileSetDetails.UnmarshalJSON for schema detection; ClusterProfileSetDetailsNew with FindSetByProfile() and IsTestAllowlisted() implementing regex-based allowlist evaluation.
types.go refactoring: imports, field addition, and cluster-profile deletions
pkg/api/types.go
Removed cluster-profile and Konflux/schema declarations moved to clusterprofile.go; import list reduced; ContainerTestConfiguration gains Clone *bool (clone).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 12 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Coverage For New Features ⚠️ Warning 1,342 lines added with only 2 of 13 functions tested. Missing tests for 300+ line methods, error handlers, and complex logic—violates pure function test requirement. Add comprehensive tests covering: ClusterProfile.ClusterType/LeaseType (table-driven), LeaseTypeFromClusterType, ClusterProfileFromParams, FindSetByProfile, IsTestAllowlisted.
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add aws-us-east-1 cluster profile' accurately reflects the primary change in the PR: introducing a new cluster profile while refactoring related code into a dedicated file.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Go Error Handling ✅ Passed Error handling patterns are correct: no ignored errors, proper error wrapping with fmt.Errorf %w, no panic calls, and all nil pointer checks in place.
Stable And Deterministic Test Names ✅ Passed The PR adds pkg/api/clusterprofile.go and modifies pkg/api/types.go but does not add or modify any Ginkgo test files. No test names with dynamic content exist in this PR.
Test Structure And Quality ✅ Passed Custom check not applicable. PR contains standard Go tests only, not Ginkgo tests. Repository has 0 Ginkgo imports. Check requires Ginkgo patterns absent from PR.
Microshift Test Compatibility ✅ Passed PR does not add any Ginkgo e2e tests. Changes are API refactoring only: moving cluster profile types to a new file and adding one field. MicroShift compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests were added. The PR only adds API type definitions and constants. The SNO compatibility check does not apply.
Topology-Aware Scheduling Compatibility ✅ Passed Code refactoring that moves cluster profile API types to clusterprofile.go. No deployment, operator, or scheduling constraints added. Check not applicable.
Ote Binary Stdout Contract ✅ Passed New clusterprofile.go contains only type definitions, constants, and methods. No init() functions, no process-level stdout writes, and no logging setup. OTE stdout contract not violated.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds API type definitions only; no Ginkgo e2e tests added. Custom check for IPv6/disconnected network compatibility in e2e tests does not apply.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


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

@openshift-ci openshift-ci Bot requested review from pruan-rht and smg247 May 19, 2026 15:30
@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2026
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: 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 `@pkg/api/clusterprofile.go`:
- Around line 1202-1208: The method ClusterProfilesList.Resolve should guard
against a nil receiver to avoid panics when called on a nil
*ClusterProfilesList; add an early nil check at the start of Resolve (e.g., if
cpl == nil) and return an appropriate error or nil (consistent with the
function's contract) before any dereference (such as accessing cpl.KonfluxConfig
or modifying errs/clusterGroups) so all subsequent code in Resolve is safe;
update any callers/tests if they rely on panics.
- Around line 1162-1182: LeaseTypeFromClusterType rejects cluster names that
ClusterType() can produce; update LeaseTypeFromClusterType to accept the same
set (including aliases like alibabacloud, ibmcloud, aro, oci-edge and the
additional openstack/metal variants emitted by ClusterType()) by adding those
missing case strings or normalizing ClusterType() outputs to the canonical names
before the switch; modify the switch in LeaseTypeFromClusterType to include the
missing identifiers (or add a small mapping/normalization step) so valid
profiles no longer return "invalid cluster type", and add unit tests covering
the ClusterType() -> LeaseTypeFromClusterType path to prevent regressions.
🪄 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: 555b9ad8-81c7-49c6-b54b-9cf95251fb4e

📥 Commits

Reviewing files that changed from the base of the PR and between 164209c and b486b15.

📒 Files selected for processing (2)
  • pkg/api/clusterprofile.go
  • pkg/api/types.go
💤 Files with no reviewable changes (1)
  • pkg/api/types.go

Comment thread pkg/api/clusterprofile.go
Comment on lines +1162 to +1182
func LeaseTypeFromClusterType(t string) (string, error) {
switch t {
case
"aws", "aws-c2s", "aws-china", "aws-usgov", "aws-sc2s", "aws-eusc", "aws-osd-msp", "aws-opendatahub",
"alibaba", "azure-2", "azure4", "azure-arm64", "azurestack", "azuremag", "equinix-ocp-metal",
"gcp", "gcp-arm64", "gcp-opendatahub", "libvirt-ppc64le", "libvirt-ppc64le-s2s", "libvirt-s390x",
"libvirt-s390x-1", "libvirt-s390x-2", "libvirt-s390x-amd64", "libvirt-s390x-vpn", "ibmcloud-multi-ppc64le",
"ibmcloud-multi-s390x", "nutanix", "nutanix-qe", "nutanix-qe-dis", "nutanix-qe-zone", "nutanix-qe-gpu",
"nutanix-qe-flow", "openstack", "openstack-osuosl", "openstack-vexxhost", "openstack-ppc64le",
"openstack-nerc-dev", "vsphere", "ovirt", "packet", "packet-edge", "powervc-1", "powervs-multi-1",
"powervs-1", "powervs-2", "powervs-3", "powervs-4", "powervs-5", "powervs-6", "powervs-7", "powervs-8", "powervs-9",
"kubevirt", "aws-cpaas", "osd-ephemeral", "gcp-virtualization", "aws-virtualization",
"azure-virtualization", "hypershift-aws", "hypershift-aks", "hypershift-azure",
"hypershift-powervs", "hypershift-powervs-cb", "hypershift-gcp", "aws-mco-qe",
"equinix-edge-enablement", "aws-oadp-qe", "azure-oadp-qe", "aws-lp-chaos", "aws-osp-qe",
"metal-redhat-gs", "aro-hcp-int", "aro-hcp-stg", "aro-hcp-prod", "aro-hcp-dev", "rosa-regional-platform-int", "hyperfleet-e2e",
"aro-classic-int", "aro-classic-stg", "aro-classic-prod", "aro-classic-dev", "rosa-e2e-01", "rosa-e2e-02", "rosa-e2e-03":
return t + "-quota-slice", nil
default:
return "", fmt.Errorf("invalid cluster type %q", t)
}
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 19, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

LeaseTypeFromClusterType() is out of sync with ClusterType() outputs.

This function rejects valid cluster types produced by ClusterType() (for example alibabacloud, ibmcloud, aro, oci-edge, and several openstack/metal variants), which can trigger invalid cluster type on valid profiles.

Suggested direction
func LeaseTypeFromClusterType(t string) (string, error) {
	switch t {
	case
 		"aws", "aws-c2s", "aws-china", "aws-usgov", "aws-sc2s", "aws-eusc", "aws-osd-msp", "aws-opendatahub",
-		"alibaba", "azure-2", "azure4", "azure-arm64", "azurestack", "azuremag", "equinix-ocp-metal",
+		"alibabacloud", "azure-2", "azure4", "azure-arm64", "azurestack", "azuremag", "equinix-ocp-metal",
 		"gcp", "gcp-arm64", "gcp-opendatahub", "libvirt-ppc64le", "libvirt-ppc64le-s2s", "libvirt-s390x",
 		"libvirt-s390x-1", "libvirt-s390x-2", "libvirt-s390x-amd64", "libvirt-s390x-vpn", "ibmcloud-multi-ppc64le",
-		"ibmcloud-multi-s390x", "nutanix", ...
+		"ibmcloud-multi-s390x", "ibmcloud", "nutanix", ...
+		"openstack-hwoffload", "openstack-ibm-osp", "openstack-nfv", "openstack-vh-mecha-central",
+		"openstack-vh-bm-rhos", "openstack-operators-vexxhost", "openstack-rhoso", "openstack-rhos-ci",
+		"metal-perfscale-cpt", "metal-perfscale-jetlag", "metal-perfscale-osp", "metal-perfscale-selfsched", "metal-perfscale-telco",
+		"oci-agent-qe", "oci-edge", "aro":
		return t + "-quota-slice", nil
	default:
		return "", fmt.Errorf("invalid cluster type %q", t)
	}
}
🤖 Prompt for 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.

In `@pkg/api/clusterprofile.go` around lines 1162 - 1182, LeaseTypeFromClusterType
rejects cluster names that ClusterType() can produce; update
LeaseTypeFromClusterType to accept the same set (including aliases like
alibabacloud, ibmcloud, aro, oci-edge and the additional openstack/metal
variants emitted by ClusterType()) by adding those missing case strings or
normalizing ClusterType() outputs to the canonical names before the switch;
modify the switch in LeaseTypeFromClusterType to include the missing identifiers
(or add a small mapping/normalization step) so valid profiles no longer return
"invalid cluster type", and add unit tests covering the ClusterType() ->
LeaseTypeFromClusterType path to prevent regressions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is a refactor and, if this is a real issue, I don't want to address it in this PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@danilo-gemoli Understood. Would you like me to open a follow-up issue to track the LeaseTypeFromClusterType / ClusterType() sync gap so it doesn't get lost?

Comment thread pkg/api/clusterprofile.go
Comment on lines +1202 to +1208
func (cpl *ClusterProfilesList) Resolve() error {
errs := make([]error, 0)

clusterGroups := make(map[string][]string)
if cpl.KonfluxConfig != nil {
clusterGroups = cpl.KonfluxConfig.ClusterGroups
}
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 19, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Guard nil receiver in Resolve() to prevent panic.

Line 1206 dereferences cpl unconditionally. A nil receiver call will panic.

Proposed fix
func (cpl *ClusterProfilesList) Resolve() error {
+	if cpl == nil {
+		return nil
+	}
+
	errs := make([]error, 0)

	clusterGroups := make(map[string][]string)
	if cpl.KonfluxConfig != nil {
		clusterGroups = cpl.KonfluxConfig.ClusterGroups
	}
As per coding guidelines, `**/*.go`: "check for nil before dereferencing pointers".
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
func (cpl *ClusterProfilesList) Resolve() error {
errs := make([]error, 0)
clusterGroups := make(map[string][]string)
if cpl.KonfluxConfig != nil {
clusterGroups = cpl.KonfluxConfig.ClusterGroups
}
func (cpl *ClusterProfilesList) Resolve() error {
if cpl == nil {
return nil
}
errs := make([]error, 0)
clusterGroups := make(map[string][]string)
if cpl.KonfluxConfig != nil {
clusterGroups = cpl.KonfluxConfig.ClusterGroups
}
🤖 Prompt for 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.

In `@pkg/api/clusterprofile.go` around lines 1202 - 1208, The method
ClusterProfilesList.Resolve should guard against a nil receiver to avoid panics
when called on a nil *ClusterProfilesList; add an early nil check at the start
of Resolve (e.g., if cpl == nil) and return an appropriate error or nil
(consistent with the function's contract) before any dereference (such as
accessing cpl.KonfluxConfig or modifying errs/clusterGroups) so all subsequent
code in Resolve is safe; update any callers/tests if they rely on panics.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as above, this is a refactor and I don't want to address these things here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@danilo-gemoli Understood, this is purely a refactor. Would you like me to open a follow-up issue to track adding the nil guard to (*ClusterProfilesList).Resolve()?

@danilo-gemoli danilo-gemoli force-pushed the chore/add-aws-us-east-1-profile branch from b486b15 to bdbb1a8 Compare May 19, 2026 15:36
@danilo-gemoli
Copy link
Copy Markdown
Contributor Author

/test e2e

@danilo-gemoli
Copy link
Copy Markdown
Contributor Author

/retest-required

@danilo-gemoli
Copy link
Copy Markdown
Contributor Author

/test e2e

@danilo-gemoli
Copy link
Copy Markdown
Contributor Author

/override ci/prow/images

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

@danilo-gemoli: Overrode contexts on behalf of danilo-gemoli: ci/prow/images

Details

In response to this:

/override ci/prow/images

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-merge-bot
Copy link
Copy Markdown
Contributor

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@deepsm007
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label May 19, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danilo-gemoli, deepsm007

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:
  • OWNERS [danilo-gemoli,deepsm007]

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 19, 2026

@danilo-gemoli: 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.

@openshift-merge-bot openshift-merge-bot Bot merged commit cd299ac into openshift:main May 19, 2026
17 checks passed
@danilo-gemoli danilo-gemoli deleted the chore/add-aws-us-east-1-profile branch May 20, 2026 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants