Skip to content

Commit

Permalink
fix(2646): Deep copy parent build meta before deleting the parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar1312 committed Feb 18, 2022
1 parent 492be64 commit 1991f07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,15 @@ func SetExternalMeta(api screwdriver.API, pipelineID, parentBuildID int, mergedM
externalMetaFile := "sd@" + strconv.Itoa(parentJob.PipelineID) + ":" + parentJob.Name + ".json"
writeMetafile(metaSpace, externalMetaFile, metaLog, parentBuild.Meta)
if join {
marshallValue, err := json.Marshal(parentBuild.Meta)
if err != nil {
return resultMeta, fmt.Errorf("Cloning meta of Parent Build ID %d: %v", parentBuildID, err)
}
var externalParentBuildMeta map[string]interface{}
json.Unmarshal(marshallValue, &externalParentBuildMeta)

// Always exclude parameters from external meta
delete(parentBuild.Meta, "parameters")
delete(externalParentBuildMeta, "parameters")

resultMeta = deepMergeJSON(resultMeta, parentBuild.Meta)
}
Expand Down

0 comments on commit 1991f07

Please sign in to comment.