diff --git a/launch.go b/launch.go index 96a8e14..ae557ac 100644 --- a/launch.go +++ b/launch.go @@ -310,7 +310,17 @@ 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 { - resultMeta = deepMergeJSON(resultMeta, parentBuild.Meta) + 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(externalParentBuildMeta, "parameters") + + resultMeta = deepMergeJSON(resultMeta, externalParentBuildMeta) } // delete local version of external meta