Add test for issue 3489 and improve error messages.

This commit is contained in:
monopole
2021-01-28 22:56:32 -08:00
parent a5cdd98414
commit 4287e28ff4
9 changed files with 368 additions and 143 deletions

View File

@@ -243,7 +243,8 @@ metadata:
data:
slice:
- false`,
expectedError: `obj 'apiVersion: apps/v1
expectedError: `considering field 'data/slice' of object
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep
@@ -252,7 +253,7 @@ metadata:
data:
slice:
- false
' at path 'data/slice': invalid value type expect a string`,
: invalid value type expect a string`,
filter: Filter{
MappingFunc: makeMf(map[string]interface{}{
"VAR": int64(5),
@@ -268,7 +269,8 @@ metadata:
name: dep
data:
1: str`,
expectedError: `obj 'apiVersion: apps/v1
expectedError: `considering field 'data' of object
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep
@@ -276,7 +278,7 @@ metadata:
config.kubernetes.io/index: '0'
data:
1: str
' at path 'data': invalid map key: value='1', tag='` + yaml.NodeTagInt + `'`,
: invalid map key: value='1', tag='` + yaml.NodeTagInt + `'`,
filter: Filter{
MappingFunc: makeMf(map[string]interface{}{
"VAR": int64(5),