From 02109292f8d45e1af2d15b0fa96d51513d1ee80d Mon Sep 17 00:00:00 2001 From: changzhen Date: Tue, 17 Dec 2024 11:56:21 +0800 Subject: [PATCH] parse static value with parseJSONValue func Signed-off-by: changzhen --- pkg/controllers/applicationfailover/common_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/controllers/applicationfailover/common_test.go b/pkg/controllers/applicationfailover/common_test.go index 037fa497fb2e..2f4e01b8e3af 100644 --- a/pkg/controllers/applicationfailover/common_test.go +++ b/pkg/controllers/applicationfailover/common_test.go @@ -226,6 +226,15 @@ func Test_parseJSONValue(t *testing.T) { wantErr: assert.NoError, want: "2", }, + { + name: "get a static value", + args: args{ + rawStatus: []byte(`{"replicas": 2}`), + jsonPath: "true", + }, + wantErr: assert.NoError, + want: "true", + }, // Build the following test cases in terms of what the function supports (which we don't use now). // Please refer to Function Support: https://kubernetes.io/docs/reference/kubectl/jsonpath/ {