Skip to content

Commit

Permalink
Merge pull request #698 from chrischdi/pr-fix-XMapTypeFlatten-cp-0.9
Browse files Browse the repository at this point in the history
馃悰 Fix crd flattening for structType marker to not create duplicate entries for XMapType
  • Loading branch information
k8s-ci-robot committed Jun 29, 2022
2 parents c8fc4d4 + f50232a commit 0c985d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pkg/crd/flatten.go
Expand Up @@ -143,6 +143,8 @@ func flattenAllOfInto(dst *apiext.JSONSchemaProps, src apiext.JSONSchemaProps, e
dstProps.Schema = &apiext.JSONSchemaProps{}
}
flattenAllOfInto(dstProps.Schema, *srcProps.Schema, errRec)
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
Expand Up @@ -7277,9 +7277,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 @@ -7291,6 +7288,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

0 comments on commit 0c985d9

Please sign in to comment.