mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 03:03:59 +00:00
test: few more correlatedobject test cases
This commit is contained in:
parent
ba9347230e
commit
0149c1f8b3
@ -238,6 +238,64 @@ func TestCorrelation(t *testing.T) {
|
||||
NewValue: "b",
|
||||
OldValue: "oldB",
|
||||
},
|
||||
{
|
||||
Name: "Replaced Key In Old Object",
|
||||
RootObject: map[string]interface{}{
|
||||
"a": "b",
|
||||
},
|
||||
RootOldObject: map[string]interface{}{
|
||||
"b": "a",
|
||||
},
|
||||
Schema: mustSchema(`
|
||||
properties:
|
||||
a: { type: string }
|
||||
`),
|
||||
KeyPath: []interface{}{},
|
||||
NewValue: map[string]interface{}{"a": "b"},
|
||||
OldValue: map[string]interface{}{"b": "a"},
|
||||
},
|
||||
{
|
||||
Name: "Added Key In Old Object",
|
||||
RootObject: map[string]interface{}{
|
||||
"a": "b",
|
||||
},
|
||||
RootOldObject: map[string]interface{}{},
|
||||
Schema: mustSchema(`
|
||||
properties:
|
||||
a: { type: string }
|
||||
`),
|
||||
KeyPath: []interface{}{},
|
||||
NewValue: map[string]interface{}{"a": "b"},
|
||||
OldValue: map[string]interface{}{},
|
||||
},
|
||||
{
|
||||
Name: "Changed list to map",
|
||||
RootObject: map[string]interface{}{
|
||||
"a": "b",
|
||||
},
|
||||
RootOldObject: []interface{}{"a", "b"},
|
||||
Schema: mustSchema(`
|
||||
properties:
|
||||
a: { type: string }
|
||||
`),
|
||||
KeyPath: []interface{}{},
|
||||
NewValue: map[string]interface{}{"a": "b"},
|
||||
OldValue: []interface{}{"a", "b"},
|
||||
},
|
||||
{
|
||||
Name: "Changed string to map",
|
||||
RootObject: map[string]interface{}{
|
||||
"a": "b",
|
||||
},
|
||||
RootOldObject: "a string",
|
||||
Schema: mustSchema(`
|
||||
properties:
|
||||
a: { type: string }
|
||||
`),
|
||||
KeyPath: []interface{}{},
|
||||
NewValue: map[string]interface{}{"a": "b"},
|
||||
OldValue: "a string",
|
||||
},
|
||||
{
|
||||
Name: "Map list type",
|
||||
RootObject: mustUnstructured(`
|
||||
|
Loading…
Reference in New Issue
Block a user