addon-operator
addon-operator copied to clipboard
fix: support 'map merge' feature for OpenAPI schemas in YAML files
Overview
go-openapi/swag package uses yaml.MapSlice type to unmarshal from YAML bytes. This type supports 'direct' anchoring (properties: *anchor) but doesn't support 'map merge' (<<: *anchor). Additional loader is added to unmarshal YAML bytes into interface{}, so 'map merge' is now supported.
Add tests to check for anchor support and also check if $ref is working.
What this PR does / why we need it
'map merge' is a convinient feature of YAML format, we use it in CRDs in deckhouse to copy and add properties between objects: OpenStackClusterConfiguration