Skip to content

Commit

Permalink
OpentofuWorker#stop_worker should delete the pod
Browse files Browse the repository at this point in the history
OpentofuWorker is a ServiceWorker but also isn't scalable (aka it is a
deployment-per-worker type).

This means that when we want to stop an OpentofuWorker we have to delete
the deployment, not simply scale the deployment.
  • Loading branch information
agrare committed Sep 18, 2024
1 parent 5021cc4 commit b91bddc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/opentofu_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ def add_readiness_probe(container_definition)
}
end

# The opentofu-runner pod is a service worker but isn't scalable so the
# stop_container method should delete_container_objects like a deployment-per-worker
# not scale_deployment like a service_worker.
def stop_container
delete_container_objects
end

private

# There can only be a single instance running so the unit name can just be
Expand Down

0 comments on commit b91bddc

Please sign in to comment.