diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go index 35324a633e..0a08eb798b 100644 --- a/pkg/trait/mount.go +++ b/pkg/trait/mount.go @@ -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 {