Skip to content

[master] MGMT-21834: remove supported-platforms endpoint#10122

Open
andrej1991 wants to merge 1 commit intoopenshift:masterfrom
andrej1991:remove_supported_platforms_api
Open

[master] MGMT-21834: remove supported-platforms endpoint#10122
andrej1991 wants to merge 1 commit intoopenshift:masterfrom
andrej1991:remove_supported_platforms_api

Conversation

@andrej1991
Copy link
Copy Markdown
Contributor

@andrej1991 andrej1991 commented Apr 8, 2026

remove assisted-install/v2/clusters//supported-platforms endpoint because it gives a bad result and it isn't used by anyone

When querying the endpoint it returns none, however it should returned the supported platforms by the underlying infrastructure.
An example:

$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" -H "Content-Type: application/json"
-H "Authorization: Bearer $API_TOKEN"
| jq '.platform'
{
"external": {},
"type": "baremetal"
}

$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID/supported-platforms" -H "Content-Type: application/json"
-H "Authorization: Bearer $API_TOKEN"
| jq
[
"none"
]

List all the issues related to this PR

  • New Feature
  • Enhancement
  • [x ] Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • [ x] Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • [] No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

  • Deprecations

    • Marked the GET /v2/clusters/{cluster_id}/supported-platforms endpoint as deprecated. Use cluster hosts/inventory data combined with support-levels feature endpoints to determine platform eligibility instead.
  • Improvements

    • Enhanced database connection validation to detect invalid configurations at startup.
  • Documentation

    • Updated API guidance to direct users toward alternative methods for determining supported platforms.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 8, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 8, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 8, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 8, 2026

@andrej1991: This pull request references MGMT-21834 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 bug to target the "4.22.0" version, but no target version was set.

Details

In response to this:

remove assisted-install/v2/clusters//supported-platforms endpoint because it gives a bad result and it isn't used by anyone

When querying the endpoint it returns none, however it should returned the supported platforms by the underlying infrastructure.
An example:

List all the issues related to this PR

  • New Feature
  • Enhancement
  • [x ] Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • [ x] Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • [] No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

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 added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 8, 2026

Walkthrough

The PR deprecates the GetClusterSupportedPlatforms REST endpoint with updated documentation directing clients to use cluster inventory and support-levels feature endpoints instead. Separately, the PR changes LibpqDSN function/method signatures to return (string, error) and validates DSN strings via pgconn, updating call sites accordingly.

Changes

GetClusterSupportedPlatforms Endpoint Deprecation

Layer / File(s) Summary
API Documentation & Comments
client/installer/installer_client.go, restapi/configure_assisted_install.go, restapi/operations/installer/get_cluster_supported_platforms.go
API method and endpoint comments updated to mark GetClusterSupportedPlatforms as deprecated with guidance to use GET /v2/support-levels/features or detailed variant.
OpenAPI Specification
restapi/embedded_spec.go, swagger.yaml
Endpoint GET /v2/clusters/{cluster_id}/supported-platforms marked as deprecated: true with updated description; response schemas and security scopes remain unchanged.
Handler Relocation
internal/bminventory/inventory.go, internal/bminventory/inventory_v2_handlers.go
Public GetClusterSupportedPlatforms responder removed from inventory.go; re-added in inventory_v2_handlers.go with deprecation warning log and internal implementation reuse.
Tests & Mocks
internal/bminventory/inventory_test.go, pkg/auth/auth_assisted_service_mock_test.go
GetSupportedPlatformsFromInventory test suite removed; new test case added for nil high-availability mode with single host; mock method reordered without behavioral change.
User Documentation
docs/user-guide/rest-api-v1-v2-transition-guide.md
V1–V2 API comparison table entry for GetClusterSupportedPlatforms removed.

LibpqDSN Error Handling

Layer / File(s) Summary
Function Signature
pkg/db/db.go
LibpqDSN(...) function and Config.LibpqDSN() method changed to return (string, error) instead of string; DSN validated via pgconn.ParseConfig.
Call Sites
cmd/main.go, internal/common/common_unitest_db.go
Updated to unpack error from LibpqDSN(), fatal on validation error in setupDB, and assert no error in test helper.
Dependencies
go.mod
Added explicit github.com/jackc/pgx/v5 v5.6.0 requirement (moved from indirect) to support new pgconn import.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

🚥 Pre-merge checks | ✅ 8 | ❌ 4

