Skip to content

Add staging environment support and existing COS instance configuration - #10716

Open
taliandre49 wants to merge 5 commits into
openshift:mainfrom
taliandre49:staging-support-endpoints
Open

Add staging environment support and existing COS instance configuration#10716
taliandre49 wants to merge 5 commits into
openshift:mainfrom
taliandre49:staging-support-endpoints

Conversation

@taliandre49

@taliandre49 taliandre49 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Add staging environment support and existing COS instance configuration

Summary

Adds support for deploying OpenShift on IBM Cloud PowerVS against the IBM
Cloud staging environment, and allows specifying a pre-existing COS instance
for image and ignition storage.

Changes

Staging environment support (IBMCLOUD_STAGING env var / --staging flag)

  • Adds staging.go with helpers that return staging vs production service
    endpoint URLs (IAM, COS, CIS, DNS Services, VPC, Resource Controller,
    Transit Gateway, Power IaaS) based on the IBMCLOUD_STAGING environment
    variable
  • Propagates serviceEndpoints from install-config.yaml into the cluster
    infrastructure manifests so CAPI controllers use the correct endpoints
  • Adds IngressStrategy: NodePort and ImageRegistryStorage: emptyDir
    platform options to work around staging environment limitations
  • Adds NetworkID field to allow specifying a pre-created PowerVS private
    network (required on staging where DHCP server creation fails)

Existing COS instance support

  • Adds COSInstanceCRN field to both PowerVS and IBMCloud platform types
  • Installer skips COS instance creation when a CRN is provided and uses the
    existing instance instead
  • Adds GetResourceInstanceByCRN and SetCOSBucketPublicIAMPolicy client
    methods
  • Adds destroy logic to clean up COS buckets from existing instances

Other

  • Fixes fmt.Sprintf arg count mismatch in pkg/types/ibmcloud/metadata_test.go
  • Adds user documentation for existing COS instance feature

Testing

Verified end-to-end cluster installation against IBM Cloud staging environment
(us-south/dal12)

Summary by CodeRabbit

  • New Features
    • Added support for reusing an existing IBM Cloud Object Storage instance by providing its COS CRN.
    • Added staging-environment mode via the --staging flag with staging-aware IBM Cloud endpoint selection.
    • Added Kubernetes CRDs for both agent-based and image-based installation configurations.
  • Bug Fixes
    • Improved COS CRN validation plus provisioning and teardown behavior for preconfigured COS instances.
    • Increased the PowerVS infrastructure readiness timeout and improved endpoint handling for staging.
  • Documentation
    • Added a guide for configuring and reusing an existing COS instance.
  • Chores
    • Expanded .gitignore for additional generated artifacts.

@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: LGTM mode

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Changes

The installer adds IBM Cloud staging endpoint support and reusable COS instance CRNs for IBM Cloud and PowerVS. Validation, provisioning, metadata, manifests, controller wiring, destruction, Kubernetes schemas, and documentation are updated.

IBM Cloud lifecycle changes

