Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: task(bosh-delete-apply): ignore errors on bosh delete deployment #307

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tasks/bosh/delete_deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Bosh
# holds bosh delete deployment command
class DeleteDeployment < Executor
def execute(name)
bosh_command = "bosh delete-deployment --json --non-interactive -d #{name}"
bosh_command = "bosh delete-deployment --json --non-interactive -d #{name} --force"
self.class.run_command(bosh_command)
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/lib/tasks/bosh/delete_deployment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
let(:expected_result) { delete_deployment_response }

before do
allow(Open3).to receive(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name}").
allow(Open3).to receive(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name} --force").
and_return([delete_deployment_json_response, nil, process_status_zero])
end

it "executes a bosh command" do
expect(command_output).to match(expected_result)

expect(Open3).to have_received(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name}")
expect(Open3).to have_received(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name} --force")
end
end

Expand All @@ -59,7 +59,7 @@
let(:stdout) { "o" }

before do
allow(Open3).to receive(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name}").once.
allow(Open3).to receive(:capture3).with(cmd_env, "bosh delete-deployment --json --non-interactive -d #{my_deployment_name} --force").once.
and_return([stdout, stderr, process_status_one])
end

Expand Down