Skip to content

SRVKP-8974: # Multi-Cluster Support for Pipelines Console Plugin#926

Open
anwesha-palit-redhat wants to merge 1 commit intoopenshift-pipelines:mainfrom
anwesha-palit-redhat:feat/SRVKP-8974-MC-Changes
Open

SRVKP-8974: # Multi-Cluster Support for Pipelines Console Plugin#926
anwesha-palit-redhat wants to merge 1 commit intoopenshift-pipelines:mainfrom
anwesha-palit-redhat:feat/SRVKP-8974-MC-Changes

Conversation

@anwesha-palit-redhat
Copy link
Contributor

@anwesha-palit-redhat anwesha-palit-redhat commented Feb 6, 2026

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters.

Problem Statement

In a multi-cluster Tekton architecture, PipelineRuns are submitted to a hub cluster but execute on remote worker clusters. Previously, the console plugin could only fetch logs and status from resources in the local cluster's etcd, making it impossible to view logs or real-time status for PipelineRuns running on worker clusters.

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
    • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
    • proxyUnavailable: Multi-cluster proxy connection failed
    • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
    • PipelineRunLogs (logs tab)
    • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

https://drive.google.com/file/d/1xfu_p78dQA52ZJON2YrSHZTcwj7MR3Iw/view?usp=sharing

Hub Cluster - PipelineRunDetails Page error block snippet for a failed PLR

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Multicluster_proxy_server_not_available.mov

Hub Cluster - Download Logs / Download All Logs

https://drive.google.com/file/d/1TXz-ZqF0_z_3oq9ySOXUF5GAVCT8qMK9/view?usp=sharing

https://drive.google.com/file/d/1eWzlxJi6xFKbwZ2aInYB2FxXHQkZLeBS/view?usp=sharing

Hub Cluster - URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Hub Cluster - Network error during live logs

mc_logs_api_error.mov

Single Cluster - Unchanged Behavior

https://drive.google.com/file/d/1pOx9Wc-gxO4Wjg8G-sYyIaARFAad5mxf/view?usp=sharing

Assisted by

Claude AI

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

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
Copy link
Contributor

openshift-ci bot commented Feb 6, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: anwesha-palit-redhat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [anwesha-palit-redhat]

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

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

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.

1 similar comment
@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters. The implementation includes automatic fallback handling, status indicators for pending admission and proxy unavailability, and seamless integration across all log viewing interfaces.

Changes Overview

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

webpack.config.ts

  • Enabled HMR and live reload for development
  • Fixed WebSocket connection to plugin dev server (was incorrectly connecting to console)
  • Added watchFiles configuration for automatic rebuilds

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

Video showing real-time log streaming from worker cluster

Hub Cluster - PipelineRunDetails Page error block snippet

Video showing PipelineRunDetails Page error block snippet

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Video showing info banner when PipelineRun awaits worker cluster assignment

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Video showing warning banner when multi-cluster connection fails

Multicluster_proxy_server_not_available.mov

Hub Cluster - URL redirection and step highlight with taskname and step name

Video showing URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Local Cluster - Unchanged Behavior

Video confirming existing functionality remains intact on non-hub clusters

Assisted by

Claude

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters.

Problem Statement

In a multi-cluster Tekton architecture, PipelineRuns are submitted to a hub cluster but execute on remote worker clusters. Previously, the console plugin could only fetch logs and status from resources in the local cluster's etcd, making it impossible to view logs or real-time status for PipelineRuns running on worker clusters.

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

https://drive.google.com/file/d/1xfu_p78dQA52ZJON2YrSHZTcwj7MR3Iw/view?usp=sharing

Hub Cluster - PipelineRunDetails Page error block snippet for a failed PLR

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Multicluster_proxy_server_not_available.mov

Hub Cluster - Download Logs / Download All Logs

