mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-05 03:03:40 +00:00
Expand unit tests of pruning of unknown fields in metadata
This commit is contained in:
@@ -383,6 +383,8 @@ func TestPrune(t *testing.T) {
|
||||
"kind": "Foo",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels":{"foo":"bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"unspecified":"bar",
|
||||
@@ -392,6 +394,8 @@ func TestPrune(t *testing.T) {
|
||||
"unspecified": "bar",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels":{"foo":"bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -404,6 +408,8 @@ func TestPrune(t *testing.T) {
|
||||
"unspecified": "bar",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels":{"foo":"bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -416,6 +422,8 @@ func TestPrune(t *testing.T) {
|
||||
"unspecified": "bar",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels":{"foo":"bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -426,6 +434,8 @@ func TestPrune(t *testing.T) {
|
||||
"unspecified": "bar",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels":{"foo":"bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -438,12 +448,18 @@ func TestPrune(t *testing.T) {
|
||||
`, isResourceRoot: true, schema: &structuralschema.Structural{
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
Properties: map[string]structuralschema.Structural{
|
||||
"metadata": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
},
|
||||
"pruned": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
Extensions: structuralschema.Extensions{
|
||||
XEmbeddedResource: true,
|
||||
},
|
||||
Properties: map[string]structuralschema.Structural{
|
||||
"metadata": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
},
|
||||
"spec": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
},
|
||||
@@ -471,6 +487,9 @@ func TestPrune(t *testing.T) {
|
||||
XEmbeddedResource: true,
|
||||
},
|
||||
Properties: map[string]structuralschema.Structural{
|
||||
"metadata": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
},
|
||||
"spec": {
|
||||
Generic: structuralschema.Generic{Type: "object"},
|
||||
},
|
||||
@@ -487,6 +506,8 @@ func TestPrune(t *testing.T) {
|
||||
"kind": "Foo",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels": {"foo": "bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"pruned": {
|
||||
@@ -494,6 +515,8 @@ func TestPrune(t *testing.T) {
|
||||
"kind": "Foo",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels": {"foo": "bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -505,6 +528,8 @@ func TestPrune(t *testing.T) {
|
||||
"unspecified": "bar",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels": {"foo": "bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -516,6 +541,8 @@ func TestPrune(t *testing.T) {
|
||||
"kind": "Foo",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels": {"foo": "bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
@@ -524,6 +551,8 @@ func TestPrune(t *testing.T) {
|
||||
"kind": "Foo",
|
||||
"metadata": {
|
||||
"name": "instance",
|
||||
"namespace": "myns",
|
||||
"labels": {"foo": "bar"},
|
||||
"unspecified": "bar"
|
||||
},
|
||||
"spec": {
|
||||
|
Reference in New Issue
Block a user