From affd1cb2517d3fedd957edf11dba73b9cb9dfe5a Mon Sep 17 00:00:00 2001 From: Philipp Trulson Date: Tue, 2 Apr 2024 22:12:06 +0200 Subject: [PATCH] fix(ui): Fix color generation for pod name in logs viewer. Fixes #17704 (#17706) * Fix color generation for pod name in logs viewer Signed-off-by: Philipp Trulson * Add rebuy to users.md Signed-off-by: Philipp Trulson --------- Signed-off-by: Philipp Trulson --- USERS.md | 1 + .../applications/components/pod-logs-viewer/pod-logs-viewer.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/USERS.md b/USERS.md index 6f35c32acb661..9d409af2e8114 100644 --- a/USERS.md +++ b/USERS.md @@ -243,6 +243,7 @@ Currently, the following organizations are **officially** using Argo CD: 1. [QuintoAndar](https://quintoandar.com.br) 1. [Quipper](https://www.quipper.com/) 1. [RapidAPI](https://www.rapidapi.com/) +1. [rebuy](https://www.rebuy.de/) 1. [Recreation.gov](https://www.recreation.gov/) 1. [Red Hat](https://www.redhat.com/) 1. [Redpill Linpro](https://www.redpill-linpro.com/) diff --git a/ui/src/app/applications/components/pod-logs-viewer/pod-logs-viewer.tsx b/ui/src/app/applications/components/pod-logs-viewer/pod-logs-viewer.tsx index 309287fab2f37..18778e2b848b2 100644 --- a/ui/src/app/applications/components/pod-logs-viewer/pod-logs-viewer.tsx +++ b/ui/src/app/applications/components/pod-logs-viewer/pod-logs-viewer.tsx @@ -64,7 +64,7 @@ function stringHashCode(str: string) { // ansi color for pod name function podColor(podName: string) { - return colors[stringHashCode(podName) % colors.length]; + return colors[Math.abs(stringHashCode(podName) % colors.length)]; } // https://2ality.com/2012/09/empty-regexp.html