osbuild-worker: allow adding key to aws.ec2 executor

This is useful during testing to set up the executor machine.
This commit is contained in:
Sanne Raymaekers 2024-02-28 11:03:03 +01:00
parent c480d79e95
commit 040eec4089
5 changed files with 15 additions and 6 deletions

View file

@ -74,6 +74,7 @@ type pulpConfig struct {
type executorConfig struct {
Type string `toml:"type"`
IAMProfile string `toml:"iam_profile"`
KeyName string `toml:"key_name"`
}
type workerConfig struct {

View file

@ -79,6 +79,7 @@ type PulpConfiguration struct {
type ExecutorConfiguration struct {
Type string
IAMProfile string
KeyName string
}
type OSBuildJobImpl struct {
@ -488,7 +489,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error {
case "host":
executor = osbuildexecutor.NewHostExecutor()
case "aws.ec2":
executor = osbuildexecutor.NewAWSEC2Executor(impl.OSBuildExecutor.IAMProfile)
executor = osbuildexecutor.NewAWSEC2Executor(impl.OSBuildExecutor.IAMProfile, impl.OSBuildExecutor.KeyName)
default:
osbuildJobResult.JobError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidConfig, "No osbuild executor defined", nil)
return err

View file

@ -476,6 +476,7 @@ func main() {
OSBuildExecutor: ExecutorConfiguration{
Type: config.OSBuildExecutor.Type,
IAMProfile: config.OSBuildExecutor.IAMProfile,
KeyName: config.OSBuildExecutor.KeyName,
},
KojiServers: kojiServers,
GCPConfig: gcpConfig,