Use BundleFactory instead of bundle in executors

This will allow to avoid using nil bundle and performing
additional checks inside the executors

Change-Id: Ia061cccf7e0a7948bbc5c8fce24e0e6f8b3256e1
This commit is contained in:
Kostiantyn Kalynovskyi
2020-09-21 12:46:23 -05:00
parent eb40a5700f
commit e6e56ffa2e
14 changed files with 153 additions and 92 deletions

View File

@@ -66,6 +66,10 @@ type Bundle interface {
var pluginPath string
var pluginPathLock = &sync.Mutex{}
// BundleFactoryFunc is a function that returns bundle, can be used to build bundle on demand
// instead of inplace, useful, when you don't know if bundle will be needed or not, see phase for detail
type BundleFactoryFunc func() (Bundle, error)
// NewBundleByPath helper function that returns new document.Bundle interface based on clusterType and
// phase, example: helpers.NewBunde(airConfig, "ephemeral", "initinfra")
func NewBundleByPath(rootPath string) (Bundle, error) {