Skip to content

Commit 83f6193

Browse files
authored
Merge pull request #277 from munnerz/apiextensions-json-type
🐛 Add apiextensions JSON type to known_types.go
2 parents a5ed99b + d30e5fc commit 83f6193

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/crd/known_types.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ var KnownPackages = map[string]PackageOverride{
8484
}
8585
// No point in calling AddPackage, this is the sole inhabitant
8686
},
87+
88+
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1": func(p *Parser, pkg *loader.Package) {
89+
p.Schemata[TypeIdent{Name: "JSON", Package: pkg}] = apiext.JSONSchemaProps{
90+
XPreserveUnknownFields: boolPtr(true),
91+
}
92+
p.AddPackage(pkg) // get the rest of the types
93+
},
94+
}
95+
96+
func boolPtr(b bool) *bool {
97+
return &b
8798
}
8899

89100
// AddKnownTypes registers the packages overrides in KnownPackages with the given parser.

0 commit comments

Comments
 (0)