Skip to content

Commit

Permalink
Merge pull request #143 from MUzairS15/fix
Browse files Browse the repository at this point in the history
initialize map string interface
  • Loading branch information
Mohd Uzair authored Aug 22, 2024
2 parents df2f911 + adcaa02 commit b0648a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions models/v1beta1/pattern/design_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,7 @@ func (p *PatternFile) convertToTraits(service *v1alpha2.Service, component *comp
}

func (p *PatternFile) convertFromSettings(component *component.ComponentDefinition, service *v1alpha2.Service) error {
if component.Configuration == nil {
component.Configuration = make(map[string]interface{}, 0)
}


metadata := make(map[string]interface{})

if service.Labels != nil {
Expand All @@ -206,6 +203,13 @@ func (p *PatternFile) convertFromSettings(component *component.ComponentDefiniti
}

component.Configuration = service.Settings
if component.Configuration == nil {
component.Configuration = make(map[string]interface{}, 0)
}

if component.Configuration["metadata"] == nil {
component.Configuration["metadata"] = make(map[string]interface{})
}
component.Configuration["metadata"] = metadata
return nil
}
Expand Down

0 comments on commit b0648a3

Please sign in to comment.