Skip to content

Commit

Permalink
Merge pull request #55 from Fryguy/add_workflow_service_account
Browse files Browse the repository at this point in the history
Pass the workflow service account
  • Loading branch information
kbrock authored Oct 12, 2023
2 parents bc28c48 + 74af26d commit d73c48c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions lib/manageiq/providers/workflows/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ def self.floe_docker_runner
host = ENV.fetch("KUBERNETES_SERVICE_HOST")
port = ENV.fetch("KUBERNETES_SERVICE_PORT")

Floe::Workflow::Runner::Kubernetes.new(
"server" => URI::HTTPS.build(:host => host, :port => port).to_s,
"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")
)
options = {
"server" => URI::HTTPS.build(:host => host, :port => port).to_s,
"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")
}

Floe::Workflow::Runner::Kubernetes.new(options)
elsif MiqEnvironment::Command.is_appliance? || MiqEnvironment::Command.supports_command?("podman")
options = {}
if Rails.env.production?
Expand Down
2 changes: 1 addition & 1 deletion manageiq-providers-workflows.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_dependency "floe", "~> 0.4.1"
spec.add_dependency "floe", "~> 0.5.0"

spec.add_development_dependency "manageiq-style"
spec.add_development_dependency "simplecov", ">= 0.21.2"
Expand Down

0 comments on commit d73c48c

Please sign in to comment.