Skip to content

feat: add oc adm inspect output to prow artifacts#5351

Open
sclarkso wants to merge 3 commits into
Azure:mainfrom
sclarkso:e2e-oc-adm-inspect
Open

feat: add oc adm inspect output to prow artifacts#5351
sclarkso wants to merge 3 commits into
Azure:mainfrom
sclarkso:e2e-oc-adm-inspect

Conversation

@sclarkso
Copy link
Copy Markdown
Collaborator

@sclarkso sclarkso commented May 21, 2026

https://redhat.atlassian.net/issues?filter=-1&selectedIssue=[AROSLSRE-846](https://redhat.atlassian.net/browse/AROSLSRE-846)

What

test/util/framework/hcp_helper.go — GetAdminRESTConfigForHCPCluster now caches the admin REST config in tc.hcpAdminConfigs (keyed by resourceGroup/clusterName) after a successful credential request.

test/util/framework/per_test_framework.go:

  • Added hcpAdminConfigs map[string]*rest.Config field to the test context struct, initialized in NewTestContext
  • collectDebugInfo launches an additional goroutine for collectHCPInspectData alongside existing ARM collection
  • collectHCPInspectData — reads cached admin configs, checks for oc availability, runs inspect per-cluster in parallel
  • runOCAdmInspect — generates kubeconfig from cached REST config, writes to temp file, runs oc adm inspect targeting ns/openshift-ingress, ns/openshift-ingress-operator, and clusteroperator/ingress, outputs to ${ARTIFACT_DIR}/inspect-{clusterName}/

Why

The ingress cert provisioning chain has async hops that happen on the customer's cluster (ACM policy delivers cert to HCP's openshift-ingress/cluster-ingress-cert, IngressController reloads). We cannot gate our backend's Succeeded state on these customer-side steps -- the backend cannot couple its readiness to the customer's kube-apiserver or nodes. But E2E tests can and should collect diagnostic data when these steps haven't completed.

Testing

e2e

Special notes for your reviewer

PR Checklist

  • PR is scoped to a single task (no mixed concerns)
  • Title follows Conventional Commits format
  • Summary explains the "Why" behind the change
  • Linked to relevant ticket/issue
  • Screenshots included (if graph/UI/metrics changes)
  • Self-reviewed the diff
  • CI/CD checks are passing (ignore Tide)
  • Draft PR used for WIP (if applicable)
  • Commit history is clean (rebased/squashed)
  • Tricky code blocks are commented
  • Specific reviewers tagged
  • All comment threads resolved before merge

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 21, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

openshift-ci Bot commented May 21, 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

@sclarkso
Copy link
Copy Markdown
Collaborator Author

/test e2e-parallel

@sclarkso
Copy link
Copy Markdown
Collaborator Author

/test e2e-parallel

@sclarkso sclarkso marked this pull request as ready for review May 21, 2026 06:56
Copilot AI review requested due to automatic review settings May 21, 2026 06:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances E2E debug artifact collection by capturing oc adm inspect output from HCP clusters (focused on ingress-related namespaces/resources) and storing it under the test’s ${ARTIFACT_DIR} output, using cached admin REST configs obtained during test execution.

Changes:

  • Cache HCP admin *rest.Config per cluster (resourceGroup/clusterName) after successfully requesting admin credentials.
  • Extend per-test debug collection to run oc adm inspect per cached HCP cluster and write results to ${ARTIFACT_DIR}/inspect-{clusterName}/.
  • Add supporting plumbing in the per-test framework (new hcpAdminConfigs field; inspect collection routines; oc discovery and timeout handling).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/util/framework/per_test_framework.go Adds hcpAdminConfigs to test context and collects oc adm inspect artifacts for cached HCP clusters during debug collection.
test/util/framework/hcp_helper.go Caches the admin REST config in the test context after a successful admin credential request.

Comment thread test/util/framework/per_test_framework.go Outdated
Comment thread test/util/framework/per_test_framework.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants