mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Add tests
This commit is contained in:
parent
bab2c18c24
commit
5dca1be016
@ -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
Block a user