mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 22:05:59 +00:00
apiextensions: fix variable name
This commit is contained in:
parent
e280ec0fa2
commit
5d000b1339
@ -29,11 +29,11 @@ import (
|
|||||||
|
|
||||||
func TestPrune(t *testing.T) {
|
func TestPrune(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
json string
|
json string
|
||||||
dontPruneMetaAtRoot bool
|
isResourceRoot bool
|
||||||
schema *structuralschema.Structural
|
schema *structuralschema.Structural
|
||||||
expected string
|
expected string
|
||||||
}{
|
}{
|
||||||
{name: "empty", json: "null", expected: "null"},
|
{name: "empty", json: "null", expected: "null"},
|
||||||
{name: "scalar", json: "4", schema: &structuralschema.Structural{}, expected: "4"},
|
{name: "scalar", json: "4", schema: &structuralschema.Structural{}, expected: "4"},
|
||||||
@ -397,7 +397,7 @@ func TestPrune(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`, dontPruneMetaAtRoot: true, schema: &structuralschema.Structural{
|
`, isResourceRoot: true, schema: &structuralschema.Structural{
|
||||||
Generic: structuralschema.Generic{Type: "object"},
|
Generic: structuralschema.Generic{Type: "object"},
|
||||||
Properties: map[string]structuralschema.Structural{
|
Properties: map[string]structuralschema.Structural{
|
||||||
"pruned": {
|
"pruned": {
|
||||||
@ -508,7 +508,7 @@ func TestPrune(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
Prune(in, tt.schema, tt.dontPruneMetaAtRoot)
|
Prune(in, tt.schema, tt.isResourceRoot)
|
||||||
if !reflect.DeepEqual(in, expected) {
|
if !reflect.DeepEqual(in, expected) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
enc := json.NewEncoder(&buf)
|
enc := json.NewEncoder(&buf)
|
||||||
|
Loading…
Reference in New Issue
Block a user