Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/crd/flatten.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,8 @@ func flattenAllOfInto(dst *apiext.JSONSchemaProps, src apiext.JSONSchemaProps, e
flattenAllOfInto(dstProps.Schema, *srcProps.Schema, errRec)
case "XPreserveUnknownFields":
dstField.Set(srcField)
case "XMapType":
dstField.Set(srcField)
// NB(directxman12): no need to explicitly handle nullable -- false is considered to be the zero value
// TODO(directxman12): src isn't necessarily the field value -- it's just the most recent allOf entry
default:
Expand Down
4 changes: 1 addition & 3 deletions pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7278,9 +7278,6 @@ spec:
description: Checks that multiply-nested maps work
type: object
nestedStructWithSeveralFields:
allOf:
- x-kubernetes-map-type: atomic
- x-kubernetes-map-type: atomic
description: A struct that can only be entirely replaced via a nested
type.
properties:
Expand All @@ -7292,6 +7289,7 @@ spec:
- bar
- foo
type: object
x-kubernetes-map-type: atomic
nestedassociativeList:
description: This tests that associative lists work via a nested type.
items:
Expand Down