❌ Failed checks (2 warnings, 2 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Mock expectation incomplete: missing .Return() in HighAvailabilityMode test. Assertions lack meaningful failure messages. Multi-version platform tests violate single responsibility. Add .Return() to mock expectation. Add context messages to assertions. Split platform version tests into separate test cases.
Title check ❓ Inconclusive The title '[master] MGMT-21834: remove supported-platforms endpoint' is clear and specific about the main change—removing the endpoint—but includes branch name which should typically be omitted from PR titles. Consider removing '[master]' branch prefix from the title; use 'MGMT-21834: remove supported-platforms endpoint' or similar for clarity.
Description check ❓ Inconclusive The description provides meaningful context with reproduction steps and issue classification, but multiple required checklist items are unchecked (title/description in commit, linked issues, documentation, unit tests) and testing is only pending CI runs. Verify and check all applicable checklist items; confirm whether documentation updates or unit tests are truly not needed for this API removal.
✅ Passed checks (8 passed)
Check name Status Explanation
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 New test "HighAvailabilityMode is nil with single host" is stable and deterministic with no dynamic values, UUIDs, timestamps, or generated identifiers.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests added in this PR. Only unit tests in internal/bminventory/inventory_test.go with mocked dependencies. The custom check for MicroShift compatibility is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Check not applicable. The PR adds unit tests to assisted-service backend, not e2e tests. SNO compatibility checks only apply to OpenShift e2e test suites.
Topology-Aware Scheduling Compatibility ✅ Passed This PR modifies only API handlers, documentation, and database validation. No deployment manifests, operator code, or controllers with scheduling constraints are introduced.
Ote Binary Stdout Contract ✅ Passed PR does not violate OTE Stdout Contract. Logrus defaults to stderr, test writes are properly scoped, no process-level stdout changes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed New Ginkgo test is a mocked unit test, not e2e. No hardcoded IPv4 addresses, network assumptions, or external connectivity. All dependencies mocked with gomock.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci openshift-ci Bot added the api-review Categorizes an issue or PR as actively needing an API review. label Apr 8, 2026
@andrej1991 andrej1991 marked this pull request as ready for review April 9, 2026 08:10
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2026
@andrej1991
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 Apr 9, 2026
@openshift-ci openshift-ci Bot requested review from jhernand and mlorenzofr April 9, 2026 08:12
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.33%. Comparing base (e807c36) to head (bafa3bd).
⚠️ Report is 114 commits behind head on master.

Files with missing lines Patch % Lines
restapi/embedded_spec.go 0.00% 3 Missing ⚠️
internal/bminventory/inventory_v2_handlers.go 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10122      +/-   ##
==========================================
+ Coverage   44.24%   44.33%   +0.09%     
==========================================
  Files         415      417       +2     
  Lines       72499    72840     +341     
==========================================
+ Hits        32075    32293     +218     
- Misses      37511    37612     +101     
- Partials     2913     2935      +22     
Files with missing lines Coverage Δ
internal/bminventory/inventory.go 72.10% <ø> (+0.14%) ⬆️
restapi/configure_assisted_install.go 0.00% <ø> (ø)
internal/bminventory/inventory_v2_handlers.go 62.41% <66.66%> (+0.03%) ⬆️
restapi/embedded_spec.go 0.00% <0.00%> (ø)

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrej1991
Copy link
Copy Markdown
Contributor Author

/retest

@andrej1991 andrej1991 force-pushed the remove_supported_platforms_api branch from 7b72e11 to 38a704b Compare May 6, 2026 09:59
@openshift-ci openshift-ci Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 6, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 6, 2026

@andrej1991: This pull request references MGMT-21834 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 bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

remove assisted-install/v2/clusters//supported-platforms endpoint because it gives a bad result and it isn't used by anyone

When querying the endpoint it returns none, however it should returned the supported platforms by the underlying infrastructure.
An example:

$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID" -H "Content-Type: application/json"
-H "Authorization: Bearer $API_TOKEN"
| jq '.platform'
{
"external": {},
"type": "baremetal"
}

$ curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/$CLUSTER_ID/supported-platforms" -H "Content-Type: application/json"
-H "Authorization: Bearer $API_TOKEN"
| jq
[
"none"
]

List all the issues related to this PR

  • New Feature
  • Enhancement
  • [x ] Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • [ x] Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • [] No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

Summary by CodeRabbit

  • Chores
  • Removed the GET /v2/clusters/{cluster_id}/supported-platforms API endpoint.

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.

@andrej1991
Copy link
Copy Markdown
Contributor Author

/retest

Copy link
Copy Markdown
Contributor

@danmanor danmanor left a comment

Choose a reason for hiding this comment

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

@andrej1991 Are you sure the task is to remove it rather than deprecate it ? cc @CrystalChun / @gamli75

@CrystalChun
Copy link
Copy Markdown
Contributor

@andrej1991 Are you sure the task is to remove it rather than deprecate it ? cc @CrystalChun / @gamli75

I believe Alona changed it to "remove" since it's not used by QE

@CrystalChun
Copy link
Copy Markdown
Contributor

@andrej1991 can you remove [master] from the title and commit message?

deprecating assisted-install/v2/clusters//supported-platforms endpoint because it gives a bad result and it isn't used by anyone
@andrej1991 andrej1991 force-pushed the remove_supported_platforms_api branch from 38a704b to bafa3bd Compare May 8, 2026 13:28
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd` main go go mod internal.txt:
- Around line 13-16: The code currently passes the raw parser error
(validationErr) to log.WithError which can expose the unredacted DSN; change the
logging to avoid including the raw error object—replace
log.WithError(validationErr).Fatal("Invalid DB connection config") with a
sanitized log such as log.Fatal("Invalid DB connection config") or, if you need
error text, log.WithField("error", validationErr.Error()).Fatal("Invalid DB
connection config") so you do not pass the original validationErr value; update
the call site that handles Options.DBConfig.LibpqDSN() accordingly.

In `@internal/bminventory/inventory_v2_handlers.go`:
- Around line 105-112: The GetClusterSupportedPlatforms handler currently still
returns 200 OK, leaving /v2/clusters/{cluster_id}/supported-platforms callable;
change it so the endpoint is no longer publicly exposed by either removing the
route registration that references GetClusterSupportedPlatforms or updating the
handler GetClusterSupportedPlatforms(ctx, params) to immediately return a non-OK
response (e.g., 404 Not Found or 410 Gone) using the appropriate installer
response constructor (e.g.,
NewGetClusterSupportedPlatformsNotFound/NewGetClusterSupportedPlatformsGone or a
common error responder) and include a short deprecation message in the
payload/log so callers cannot successfully invoke it.

In `@swagger.yaml`:
- Around line 4092-4134: The OpenAPI spec still advertises the deprecated
endpoint /v2/clusters/{cluster_id}/supported-platforms with operationId
GetClusterSupportedPlatforms; remove this path object from swagger.yaml to fully
drop the endpoint from the published contract (delete the entire
/v2/clusters/{cluster_id}/supported-platforms entry including its GET operation,
parameters and responses), and ensure no other references to
GetClusterSupportedPlatforms remain in the spec or related documentation.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0df39486-132a-4858-8074-4731226762dd

📥 Commits

Reviewing files that changed from the base of the PR and between 38a704b and bafa3bd.

⛔ Files ignored due to path filters (1)
  • vendor/github.com/openshift/assisted-service/client/installer/installer_client.go is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (11)
  • client/installer/installer_client.go
  • cmd main go go mod internal.txt
  • docs/user-guide/rest-api-v1-v2-transition-guide.md
  • internal/bminventory/inventory.go
  • internal/bminventory/inventory_test.go
  • internal/bminventory/inventory_v2_handlers.go
  • pkg/auth/auth_assisted_service_mock_test.go
  • restapi/configure_assisted_install.go
  • restapi/embedded_spec.go
  • restapi/operations/installer/get_cluster_supported_platforms.go
  • swagger.yaml
💤 Files with no reviewable changes (2)
  • docs/user-guide/rest-api-v1-v2-transition-guide.md
  • internal/bminventory/inventory.go
✅ Files skipped from review due to trivial changes (5)
  • restapi/operations/installer/get_cluster_supported_platforms.go
  • restapi/configure_assisted_install.go
  • client/installer/installer_client.go
  • pkg/auth/auth_assisted_service_mock_test.go
  • restapi/embedded_spec.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/bminventory/inventory_test.go

Comment on lines +13 to +16
+ dbConnectionStr, validationErr := Options.DBConfig.LibpqDSN()
+ if validationErr != nil {
+ log.WithError(validationErr).Fatal("Invalid DB connection config")
+ }
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 | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Does github.com/jackc/pgx/v5/pgconn ParseConfig return errors that may include parts of the input DSN (including password or full conn string)? Please cite docs/issues/examples.

💡 Result:

Yes, github.com/jackc/pgx/v5/pgconn.ParseConfig returns errors of type *pgconn.ParseConfigError, which includes the full input DSN (ConnString field) and may expose parts of it including passwords or the full connection string [1][2][3]. The Error method includes a redacted version of the ConnString (passwords replaced with xxxxxx via redactPW) in its string output, e.g., "cannot parse postgresql://postgres:xxxxxx@127.0.0.1:5432/postgres: failed to parse as URL..." [4][5][2]. Redaction is best-effort and not perfect for malformed DSNs, as noted in issues; underlying errors (e.g., from url.Parse) may also contain unredacted input [4][6]. The ConnString field itself is exported and unredacted, accessible via type assertion [1]. Examples from issues show password leakage in parse errors [4][5].

Citations:


Avoid logging raw DSN parse errors at fatal level.

The pgconn.ParseConfig error includes the full, unredacted connection string with credentials in its exported ConnString field. While the Error() method provides a redacted version (passwords replaced with xxxxxx), type assertion can access the unredacted value, and underlying errors may bypass redaction entirely. Passing this error to log.WithError() risks exposing database credentials in logs.

Log a sanitized error message and exclude the raw parser error:

dbConnectionStr, validationErr := Options.DBConfig.LibpqDSN()
if validationErr != nil {
-       log.WithError(validationErr).Fatal("Invalid DB connection config")
+       log.Fatal("Invalid DB connection config")
}
🤖 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 `@cmd` main go go mod internal.txt around lines 13 - 16, The code currently
passes the raw parser error (validationErr) to log.WithError which can expose
the unredacted DSN; change the logging to avoid including the raw error
object—replace log.WithError(validationErr).Fatal("Invalid DB connection
config") with a sanitized log such as log.Fatal("Invalid DB connection config")
or, if you need error text, log.WithField("error",
validationErr.Error()).Fatal("Invalid DB connection config") so you do not pass
the original validationErr value; update the call site that handles
Options.DBConfig.LibpqDSN() accordingly.

Comment on lines +105 to +112
func (b *bareMetalInventory) GetClusterSupportedPlatforms(ctx context.Context, params installer.GetClusterSupportedPlatformsParams) middleware.Responder {
logutil.FromContext(ctx, b.log).Warn("deprecated API invoked: GET /v2/clusters/{cluster_id}/supported-platforms; use cluster hosts plus GET /v2/support-levels/features instead")
supportedPlatforms, err := b.GetClusterSupportedPlatformsInternal(ctx, params)
if err != nil {
return common.GenerateErrorResponder(err)
}
return installer.NewGetClusterSupportedPlatformsOK().WithPayload(*supportedPlatforms)
}
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 | 🏗️ Heavy lift

Endpoint is still publicly exposed instead of removed.

Line 105 adds a public handler and Line 111 still returns 200 OK, so /v2/clusters/{cluster_id}/supported-platforms remains callable. That conflicts with the PR objective to remove this endpoint.

Proposed direction
-func (b *bareMetalInventory) GetClusterSupportedPlatforms(ctx context.Context, params installer.GetClusterSupportedPlatformsParams) middleware.Responder {
-	logutil.FromContext(ctx, b.log).Warn("deprecated API invoked: GET /v2/clusters/{cluster_id}/supported-platforms; use cluster hosts plus GET /v2/support-levels/features instead")
-	supportedPlatforms, err := b.GetClusterSupportedPlatformsInternal(ctx, params)
-	if err != nil {
-		return common.GenerateErrorResponder(err)
-	}
-	return installer.NewGetClusterSupportedPlatformsOK().WithPayload(*supportedPlatforms)
-}
+// Remove this handler and unregister the route in generated/config wiring
+// so the endpoint is no longer served.
🤖 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 `@internal/bminventory/inventory_v2_handlers.go` around lines 105 - 112, The
GetClusterSupportedPlatforms handler currently still returns 200 OK, leaving
/v2/clusters/{cluster_id}/supported-platforms callable; change it so the
endpoint is no longer publicly exposed by either removing the route registration
that references GetClusterSupportedPlatforms or updating the handler
GetClusterSupportedPlatforms(ctx, params) to immediately return a non-OK
response (e.g., 404 Not Found or 410 Gone) using the appropriate installer
response constructor (e.g.,
NewGetClusterSupportedPlatformsNotFound/NewGetClusterSupportedPlatformsGone or a
common error responder) and include a short deprecation message in the
payload/log so callers cannot successfully invoke it.

Comment thread swagger.yaml
Comment on lines +4092 to +4134
/v2/clusters/{cluster_id}/supported-platforms:
get:
tags:
- installer
description: |
Deprecated. Returns a list of platforms that this cluster can support in its current configuration.
Prefer deriving platform eligibility from cluster hosts and inventory together with
GET /v2/support-levels/features (or GET /v2/support-levels/features/detailed) for the cluster OpenShift version and CPU architecture.
deprecated: true
operationId: GetClusterSupportedPlatforms
security:
- userAuth: [ admin, read-only-admin, user ]
parameters:
- in: path
name: cluster_id
description: The cluster whose platform types should be retrieved.
type: string
format: uuid
required: true
responses:
"200":
description: Success.
schema:
type: array
items:
$ref: '#/definitions/platform_type'
"401":
description: Unauthorized.
schema:
$ref: '#/definitions/infra_error'
"403":
description: Forbidden.
schema:
$ref: '#/definitions/infra_error'
"404":
description: Error.
schema:
$ref: '#/definitions/error'
"500":
description: Error.
schema:
$ref: '#/definitions/error'

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 | 🏗️ Heavy lift

Endpoint is still exposed instead of removed

Line 4092 keeps /v2/clusters/{cluster_id}/supported-platforms in the published OpenAPI spec. That means the API contract still advertises and supports this known-incorrect endpoint, which conflicts with the stated removal objective for MGMT-21834.

Suggested change
-  /v2/clusters/{cluster_id}/supported-platforms:
-    get:
-      tags:
-        - installer
-      description: |
-        Deprecated. Returns a list of platforms that this cluster can support in its current configuration.
-        Prefer deriving platform eligibility from cluster hosts and inventory together with
-        GET /v2/support-levels/features (or GET /v2/support-levels/features/detailed) for the cluster OpenShift version and CPU architecture.
-      deprecated: true
-      operationId: GetClusterSupportedPlatforms
-      security:
-        - userAuth: [ admin, read-only-admin, user ]
-      parameters:
-        - in: path
-          name: cluster_id
-          description: The cluster whose platform types should be retrieved.
-          type: string
-          format: uuid
-          required: true
-      responses:
-        "200":
-          description: Success.
-          schema:
-            type: array
-            items:
-              $ref: '#/definitions/platform_type'
-        "401":
-          description: Unauthorized.
-          schema:
-            $ref: '#/definitions/infra_error'
-        "403":
-          description: Forbidden.
-          schema:
-            $ref: '#/definitions/infra_error'
-        "404":
-          description: Error.
-          schema:
-            $ref: '#/definitions/error'
-        "500":
-          description: Error.
-          schema:
-            $ref: '#/definitions/error'
📝 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
/v2/clusters/{cluster_id}/supported-platforms:
get:
tags:
- installer
description: |
Deprecated. Returns a list of platforms that this cluster can support in its current configuration.
Prefer deriving platform eligibility from cluster hosts and inventory together with
GET /v2/support-levels/features (or GET /v2/support-levels/features/detailed) for the cluster OpenShift version and CPU architecture.
deprecated: true
operationId: GetClusterSupportedPlatforms
security:
- userAuth: [ admin, read-only-admin, user ]
parameters:
- in: path
name: cluster_id
description: The cluster whose platform types should be retrieved.
type: string
format: uuid
required: true
responses:
"200":
description: Success.
schema:
type: array
items:
$ref: '#/definitions/platform_type'
"401":
description: Unauthorized.
schema:
$ref: '#/definitions/infra_error'
"403":
description: Forbidden.
schema:
$ref: '#/definitions/infra_error'
"404":
description: Error.
schema:
$ref: '#/definitions/error'
"500":
description: Error.
schema:
$ref: '#/definitions/error'
🤖 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 `@swagger.yaml` around lines 4092 - 4134, The OpenAPI spec still advertises the
deprecated endpoint /v2/clusters/{cluster_id}/supported-platforms with
operationId GetClusterSupportedPlatforms; remove this path object from
swagger.yaml to fully drop the endpoint from the published contract (delete the
entire /v2/clusters/{cluster_id}/supported-platforms entry including its GET
operation, parameters and responses), and ensure no other references to
GetClusterSupportedPlatforms remain in the spec or related documentation.

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 8, 2026

@andrej1991: 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/edge-images bafa3bd link true /test edge-images
ci/prow/edge-verify-generated-code bafa3bd link true /test edge-verify-generated-code

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

api-review Categorizes an issue or PR as actively needing an API review. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants