File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -254,10 +254,22 @@ func loadUnitDropins(unit *parser.UnitFile, sourcePaths []string) error {
254
254
prevError = err
255
255
}
256
256
257
- var dropinPaths = make (map [string ]string )
257
+ dropinDirs := []string {}
258
+
258
259
for _ , sourcePath := range sourcePaths {
259
- dropinDir := path .Join (sourcePath , unit .Filename + ".d" )
260
+ dropinDirs = append (dropinDirs , path .Join (sourcePath , unit .Filename + ".d" ))
261
+ }
260
262
263
+ // For instantiated templates, also look in the non-instanced template dropin dirs
264
+ templateBase , templateInstance := unit .GetTemplateParts ()
265
+ if templateBase != "" && templateInstance != "" {
266
+ for _ , sourcePath := range sourcePaths {
267
+ dropinDirs = append (dropinDirs , path .Join (sourcePath , templateBase + ".d" ))
268
+ }
269
+ }
270
+
271
+ var dropinPaths = make (map [string ]string )
272
+ for _ , dropinDir := range dropinDirs {
261
273
dropinFiles , err := os .ReadDir (dropinDir )
262
274
if err != nil {
263
275
if ! errors .Is (err , os .ErrNotExist ) {
You can’t perform that action at this time.
0 commit comments