https://drive.google.com/file/d/1TXz-ZqF0_z_3oq9ySOXUF5GAVCT8qMK9/view?usp=sharing

https://drive.google.com/file/d/1eWzlxJi6xFKbwZ2aInYB2FxXHQkZLeBS/view?usp=sharing

Hub Cluster - URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Hub Cluster - Network error during live logs

mc_logs_api_error.mov

Single Cluster - Unchanged Behavior

Assisted by

Claude AI

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-robot
Copy link
Collaborator

openshift-ci-robot commented Feb 6, 2026

@anwesha-palit-redhat: This pull request references SRVKP-8974 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 story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

Summary

This PR adds comprehensive multi-cluster support for Tekton pipeline logs on hub clusters, enabling users to view real-time logs and status information from PipelineRuns and TaskRuns executing on remote worker clusters.

Problem Statement

In a multi-cluster Tekton architecture, PipelineRuns are submitted to a hub cluster but execute on remote worker clusters. Previously, the console plugin could only fetch logs and status from resources in the local cluster's etcd, making it impossible to view logs or real-time status for PipelineRuns running on worker clusters.

Core Multi-Cluster Infrastructure

New API Layer (multi-cluster-api.ts)

  • Added multi-cluster proxy endpoints for TaskRuns, Pods, and logs
  • Implemented HTTP fetch and WebSocket streaming for remote logs
  • Added /ready endpoint check to validate proxy availability before attempting connections
  • Supports both REST API calls for completed runs and WebSocket streams for active runs

Hub Cluster Detection (useIsHubCluster.ts)

  • Created hook to detect if current cluster is a hub cluster (currently hardcoded to true for development)
  • Based on TektonConfig role detection (commented out implementation ready for production)

Multi-Cluster TaskRuns Hook (useMultiClusterTaskRuns.ts)

  • Fetches TaskRuns from multi-cluster API on hub clusters
  • Implements 3-second polling while PipelineRun is in progress
  • Handles three distinct states:
  • pendingAdmission (409 status): PipelineRun waiting for worker cluster assignment
  • proxyUnavailable: Multi-cluster proxy connection failed
  • Normal data fetching with automatic retry logic

Enhanced TaskRuns Data Fetching

useTaskRuns.ts Refactoring

  • Modified signature to accept options object instead of positional parameters (cleaner API)
  • Added pipelineRunFinished flag to stop polling once PipelineRun completes
  • Integrated multi-cluster hook for hub clusters, automatically routing TaskRun queries through multi-cluster API
  • Returns two new flags: pendingAdmission and proxyUnavailable for UI feedback
  • Enhanced deduplication logic: uses resource name for hub clusters (UIDs differ between hub/spoke) vs UID for local clusters
  • Refactored complex error handling logic for better maintainability

Logs Infrastructure Updates

Logs.tsx - Core Log Viewer

  • Added dual-path log fetching: multi-cluster API for hub clusters, k8s API for local clusters
  • Implemented separate WebSocket handling for multi-cluster logs (plain text vs base64-encoded)
  • Added retryMultiClusterWebSocket with exponential backoff (up to 10 retries / 30 seconds)
  • Supports both HTTP fetch for terminated containers and WebSocket streaming for active containers
  • Automatically stops retries when PipelineRun finishes

LogsWrapperComponent.tsx

  • Added multi-cluster Pod fetching with 3-second polling
  • Integrated polling hook (usePoll) for automatic Pod status updates during PipelineRun execution
  • Routes Pod queries through multi-cluster API when on hub clusters
  • Passes hub cluster context and PipelineRun metadata to child components

LogSnippetFromPod.tsx & LogSnippetBlock.tsx

  • Enhanced to fetch log snippets from multi-cluster API on hub clusters
  • Maintains tail behavior (last 5 lines) for error previews across both APIs

UI Status Indicators

