Skip to content

Commit

Permalink
Prevent overriding the user-side with the imported global parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mumoshu committed Aug 6, 2020
1 parent bd352cd commit 7f9c21b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/app/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,18 @@ func newApp(app *App, cc *HCL2Config, importBaseDir string) (*App, error) {
for _, importedJob := range importedJobs {
var newJobName string
if j.Name == "" {
if importedJob.Name == "" {
// Skip overriding the job itself
// This means that if the user is importing library jobs in the top-level `import`,
// the user-side needs the exact set of global `parameters` and `options` as the library,
// to make library jobs work
continue
}
newJobName = importedJob.Name
} else if importedJob.Name != "" {
newJobName = fmt.Sprintf("%s %s", j.Name, importedJob.Name)
} else {
// Import the top-level job in the library as the non-top-level job on the user side
newJobName = j.Name
}

Expand Down

0 comments on commit 7f9c21b

Please sign in to comment.