Add tests
Kubernetes-commit: 5dca1be0160f5b5cb3c85b2ab44d569290eaa1f4
This commit is contained in:
parent
2d86c3a191
commit
9ae9023ede
|
@ -48,6 +48,20 @@ func TestSplitAndParseResourceRequest(t *testing.T) {
|
||||||
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
|
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
|
||||||
expectedFieldsPath: []string{"field2", "field3"},
|
expectedFieldsPath: []string{"field2", "field3"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "field with dots 1",
|
||||||
|
inResource: `service.field2['field\.with\.dots']`,
|
||||||
|
|
||||||
|
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
|
||||||
|
expectedFieldsPath: []string{"field2", "field.with.dots"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "field with dots 2",
|
||||||
|
inResource: `service.field2.field\.with\.dots`,
|
||||||
|
|
||||||
|
expectedGVR: schema.GroupVersionResource{Resource: "services", Version: "v1"},
|
||||||
|
expectedFieldsPath: []string{"field2", "field.with.dots"},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "trailing period with incorrect fieldsPath",
|
name: "trailing period with incorrect fieldsPath",
|
||||||
inResource: "node.field2.field3.",
|
inResource: "node.field2.field3.",
|
||||||
|
|
Loading…
Reference in New Issue