Skip to content

Commit

Permalink
chore(trait): run mount only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Nov 24, 2023
1 parent fcab504 commit 7b8179a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/trait/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ func (t *mountTrait) Configure(e *Environment) (bool, *TraitCondition, error) {
}
}

// mount trait needs always to be executed as it will process the sources
return true, nil, nil
// mount trait needs to be executed only when it has sources attached or any trait configuration
return len(e.Integration.Sources()) > 0 ||
len(t.Configs) > 0 ||
len(t.Resources) > 0 ||
len(t.Volumes) > 0, nil, nil
}

func (t *mountTrait) Apply(e *Environment) error {
Expand Down

0 comments on commit 7b8179a

Please sign in to comment.