Layer / File(s) Summary
Contracts and entrypoints
.gitignore, cmd/openshift-install/*, data/data/*, pkg/types/*, docs/user/ibmcloud/*
Adds staging CLI configuration, COS CRN fields, Kubernetes schemas, endpoint mappings, documentation, and supporting manifests.
Staging endpoint routing
pkg/asset/installconfig/powervs/*, pkg/clusterapi/system.go, pkg/asset/manifests/infrastructure.go, pkg/destroy/powervs/*
Selects staging or production service URLs and propagates explicit endpoint configuration through SDK clients and infrastructure controllers.
Existing COS validation and provisioning
pkg/asset/installconfig/ibmcloud/*, pkg/asset/installconfig/powervs/*, pkg/asset/manifests/powervs/*, pkg/infrastructure/*
Validates COS CRNs, resolves resource instances, and uses existing or newly created COS instances for image and ignition storage.
COS cleanup
pkg/destroy/powervs/*, pkg/infrastructure/ibmcloud/clusterapi/*
Propagates COS metadata into uninstall, removes installer-created buckets, and skips deletion of preconfigured COS instances.

Estimated code review effort: 4 (Complex) | ~60 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors)

Check name Status Explanation Resolution
Ote Binary Stdout Contract ❌ Error cmd/openshift-install/main.go adds fmt.Printf in runRootCmd, a main-path stdout write that can corrupt JSON output. Send the staging notice to stderr or a logger, or remove it from the main entrypoint.
No-Sensitive-Data-In-Logs ❌ Error FAIL: loggingTransport dumps full request/response headers and GetIAMToken prints the authenticator with %+v, risking API key/token leakage. Redact headers and remove authenticator dumps; log only non-sensitive metadata (method, path, status) and safe IDs.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the two main changes: staging environment support and existing COS instance configuration.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
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.
Stable And Deterministic Test Names ✅ Passed No changed Ginkgo test titles in touched Go files; the only modified test file uses plain testing with static names.
Test Structure And Quality ✅ Passed No Ginkgo tests were added or changed; the only modified test is a plain table-driven Go test, so this Ginkgo-specific check is not applicable.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only test change is a standard Go unit test using testing/testify, with no MicroShift-unsupported APIs.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only changed test is a plain unit test with no SNO or multi-node assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed No new topology-sensitive scheduling rules were added; the diff only propagates endpoints/COS config and uses existing topology detection without anti-affinity, spread, nodeSelectors, or PDB changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests were added; the only test change is a unit test with synthetic URLs, and no IPv4/public-internet assumptions were introduced.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token compares were added in the touched code.
Container-Privileges ✅ Passed No changed manifest or generated pod spec adds privileged, hostPID/hostIPC, hostNetwork, allowPrivilegeEscalation, SYS_ADMIN, or root security settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
openshift-ci Bot requested review from clnperez and hamzy July 27, 2026 15:05
@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tthvo 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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go (1)

519-565: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

DestroyBootstrap never looks up the COS instance by CRN, breaking cleanup for user-provided COS instances.

userProvidedCOS is computed at line 521, but the instance lookup right above/below it always calls client.GetCOSInstanceByName(ctx, cosInstanceName) using the auto-generated <infraID>-cos name — it never calls client.GetResourceInstance(ctx, CRN) the way PreProvision/Ignition do. If the user's existing COS instance name doesn't match that convention, GetCOSInstanceByName returns COSResourceNotFoundError, which the switch treats as fatal and returns early — skipping ignition-bucket cleanup, security-group cleanup, and floating-IP cleanup entirely.

🐛 Proposed fix: resolve the COS instance by CRN when user-provided
-	cosInstanceName := ibmcloudic.COSInstanceName(infraID)
 	bucketName := ibmcloudbootstrap.GetIgnitionBucketName(infraID)
-	// Get COS Instance ID
-	logrus.Debugf("bootstrap destroy check cos resources for %s/%s", cosInstanceName, bucketName)
-	cosInstanceDetails, err := client.GetCOSInstanceByName(ctx, cosInstanceName)
-	switch {
-	case err != nil:
-		return fmt.Errorf("failed retrieving cos instance for destroy bootstrap: %w", err)
-	case cosInstanceDetails != nil:
-		err = cleanupIgnitionCOSBucket(ctx, client, *cosInstanceDetails.ID, bucketName, region)
-		if err != nil {
-			return fmt.Errorf("failed to cleanup bootstrap ignition cos bucket %s: %w", bucketName, err)
-		}
-		logrus.Debugf("cleaned up bootstrap ignition cos bucket: %s/%s", *cosInstanceDetails.ID, bucketName)
-	default:
-		logrus.Debugf("no cos instance found for the cluster as %s, skipping ignition bucket cleanup", cosInstanceName)
-	}
+	var cosInstanceDetails *resourcecontrollerv2.ResourceInstance
+	if userProvidedCOS {
+		cosInstanceDetails, err = client.GetResourceInstance(ctx, in.Metadata.IBMCloud.COSInstanceCRN)
+		if err != nil {
+			return fmt.Errorf("failed retrieving user-provided cos instance for destroy bootstrap: %w", err)
+		}
+	} else {
+		cosInstanceName := ibmcloudic.COSInstanceName(infraID)
+		logrus.Debugf("bootstrap destroy check cos resources for %s/%s", cosInstanceName, bucketName)
+		cosInstanceDetails, err = client.GetCOSInstanceByName(ctx, cosInstanceName)
+		if err != nil {
+			return fmt.Errorf("failed retrieving cos instance for destroy bootstrap: %w", err)
+		}
+	}
+	if cosInstanceDetails != nil {
+		if err := cleanupIgnitionCOSBucket(ctx, client, *cosInstanceDetails.ID, bucketName, region); err != nil {
+			return fmt.Errorf("failed to cleanup bootstrap ignition cos bucket %s: %w", bucketName, err)
+		}
+	}
🤖 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/infrastructure/ibmcloud/clusterapi/clusterapi.go` around lines 519 - 565,
Update DestroyBootstrap’s COS lookup to resolve the user-provided instance via
client.GetResourceInstance using COSInstanceCRN when userProvidedCOS is true,
instead of calling GetCOSInstanceByName with the generated name. Retain the
generated-name lookup for managed instances, and pass the resolved instance ID
through bucket and instance cleanup so later cleanup steps are not skipped.
pkg/asset/installconfig/powervs/session.go (1)

475-496: 🩺 Stability & Availability | 🔴 Critical | ⚡ Quick win

Enabling endpoint overrides the code itself documents as broken.

ResourceController and ResourceManager are now mapped to active "rc"/"rm" CAPI overrides, but the inline comments say "rc," crashes CAPI and "rm" leaves masters unable to get their ignition. If a user (or the staging config) supplies either endpoint override, this will pass it straight through to CAPI with a known-bad outcome.

Either keep these disabled (empty string, as before) until the CAPI-side issue is fixed, or gate them behind a resolved fix.

🤖 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/asset/installconfig/powervs/session.go` around lines 475 - 496, Update
MapServiceEndpointsForCAPI’s capiSupported mapping to keep ResourceController
and ResourceManager disabled by assigning empty values, so their known-broken
rc/rm overrides are skipped until the CAPI issues are resolved. Preserve the
existing mappings and unsupported-endpoint logging.
🧹 Nitpick comments (5)
pkg/asset/installconfig/ibmcloud/validation.go (1)

500-502: 🩺 Stability & Availability | 🔵 Trivial | 🏗️ Heavy lift

Propagate cancellation into validation.

context.TODO() disconnects the resource lookup from install-command cancellation. Thread a caller context.Context through Validate, validatePlatform, and validateCOSInstanceCRN; retain the client timeout as a bound.

As per path instructions, Go external calls must support context cancellation and timeouts.

🤖 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/asset/installconfig/ibmcloud/validation.go` around lines 500 - 502,
Replace context.TODO() in validateCOSInstanceCRN with a caller-provided context,
and thread that context through Validate and validatePlatform into the COS
resource lookup. Preserve the existing client timeout as an additional bound
while ensuring cancellation from the install command reaches
client.GetResourceInstance.

Source: Path instructions

pkg/asset/installconfig/powervs/staging.go (1)

92-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the commented-out GetCOSDirectEndpoint block.

34 lines of dead, commented-out code add noise for future maintainers. If this is planned for later use, track it in an issue/TODO instead of leaving it in-tree.

🤖 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/asset/installconfig/powervs/staging.go` around lines 92 - 125, Remove the
entire commented-out GetCOSDirectEndpoint block, including its documentation and
implementation, while leaving surrounding active code unchanged.
pkg/clusterapi/system.go (1)

356-382: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated IAM env-var construction; consider a shared helper.

Both the ibmcloud.Name and powervs.Name branches build near-identical envVars maps (auth type, API key, IAM URL/endpoint, log level, optional IBMCLOUD_STAGING). Also worth noting: only the ibmcloud.Name branch applies CheckServiceEndpointOverride on top of GetIAMURL() (line 359) — the powervs.Name branch doesn't, which may or may not be intentional given PowerVS has its own endpoint-override plumbing elsewhere.

♻️ Suggested extraction
func buildIBMCloudEnvVars(apiKey, iamEndpoint, logLevel string) map[string]string {
	envVars := map[string]string{
		"IBMCLOUD_AUTH_TYPE":        "iam",
		"IBMCLOUD_APIKEY":           apiKey,
		"IBMCLOUD_AUTH_URL":         iamEndpoint,
		"IBMCLOUD_IAM_API_ENDPOINT": iamEndpoint,
		"LOGLEVEL":                  logLevel,
	}
	if stagingEnv := os.Getenv("IBMCLOUD_STAGING"); stagingEnv != "" {
		envVars["IBMCLOUD_STAGING"] = stagingEnv
	}
	return envVars
}

Also applies to: 445-471

🤖 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/clusterapi/system.go` around lines 356 - 382, The IAM
environment-variable maps are duplicated between the ibmcloud.Name and
powervs.Name branches. Extract their shared construction, including optional
IBMCLOUD_STAGING propagation, into a helper and use it from both branches;
preserve each branch’s existing IAM endpoint selection and override behavior,
and retain the current log-level value.
pkg/asset/installconfig/powervs/client.go (1)

804-823: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Resource Manager client uses GetResourceControllerURL() instead of the dedicated GetResourceManagerURL().

destroy/powervs/powervs.go's equivalent loadSDKServices correctly calls powervs.GetResourceManagerURL() for this same client. Both helpers currently return the same host, so this isn't broken today, but relying on the wrong helper here is a landmine if the two endpoints ever diverge (e.g., a future staging config split).

🤖 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/asset/installconfig/powervs/client.go` around lines 804 - 823, Update
loadResourceManagementAPI to initialize ResourceManagerV2Options.URL with
GetResourceManagerURL() instead of GetResourceControllerURL(). Leave the IAM URL
and client initialization flow unchanged.
pkg/infrastructure/powervs/clusterapi/powervs.go (1)

96-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove or properly gate the commented-out staging COS ACL block.

This is dead code checked into InfraReady. It also calls SetCOSBucketPublicIAMPolicy, which currently has a URL-construction bug (see client.go) — if someone uncomments this later without noticing, it will silently fail. Prefer removing it or wiring it behind a real, tested staging conditional rather than leaving it commented.

🤖 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/infrastructure/powervs/clusterapi/powervs.go` around lines 96 - 119,
Remove the commented-out staging COS ACL block from InfraReady, including the
SetCOSBucketPublicIAMPolicy call and related logging, rather than retaining dead
code with a known URL-construction issue. Keep the active InfraReady behavior
unchanged.
🤖 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 `@docs/user/ibmcloud/existing-cos-instance.md`:
- Around line 28-43: Update the Configuration example around cosInstanceCRN so
its documented platform path matches the stated platform.ibmcloud path; replace
platform.powerVS with platform.ibmcloud while preserving the existing field and
YAML structure.
- Line 42: Correct the sample CRNs in the documented examples, including both
occurrences, by removing one trailing colon so each ends with <instance_id>::
rather than <instance_id>:::. Keep the remaining CRN structure unchanged.

In `@pkg/asset/installconfig/ibmcloud/client.go`:
- Line 134: The default IAM endpoint in
pkg/asset/installconfig/ibmcloud/client.go at lines 134-134 must remain the
production URL; select the staging endpoint only through explicit configuration.
Update the shell fallback in
data/data/cluster-api/ibmcloud-infrastructure-components.yaml at lines 8105-8105
to use the production IAM host, preserving explicit endpoint overrides.
- Line 1541: Remove the uncontrolled fmt.Printf debug output from the endpoint
override handling in pkg/asset/installconfig/ibmcloud/client.go:1541 and replace
endpoint-override reporting with safe logging that excludes URLs, internal
endpoints, and customer resource identifiers. Apply the same safe logging change
to the corresponding endpoint override handling in
pkg/asset/installconfig/ibmcloud/validation.go:484.

In `@pkg/asset/installconfig/ibmcloud/metadata.go`:
- Around line 298-306: Remove the personal debug output from GetIAMToken in
pkg/asset/installconfig/ibmcloud/metadata.go, including the authenticator print
that exposes the IAM API key; remove the debug print before the IAM token call
in Ignition in pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go; remove the
POWEROVERRIDE print in GetPowerURL in pkg/asset/installconfig/powervs/staging.go
and delete the fmt import there if unused afterward.

In `@pkg/asset/installconfig/ibmcloud/validation.go`:
- Around line 487-505: Update the CRN validation in the relevant validation
function to enforce the complete anchored, allow-listed COS CRN shape, including
the expected IBM Cloud COS service and required segments, instead of only
checking the crn: prefix and length. After client.GetResourceInstance succeeds,
validate that the returned resource is identified as a COS instance before
accepting it; report malformed or non-COS resources through the existing
field.Invalid path.

In `@pkg/asset/installconfig/powervs/client.go`:
- Around line 35-53: Update loggingTransport.RoundTrip to redact the
Authorization header value before logging request headers, while preserving
other header diagnostics and request behavior. Remove the leftover “Test: Try to
get a token first” RequestToken probe from the GetDNSZones setup so each DNS
instance does not perform an unnecessary IAM round-trip.
- Around line 927-931: Update GetAuthenticatorAPIKeyDetails to use the
environment-aware GetIAMURL() value for the IAM authenticator URL instead of the
hardcoded staging endpoint, matching the other authenticators in Client and
preserving mode-specific API-key lookups.
- Around line 1742-1815: Update SetCOSBucketPublicIAMPolicy so
core.IamAuthenticator.URL receives the base iamURL directly, without appending
/identity/token; leave the SDK responsible for adding the token endpoint before
CreatePolicyWithContext runs.
- Around line 1524-1532: Prevent malformed staging endpoints by updating
GetPowerURL in pkg/asset/installconfig/powervs/staging.go to resolve every
supported zone, or reject unsupported zones before URL construction; do not
ignore its region parameter when it can provide a valid fallback. Remove the
leftover debug fmt.Printf. Apply the validation consistently at
pkg/asset/installconfig/powervs/client.go:1524-1532,
pkg/asset/installconfig/powervs/session.go:202-229, and
pkg/destroy/powervs/powervs.go:558-564 so NewPISession, CreateSSHKey, and
destroy flows never receive an empty datacenter prefix.

In `@pkg/asset/installconfig/powervs/session.go`:
- Around line 91-95: Replace the unverified parsing in the token-handling flow
around jwt.Parser and ParseUnverified with signature-validated JWT parsing for
all environments. Configure the parser’s trusted signing key or
environment-specific key selection, including the staging IAM key through
existing configuration, while preserving downstream claims extraction only after
successful verification.

In `@pkg/asset/installconfig/powervs/staging.go`:
- Around line 128-174: Update GetPowerURL so staging-mode zones not found in
zoneToDC do not produce a URL with an empty datacenter prefix. Detect an
unmapped zone and apply the established sensible fallback, or fail explicitly
according to the surrounding configuration conventions; preserve the existing
mapped-zone URL behavior and production region URL path.

In `@pkg/infrastructure/powervs/clusterapi/powervs.go`:
- Around line 68-70: Update Provider.ProvisionTimeout to retain the existing
15-minute timeout for production and other platforms, and apply the 60-minute
value only when the staging environment requires it. Use the provider’s existing
environment or platform configuration to select the timeout rather than changing
the global default.

In `@pkg/types/ibmcloud/platform.go`:
- Around line 183-189: Update DestroyBootstrap in the IBM Cloud clusterapi
infrastructure flow to resolve the COS instance using COSInstanceCRN when it is
provided, instead of relying on the generated InfraID-derived name. Preserve
bootstrap bucket cleanup for user-provided instances, while skipping only
deletion of the existing COS instance; retain current name-based lookup and
deletion behavior when COSInstanceCRN is unset.

---

Outside diff comments:
In `@pkg/asset/installconfig/powervs/session.go`:
- Around line 475-496: Update MapServiceEndpointsForCAPI’s capiSupported mapping
to keep ResourceController and ResourceManager disabled by assigning empty
values, so their known-broken rc/rm overrides are skipped until the CAPI issues
are resolved. Preserve the existing mappings and unsupported-endpoint logging.

In `@pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go`:
- Around line 519-565: Update DestroyBootstrap’s COS lookup to resolve the
user-provided instance via client.GetResourceInstance using COSInstanceCRN when
userProvidedCOS is true, instead of calling GetCOSInstanceByName with the
generated name. Retain the generated-name lookup for managed instances, and pass
the resolved instance ID through bucket and instance cleanup so later cleanup
steps are not skipped.

---

Nitpick comments:
In `@pkg/asset/installconfig/ibmcloud/validation.go`:
- Around line 500-502: Replace context.TODO() in validateCOSInstanceCRN with a
caller-provided context, and thread that context through Validate and
validatePlatform into the COS resource lookup. Preserve the existing client
timeout as an additional bound while ensuring cancellation from the install
command reaches client.GetResourceInstance.

In `@pkg/asset/installconfig/powervs/client.go`:
- Around line 804-823: Update loadResourceManagementAPI to initialize
ResourceManagerV2Options.URL with GetResourceManagerURL() instead of
GetResourceControllerURL(). Leave the IAM URL and client initialization flow
unchanged.

In `@pkg/asset/installconfig/powervs/staging.go`:
- Around line 92-125: Remove the entire commented-out GetCOSDirectEndpoint
block, including its documentation and implementation, while leaving surrounding
active code unchanged.

In `@pkg/clusterapi/system.go`:
- Around line 356-382: The IAM environment-variable maps are duplicated between
the ibmcloud.Name and powervs.Name branches. Extract their shared construction,
including optional IBMCLOUD_STAGING propagation, into a helper and use it from
both branches; preserve each branch’s existing IAM endpoint selection and
override behavior, and retain the current log-level value.

In `@pkg/infrastructure/powervs/clusterapi/powervs.go`:
- Around line 96-119: Remove the commented-out staging COS ACL block from
InfraReady, including the SetCOSBucketPublicIAMPolicy call and related logging,
rather than retaining dead code with a known URL-construction issue. Keep the
active InfraReady behavior 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: b3fe8d90-0d38-4feb-ac8d-500a31feb5c9

📥 Commits

Reviewing files that changed from the base of the PR and between d8f6a96 and 9269247.

⛔ Files ignored due to path filters (16)
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_cluster.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_machine.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/controllers/ibmpowervsimage_controller.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/authenticator/authenticator.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/cos/service.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/resourcecontroller/service.go is excluded by !**/vendor/**
  • data/data/install.openshift.io_installconfigs.yaml is excluded by !data/data/install.openshift.io_installconfigs.yaml
  • vendor/github.com/openshift/api/config/v1/types.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (33)
  • .gitignore
  • cmd/openshift-install/command/log.go
  • cmd/openshift-install/main.go
  • data/data/_configs.yaml
  • data/data/_installationconfigs.yaml
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/cluster/powervs/powervs.go
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/installconfig/powervs/client.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/asset/releaseimage/default.go
  • pkg/clusterapi/system.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • pkg/destroy/powervs/powervs.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/types/ibmcloud/metadata.go
  • pkg/types/ibmcloud/metadata_test.go
  • pkg/types/ibmcloud/platform.go
  • pkg/types/powervs/metadata.go
  • pkg/types/powervs/platform.go

Comment thread docs/user/ibmcloud/existing-cos-instance.md Outdated
Comment thread docs/user/ibmcloud/existing-cos-instance.md Outdated
Comment thread pkg/asset/installconfig/ibmcloud/client.go Outdated
Comment thread pkg/asset/installconfig/ibmcloud/client.go Outdated
Comment thread pkg/asset/installconfig/ibmcloud/metadata.go
Comment thread pkg/asset/installconfig/powervs/client.go
Comment thread pkg/asset/installconfig/powervs/session.go Outdated
Comment thread pkg/asset/installconfig/powervs/staging.go
Comment thread pkg/infrastructure/powervs/clusterapi/powervs.go
Comment thread pkg/types/ibmcloud/platform.go
@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch from 9269247 to 22655f1 Compare July 27, 2026 15:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/cluster/powervs/powervs.go`:
- Line 64: Add unit coverage for the PowerVS asset generation path that
populates COSInstanceCRN in uninstall metadata. In the pkg/asset/cluster/powervs
test suite, configure an install-config PowerVS COSInstanceCRN, invoke the
relevant asset-generation function, and assert the resulting metadata preserves
the same value.
🪄 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: Pro Plus

Run ID: 685c584d-754e-41e3-8c82-fb6485f61405

📥 Commits

Reviewing files that changed from the base of the PR and between 9269247 and 22655f1.

⛔ Files ignored due to path filters (16)
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_cluster.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_machine.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/controllers/ibmpowervsimage_controller.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/authenticator/authenticator.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/cos/service.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/resourcecontroller/service.go is excluded by !**/vendor/**
  • data/data/install.openshift.io_installconfigs.yaml is excluded by !data/data/install.openshift.io_installconfigs.yaml
  • vendor/github.com/openshift/api/config/v1/types.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (33)
  • .gitignore
  • cmd/openshift-install/command/log.go
  • cmd/openshift-install/main.go
  • data/data/_configs.yaml
  • data/data/_installationconfigs.yaml
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/cluster/powervs/powervs.go
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/installconfig/powervs/client.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/asset/releaseimage/default.go
  • pkg/clusterapi/system.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • pkg/destroy/powervs/powervs.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/types/ibmcloud/metadata.go
  • pkg/types/ibmcloud/metadata_test.go
  • pkg/types/ibmcloud/platform.go
  • pkg/types/powervs/metadata.go
  • pkg/types/powervs/platform.go
🚧 Files skipped from review as they are similar to previous changes (31)
  • pkg/types/powervs/platform.go
  • pkg/types/ibmcloud/platform.go
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • data/data/_installationconfigs.yaml
  • pkg/asset/installconfig/platformcredscheck.go
  • cmd/openshift-install/command/log.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/types/powervs/metadata.go
  • pkg/types/ibmcloud/metadata.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/asset/releaseimage/default.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/types/ibmcloud/metadata_test.go
  • .gitignore
  • data/data/_configs.yaml
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/clusterapi/system.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • pkg/asset/installconfig/ibmcloud/client.go
  • docs/user/ibmcloud/existing-cos-instance.md
  • cmd/openshift-install/main.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/destroy/powervs/powervs.go
  • pkg/asset/installconfig/powervs/client.go

Comment thread pkg/asset/cluster/powervs/powervs.go
@taliandre49

Copy link
Copy Markdown
Contributor Author

status: Addressing issues

@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch 2 times, most recently from ec6d679 to 35a305c Compare July 27, 2026 17:49

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/installconfig/powervs/session.go`:
- Around line 481-482: Disable the ResourceController and ResourceManager
mappings in MapServiceEndpointsForCAPI so rc and rm are no longer appended
through --service-endpoint. Remove or gate both mappings while preserving all
other service-endpoint translations until the bundled CAPI provider supports
them.
🪄 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: Pro Plus

Run ID: 75173ba4-496f-4b4b-81b9-031f79eea072

📥 Commits

Reviewing files that changed from the base of the PR and between ec6d679 and 35a305c.

⛔ Files ignored due to path filters (16)
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_cluster.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_machine.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/controllers/ibmpowervsimage_controller.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/authenticator/authenticator.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/cos/service.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/resourcecontroller/service.go is excluded by !**/vendor/**
  • data/data/install.openshift.io_installconfigs.yaml is excluded by !data/data/install.openshift.io_installconfigs.yaml
  • vendor/github.com/openshift/api/config/v1/types.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (33)
  • .gitignore
  • cmd/openshift-install/command/log.go
  • cmd/openshift-install/main.go
  • data/data/_configs.yaml
  • data/data/_installationconfigs.yaml
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/cluster/powervs/powervs.go
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/installconfig/powervs/client.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/asset/releaseimage/default.go
  • pkg/clusterapi/system.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • pkg/destroy/powervs/powervs.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/types/ibmcloud/metadata.go
  • pkg/types/ibmcloud/metadata_test.go
  • pkg/types/ibmcloud/platform.go
  • pkg/types/powervs/metadata.go
  • pkg/types/powervs/platform.go
🚧 Files skipped from review as they are similar to previous changes (31)
  • pkg/asset/cluster/powervs/powervs.go
  • cmd/openshift-install/command/log.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/types/powervs/platform.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/asset/releaseimage/default.go
  • pkg/types/ibmcloud/metadata_test.go
  • pkg/types/ibmcloud/metadata.go
  • .gitignore
  • cmd/openshift-install/main.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/types/ibmcloud/platform.go
  • data/data/_installationconfigs.yaml
  • pkg/asset/installconfig/ibmcloud/validation.go
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • pkg/clusterapi/system.go
  • pkg/types/powervs/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • data/data/_configs.yaml
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/destroy/powervs/powervs.go
  • pkg/asset/installconfig/powervs/client.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/asset/installconfig/powervs/staging.go

Comment thread pkg/asset/installconfig/powervs/session.go Outdated
@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch from 35a305c to 174d340 Compare July 27, 2026 18:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pkg/asset/manifests/infrastructure.go`:
- Around line 329-337: Update the endpoint handling around the service-name
normalization block so TransitGateway overrides are retained in Infrastructure
status instead of being discarded. Preserve the existing case normalization for
POWER, and ensure the CAPI configuration path maps the retained TransitGateway
value to the expected “transitgateway” endpoint representation.
🪄 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: Pro Plus

Run ID: cc991e72-cba3-4091-b737-4b4b523dc49b

📥 Commits

Reviewing files that changed from the base of the PR and between 35a305c and 174d340.

⛔ Files ignored due to path filters (16)
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/clients/instance/ibm-pi-image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/session.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/ibmpisession/utils.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_delete_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_cloud_connections/pcloud_cloudconnections_get_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_events/pcloud_events_getquery_parameters.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/github.com/IBM-Cloud/power-go-client/power/client/p_cloud_images/p_cloud_images_client.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_cluster.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_image.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/cloud/scope/powervs_machine.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/controllers/ibmpowervsimage_controller.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/authenticator/authenticator.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/cos/service.go is excluded by !**/vendor/**
  • cluster-api/providers/ibmcloud/vendor/sigs.k8s.io/cluster-api-provider-ibmcloud/pkg/cloud/services/resourcecontroller/service.go is excluded by !**/vendor/**
  • data/data/install.openshift.io_installconfigs.yaml is excluded by !data/data/install.openshift.io_installconfigs.yaml
  • vendor/github.com/openshift/api/config/v1/types.go is excluded by !vendor/**, !**/vendor/**
📒 Files selected for processing (33)
  • .gitignore
  • cmd/openshift-install/command/log.go
  • cmd/openshift-install/main.go
  • data/data/_configs.yaml
  • data/data/_installationconfigs.yaml
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/asset/cluster/powervs/powervs.go
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/installconfig/powervs/client.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/asset/manifests/infrastructure.go
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/asset/releaseimage/default.go
  • pkg/clusterapi/system.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • pkg/destroy/powervs/powervs.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/types/ibmcloud/metadata.go
  • pkg/types/ibmcloud/metadata_test.go
  • pkg/types/ibmcloud/platform.go
  • pkg/types/powervs/metadata.go
  • pkg/types/powervs/platform.go
🚧 Files skipped from review as they are similar to previous changes (30)
  • pkg/asset/cluster/powervs/powervs.go
  • .gitignore
  • pkg/asset/releaseimage/default.go
  • pkg/asset/installconfig/platformcredscheck.go
  • pkg/asset/installconfig/powervs/platform.go
  • pkg/asset/installconfig/powervs/mock/powervsclient_generated.go
  • data/data/_installationconfigs.yaml
  • pkg/types/powervs/metadata.go
  • pkg/asset/installconfig/ibmcloud/mock/ibmcloudclient_generated.go
  • pkg/asset/cluster/ibmcloud/ibmcloud.go
  • pkg/types/ibmcloud/platform.go
  • data/data/_configs.yaml
  • pkg/clusterapi/system.go
  • pkg/asset/installconfig/ibmcloud/validation.go
  • pkg/destroy/powervs/serviceinstance.go
  • pkg/asset/installconfig/powervs/session.go
  • pkg/types/ibmcloud/metadata_test.go
  • cmd/openshift-install/command/log.go
  • pkg/asset/installconfig/ibmcloud/metadata.go
  • pkg/infrastructure/powervs/clusterapi/powervs.go
  • pkg/infrastructure/ibmcloud/clusterapi/clusterapi.go
  • data/data/cluster-api/ibmcloud-infrastructure-components.yaml
  • docs/user/ibmcloud/existing-cos-instance.md
  • pkg/asset/manifests/powervs/cluster.go
  • pkg/destroy/powervs/cloud-object-storage.go
  • cmd/openshift-install/main.go
  • pkg/asset/installconfig/ibmcloud/client.go
  • pkg/destroy/powervs/powervs.go
  • pkg/asset/installconfig/powervs/staging.go
  • pkg/asset/installconfig/powervs/client.go

Comment thread pkg/asset/manifests/infrastructure.go
@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch from 174d340 to 496d25c Compare July 27, 2026 18:38
@taliandre49

Copy link
Copy Markdown
Contributor Author

note that verify-vendor is failing as CAPI PR [https://github.com/kubernetes-sigs/cluster-api-provider-ibmcloud/pull/2837] and API PR [https://github.com/openshift/api/pull/2959] to be pushed and vendored into main in order to succeed

@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch 2 times, most recently from a65c3bb to 8d816c4 Compare July 28, 2026 15:55
@taliandre49

Copy link
Copy Markdown
Contributor Author

status: removed lingering local override redirects for the PRs mentioned above (correct approach is wait for the PRs to be merged and re-vendor). Addressing CodeRabbits feedback

@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch 3 times, most recently from ebef0bc to 42360a7 Compare July 28, 2026 19:18
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2026
@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch from 17116d1 to 65c7319 Compare July 29, 2026 23:20
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@taliandre49: 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.

…nfiguration

Add support for deploying OpenShift on IBM Cloud PowerVS against the IBM
Cloud staging environment, and allow specifying a pre-existing COS instance
for image and ignition storage.

Staging support:
- Add IBMCLOUD_STAGING env var and --staging flag to switch all service
  endpoints (IAM, COS, CIS, DNS, VPC, RC, Transit Gateway, Power IaaS)
  to IBM Cloud staging URLs
- Propagate serviceEndpoints from install-config into cluster infrastructure
  manifests so CAPI controllers use the correct endpoints
- Add IngressStrategy and ImageRegistryStorage platform options to work
  around staging environment limitations
- Add NetworkID field to allow specifying a pre-created PowerVS private
  network (required on staging where DHCP server creation fails)

Existing COS instance support:
- Add COSInstanceCRN field to PowerVS and IBMCloud platform types
- Skip COS instance creation when a CRN is provided
- Add destroy logic to clean up COS buckets on existing instances
- Add user documentation for the existing COS instance feature

Signed-off-by: Natalia Jordan <natalia.jordan@ibm.com>
Signed-off-by: Natalia Jordan <natalia.jordan@ibm.com>
Deduplicate the repeated "private" and "public" string literals used
when determining subnet scope for AWS machines. Define
subnetScopePrivate and subnetScopePublic constants in awsmachines.go
and replace all occurrences across machines.go and
clusterapi_machinesets.go.

Fixes golint goconst warnings.
Update the vendored content for sigs.k8s.io/cluster-api-provider-ibmcloud
to match the alpha pseudo-version declared in go.mod
(v0.13.0-alpha.0.0.20260729144403-83818de8b90e).

The previous vendor directory contained v0.13.1 content which diverged
from go.mod, causing verify-vendor failures.
The lone '/' on the last line was a catch-all that would silently ignore
root-level files. Remove it; all intended ignore patterns were already
present on the lines above.
@taliandre49
taliandre49 force-pushed the staging-support-endpoints branch from 1f7ed9f to f6a3139 Compare July 30, 2026 06:14
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.

1 participant