Skip to content

Commit

Permalink
Don't create the service for pods
Browse files Browse the repository at this point in the history
The service name is determined by the httpd config so it makes
more sense for it to live in the pods project.
  • Loading branch information
carbonin committed Jan 30, 2020
1 parent 6cccf0d commit 9764856
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions app/models/miq_worker/service_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ module ServiceWorker
def create_container_objects
orchestrator = ContainerOrchestrator.new

orchestrator.create_service(service_name, service_label, SERVICE_PORT)
orchestrator.create_deployment(worker_deployment_name) do |definition|
configure_worker_deployment(definition)

definition[:spec][:serviceName] = service_name
definition[:spec][:template][:metadata][:labels].merge!(service_label)

container = definition[:spec][:template][:spec][:containers].first
Expand Down Expand Up @@ -42,11 +40,7 @@ def add_readiness_probe(container_definition)
end

def service_label
{:service => service_name}
end

def service_name
worker_deployment_name.delete_prefix(deployment_prefix)
{:service => worker_deployment_name.delete_prefix(deployment_prefix)}
end

# Can be overriden by including classes
Expand Down

0 comments on commit 9764856

Please sign in to comment.