Skip to content

Commit

Permalink
parse static value with parseJSONValue func
Browse files Browse the repository at this point in the history
Signed-off-by: changzhen <changzhen5@huawei.com>
  • Loading branch information
XiShanYongYe-Chang committed Dec 17, 2024
1 parent 5fbcf9b commit 0210929
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controllers/applicationfailover/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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/
{
Expand Down

0 comments on commit 0210929

Please sign in to comment.