-
Steve Azzopardi authored
Update the `Release` signature of the `ExecutorProvider` interface. Returning an error when releasing a resource is not actionable, and all of the implementations of `ExecutorProvider` do not return an error.
Steve Azzopardi authoredUpdate the `Release` signature of the `ExecutorProvider` interface. Returning an error when releasing a resource is not actionable, and all of the implementations of `ExecutorProvider` do not return an error.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
default_executor_provider.go 972 B
package executors
import (
"errors"
"gitlab.com/gitlab-org/gitlab-runner/common"
)
type DefaultExecutorProvider struct {
Creator func() common.Executor
FeaturesUpdater func(features *common.FeaturesInfo)
DefaultShellName string
}
func (e DefaultExecutorProvider) CanCreate() bool {
return e.Creator != nil
}
func (e DefaultExecutorProvider) Create() common.Executor {
if e.Creator == nil {
return nil
}
return e.Creator()
}
func (e DefaultExecutorProvider) Acquire(config *common.RunnerConfig) (common.ExecutorData, error) {
return nil, nil
}
func (e DefaultExecutorProvider) Release(config *common.RunnerConfig, data common.ExecutorData) {}
func (e DefaultExecutorProvider) GetFeatures(features *common.FeaturesInfo) error {
if e.FeaturesUpdater == nil {
return errors.New("cannot evaluate features")
}
e.FeaturesUpdater(features)
return nil
}
func (e DefaultExecutorProvider) GetDefaultShell() string {
return e.DefaultShellName
}