Skip to content

Commit c01dd9a

Browse files
parse static value with parseJSONValue func
Signed-off-by: changzhen <[email protected]>
1 parent 5fbcf9b commit c01dd9a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/controllers/applicationfailover/common_test.go

+9
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ func Test_parseJSONValue(t *testing.T) {
226226
wantErr: assert.NoError,
227227
want: "2",
228228
},
229+
{
230+
name: "get a static value just as jsonPath write",
231+
args: args{
232+
rawStatus: []byte(`{"replicas": 2}`),
233+
jsonPath: "true",
234+
},
235+
wantErr: assert.NoError,
236+
want: "true",
237+
},
229238
// Build the following test cases in terms of what the function supports (which we don't use now).
230239
// Please refer to Function Support: https://kubernetes.io/docs/reference/kubectl/jsonpath/
231240
{

0 commit comments

Comments
 (0)