From 6dfebc82d47686870a2b4474f3c3ac06becdd721 Mon Sep 17 00:00:00 2001 From: Nitin Dhevar Date: Tue, 28 Jan 2025 15:51:42 -0500 Subject: [PATCH 1/3] adding formatting for hive ProvisionFailed Status Signed-off-by: Nitin Dhevar --- .../ManagedClusters/components/HiveNotification.tsx | 12 +++++++++++- frontend/src/ui-components/AcmAlert/AcmAlert.tsx | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx index ccd3d3b507b..1612d92ac06 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx @@ -91,7 +91,7 @@ export function HiveNotification() { } - message={clusterProvisionStatus} + message={formatHiveLogText(clusterProvisionStatus)} /> ) @@ -124,3 +124,13 @@ export function launchToYaml(cluster: Cluster, configMaps: ConfigMap[]) { const openShiftConsoleUrl = openShiftConsoleConfig?.data?.consoleURL window.open(`${openShiftConsoleUrl}/k8s/ns/${namespace}/hive.openshift.io~v1~${kind}/${name}/yaml`) } + +export function formatHiveLogText(message: string | undefined) { + if (typeof message === 'string') { + let messageArray = message.split('\n') + if (messageArray.length > 9) { + message = `${messageArray.slice(0, 8).join('\n')}...` + } + } + return message +} diff --git a/frontend/src/ui-components/AcmAlert/AcmAlert.tsx b/frontend/src/ui-components/AcmAlert/AcmAlert.tsx index 274506906a2..4f228d1d128 100644 --- a/frontend/src/ui-components/AcmAlert/AcmAlert.tsx +++ b/frontend/src/ui-components/AcmAlert/AcmAlert.tsx @@ -135,7 +135,7 @@ export function AcmAlert(props: { style={props.style} className={props.className} > - {alertInfo?.message || props.message || props.subtitle} +

{alertInfo?.message || props.message || props.subtitle}

) From ce8d631c20c5143b8ddb02a017dbc02e5641a30d Mon Sep 17 00:00:00 2001 From: Nitin Dhevar Date: Tue, 28 Jan 2025 16:06:34 -0500 Subject: [PATCH 2/3] pushing prow check fix Signed-off-by: Nitin Dhevar --- .../Clusters/ManagedClusters/components/HiveNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx index 1612d92ac06..30d2800f12d 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx @@ -127,7 +127,7 @@ export function launchToYaml(cluster: Cluster, configMaps: ConfigMap[]) { export function formatHiveLogText(message: string | undefined) { if (typeof message === 'string') { - let messageArray = message.split('\n') + const messageArray = message.split('\n') if (messageArray.length > 9) { message = `${messageArray.slice(0, 8).join('\n')}...` } From fb43d590026a07f7176cfb079c73d8cf7e16498b Mon Sep 17 00:00:00 2001 From: Nitin Dhevar Date: Wed, 29 Jan 2025 23:28:09 -0500 Subject: [PATCH 3/3] fixing display lines count in hive log Signed-off-by: Nitin Dhevar --- .../Clusters/ManagedClusters/components/HiveNotification.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx index 30d2800f12d..2eefd9cb958 100644 --- a/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx +++ b/frontend/src/routes/Infrastructure/Clusters/ManagedClusters/components/HiveNotification.tsx @@ -129,7 +129,7 @@ export function formatHiveLogText(message: string | undefined) { if (typeof message === 'string') { const messageArray = message.split('\n') if (messageArray.length > 9) { - message = `${messageArray.slice(0, 8).join('\n')}...` + message = `${messageArray.slice(0, 9).join('\n')}...` } } return message