Alert Banners

  • Added warning alert for proxyUnavailable: "The multi-cluster connection is unavailable. Logs and status may be delayed until connection is restored."
  • Added info alert for pendingAdmission: "PipelineRun is waiting to be admitted to a worker cluster"
  • Displayed in:
  • PipelineRunLogs (logs tab)
  • PipelineRunVisualization (pipeline graph)

Internationalization

  • Added two new i18n keys for alert messages
  • All user-facing strings properly localized

Component Updates

PipelineRun Details Pages

  • PipelineRunCustomDetails.tsx: Passes hub context to error log snippets
  • PipelineRunDetailsPage.tsx: Determines PipelineRun finished state and passes to TaskRuns hook
  • PipelineRunLogs.tsx: Major refactor from class component to functional component with hooks, integrated alert banners and hub cluster support
  • PipelineRunVisualization.tsx: Added alert banners for multi-cluster status

List Views

  • PipelineRunsRow.tsx: Updated to use new options-based useTaskRuns API with pipelineRunFinished flag
  • PipelineRow.tsx: Same as above for pipeline list view
  • TaskRunsList.tsx: Updated for new API signature
  • TaskRunsRow.tsx: Added conditional linking based on TaskRun status (only link to completed runs)

Status Popovers

  • PipelineRunStatus.tsx: Passes hub context for log snippet fetching
  • TaskRunStatus.tsx: Same as above
  • StatusPopoverContent.tsx: Enhanced to accept and forward hub cluster context
  • PipelineRunStatusPopoverContent.tsx: Fetches TaskRuns with pipelineRunFinished flag

Overview Components

  • PipelineRunItem.tsx: Passes hub context to log snippet blocks

Utility & Helper Updates

utils.ts

  • Modified getPipelineRunData to filter out kueue.x-k8s.io/* labels when cloning PipelineRuns from hub clusters (prevents worker cluster admission conflicts)

Type Definitions

coreTekton.ts

  • Added optional role field to TektonConfig Spec for hub/spoke detection

Testing Considerations

  • Verify logs display correctly for PipelineRuns on hub clusters
  • Confirm WebSocket streaming works for active TaskRuns on worker clusters
  • Test fallback behavior when multi-cluster proxy is unavailable
  • Validate alert banners appear appropriately during pending admission
  • Check log snippets in status popovers fetch from correct API
  • Ensure polling stops after PipelineRun completion
  • Test PipelineRun cloning from hub clusters (kueue labels stripped)
  • Verify no regressions for local (non-hub) cluster behavior

Screen Recordings

Hub Cluster - Active PipelineRun with Logs

https://drive.google.com/file/d/1xfu_p78dQA52ZJON2YrSHZTcwj7MR3Iw/view?usp=sharing

Hub Cluster - PipelineRunDetails Page error block snippet for a failed PLR

MC_failed_PLR.mov

Hub Cluster - Pending Admission State

Multicluster_proxy_server_409_error.mov

Hub Cluster - Proxy Unavailable Scenario

Multicluster_proxy_server_not_available.mov

Hub Cluster - Download Logs / Download All Logs

https://drive.google.com/file/d/1TXz-ZqF0_z_3oq9ySOXUF5GAVCT8qMK9/view?usp=sharing

https://drive.google.com/file/d/1eWzlxJi6xFKbwZ2aInYB2FxXHQkZLeBS/view?usp=sharing

Hub Cluster - URL redirection and step highlight with taskname and step name

url_redirection_in_logs.mov
step-highlighting-in-logs.mov

Hub Cluster - Network error during live logs

mc_logs_api_error.mov

Single Cluster - Unchanged Behavior

https://drive.google.com/file/d/1pOx9Wc-gxO4Wjg8G-sYyIaARFAad5mxf/view?usp=sharing

Assisted by

Claude AI

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.

@arvindk-softwaredev
Copy link
Contributor

/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 9, 2026

@anwesha-palit-redhat: The following test 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/e2e c00b8a0 link true /test e2e

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants