From dbe5d23cb71697a7c7942086e843991a253967f8 Mon Sep 17 00:00:00 2001 From: Janhavi Alekar <97527096+JanhaviAlekar@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:50:08 +0530 Subject: [PATCH] fixes #4665 Invalid version details in backend. (#4666) * fix: Invalid version details in backend. Signed-off-by: JanhaviAlekar * Checking CIVersion at start Signed-off-by: JanhaviAlekar --------- Signed-off-by: JanhaviAlekar Co-authored-by: Vedant Shrotria Co-authored-by: Amit Kumar Das Co-authored-by: Namkyu Park <53862866+namkyu1999@users.noreply.github.com> --- chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go | 3 +++ .../KubernetesChaosInfrastructureUpgrade.tsx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go b/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go index abc3a5681c5..a795ac39bb5 100644 --- a/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go +++ b/chaoscenter/graphql/server/pkg/chaos_infrastructure/service.go @@ -932,6 +932,9 @@ func fetchLatestVersion(versions map[int]string) int { // updateVersionFormat converts string array to int by removing decimal points, 1.0.0 will be returned as 100, 0.1.0 will be returned as 10, 0.0.1 will be returned as 1 func updateVersionFormat(str string) (int, error) { + if str == CIVersion { + return 0, nil + } var versionInt int versionSlice := strings.Split(str, ".") for i, val := range versionSlice { diff --git a/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureUpgrade/KubernetesChaosInfrastructureUpgrade.tsx b/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureUpgrade/KubernetesChaosInfrastructureUpgrade.tsx index 310f47cd602..6c3dad53c68 100644 --- a/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureUpgrade/KubernetesChaosInfrastructureUpgrade.tsx +++ b/chaoscenter/web/src/controllers/KubernetesChaosInfrastructureUpgrade/KubernetesChaosInfrastructureUpgrade.tsx @@ -22,7 +22,7 @@ export default function KubernetesChaosInfrastructureUpgradeController({ ...scope, options: { skip: !isUpgradeAvailable, - onError: err => showError(err) + onError: err => showError(err.message) } });