Commit feb92e1b authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #53402 from dougm/import-known-versions-test

Automatic merge from submit-queue (batch tested with PRs 53418, 53366, 53115, 53402, 53130). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Ignore unexported fields in import_known_versions_test Tests currently fail with: "import_known_versions_test.go:122: Unexpected type uint in ..." **What this PR does / why we need it**: Running `make test` against the latest (f11a551f) fails for me with: ``` import_known_versions_test.go:122: Unexpected type uint in schema.GroupVersionKind{Group:"apps", Version:"__internal", Kind:"DaemonSet"} import_known_versions_test.go:122: Unexpected type uint in schema.GroupVersionKind{Group:"apps", Version:"__internal", Kind:"DaemonSet"} import_known_versions_test.go:124: extensions.DaemonSet: import_known_versions_test.go:124: extensions.DaemonSetSpec: import_known_versions_test.go:124: api.PodTemplateSpec: import_known_versions_test.go:124: api.PodSpec: import_known_versions_test.go:124: []api.Container: import_known_versions_test.go:124: api.Container: import_known_versions_test.go:124: []api.EnvVar: import_known_versions_test.go:124: api.EnvVar: import_known_versions_test.go:124: *api.EnvVarSource: import_known_versions_test.go:124: api.EnvVarSource: import_known_versions_test.go:124: *api.ResourceFieldSelector: import_known_versions_test.go:124: api.ResourceFieldSelector: import_known_versions_test.go:124: resource.Quantity: import_known_versions_test.go:124: resource.infDecAmount: import_known_versions_test.go:124: *inf.Dec: import_known_versions_test.go:124: inf.Dec: import_known_versions_test.go:124: big.Int: import_known_versions_test.go:124: big.nat: import_known_versions_test.go:124: big.Word: ``` **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53508 **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 536f9ac1 06205696
...@@ -106,6 +106,9 @@ func ensureNoTags(t *testing.T, gvk schema.GroupVersionKind, tp reflect.Type, pa ...@@ -106,6 +106,9 @@ func ensureNoTags(t *testing.T, gvk schema.GroupVersionKind, tp reflect.Type, pa
case reflect.Struct: case reflect.Struct:
for i := 0; i < tp.NumField(); i++ { for i := 0; i < tp.NumField(); i++ {
f := tp.Field(i) f := tp.Field(i)
if f.PkgPath != "" {
continue // Ignore unexported fields
}
jsonTag := f.Tag.Get("json") jsonTag := f.Tag.Get("json")
protoTag := f.Tag.Get("protobuf") protoTag := f.Tag.Get("protobuf")
if len(jsonTag) > 0 || len(protoTag) > 0 { if len(jsonTag) > 0 || len(protoTag) > 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment