Skip to content

Commit

Permalink
Fix issue where new service account ENV var is forced in every process
Browse files Browse the repository at this point in the history
ManageIQ::Providers::Workflows::Engine.floe_docker_runner is called in a
config/initializer, which means that it is being executed in every Rails
environment on boot. This includes things like `bin/rake evm:deployment_status`,
which happens very early on in the orchestrator boot process.

When the orchestrator is on Kubernetes, it starts creating a
Floe::Kubernetes::Runner, but then requires the new
AUTOMATION_JOB_SERVICE_ACCOUNT, which doesn't exist as it is only meant
to exist in the new AutomationWorker. Because of this the orchestrator
fails to boot.

This commit allows that value to be nil, so it can move on. However, we
should find a way to avoid creating the runner on every boot, which is a
better solution.
  • Loading branch information
Fryguy committed Oct 14, 2023
1 parent d73c48c commit 55e15c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/manageiq/providers/workflows/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def self.floe_docker_runner
"token_file" => "/run/secrets/kubernetes.io/serviceaccount/token",
"ca_cert" => "/run/secrets/kubernetes.io/serviceaccount/ca.crt",
"namespace" => File.read("/run/secrets/kubernetes.io/serviceaccount/namespace"),
"task_service_account" => ENV.fetch("AUTOMATION_JOB_SERVICE_ACCOUNT")
"task_service_account" => ENV.fetch("AUTOMATION_JOB_SERVICE_ACCOUNT", nil)
}

Floe::Workflow::Runner::Kubernetes.new(options)
Expand Down

0 comments on commit 55e15c6

Please sign in to comment.