Skip to content

Commit

Permalink
Improve the drain scripts
Browse files Browse the repository at this point in the history
- bin/shutdown_drain does not need to echo '0'; this is already done by bin/drain (https://github.com/cloudfoundry/capi-release/blob/2b52d846f82c7dbe893ffc21f879c15a3fa1da36/jobs/cloud_controller_ng/templates/drain.sh.erb#L9).

- As the bin/shutdown_drain script is never invoked with arguments, logging the invocation is superfluous.
  • Loading branch information
philippthun committed May 12, 2021
1 parent 2bb10a5 commit dd4128b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ if [[ $status > 0 ]] ; then
echo $(date --rfc-3339=ns) "Failed to hit ${URL}"
exit $status
fi

3 changes: 0 additions & 3 deletions jobs/cloud_controller_ng/templates/shutdown_drain.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ $LOAD_PATH.unshift('/var/vcap/packages/cloud_controller_ng/cloud_controller_ng/l
require 'cloud_controller/drain'

@drain = VCAP::CloudController::Drain.new('/var/vcap/sys/log/cloud_controller_ng')
@drain.log_invocation(ARGV)
@drain.shutdown_nginx('/var/vcap/sys/run/bpm/cloud_controller_ng/nginx.pid', <%= p("cc.nginx_drain_timeout") %>)
@drain.shutdown_cc('/var/vcap/sys/run/bpm/cloud_controller_ng/cloud_controller_ng.pid')

puts 0 # tell bosh the drain script succeeded

0 comments on commit dd4128b

Please sign in to comment.