Skip to content

Commit

Permalink
fix CreateBlueprintDisplayMetadata function when there is no existing…
Browse files Browse the repository at this point in the history
… data
  • Loading branch information
tjy9206 committed Oct 18, 2024
1 parent 70fdd57 commit f02ce3c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/bpmetadata/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,12 @@ func CreateBlueprintDisplayMetadata(bpPath string, bpDisp, bpCore *BlueprintMeta
bpDisp.Spec.Info.Source = bpCore.Spec.Info.Source
buildUIInputFromVariables(bpCore.Spec.Interfaces.Variables, bpDisp.Spec.Ui.Input)

existingInput := proto.Clone(bpCore.Spec.Ui.Input).(*BlueprintUIInput)
existingInput := func() *BlueprintUIInput {
if bpCore.Spec.Ui != nil && bpCore.Spec.Ui.Input != nil {
return proto.Clone(bpCore.Spec.Ui.Input).(*BlueprintUIInput)
}
return &BlueprintUIInput{}
}()
// Merge existing data (if any) into the newly generated UI Input
mergeExistingAltDefaults(bpDisp.Spec.Ui.Input, existingInput)

Expand Down

0 comments on commit f02ce3c

Please sign in to comment.