Skip to content

Commit

Permalink
Merge pull request #164 from agrare/add_supports_terminate_feature
Browse files Browse the repository at this point in the history
Add supports terminate feature
  • Loading branch information
chessbyte authored May 29, 2020
2 parents 6480afa + 44d86ac commit 19a452d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ module ManageIQ::Providers::Kubevirt::InfraManager::Vm::Operations

include_concern 'Power'

included do
supports :terminate do
unsupported_reason_add(:terminate, unsupported_reason(:control)) unless supports_control?
end
end

def raw_destroy
require 'fog/kubevirt'
ext_management_system.with_provider_connection do |connection|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
let(:vm_metadata) { double("vm_metadata", :namespace => "default") }
let(:provider_vm) { double("provider_vm", :metadata => vm_metadata) }

it "supports_terminate?" do
expect(vm.supports_terminate?).to be_truthy
end

context 'running vm' do
it 'removes an running vm from kubevirt provider' do
allow(connection).to receive(:vm_instance).and_return(vm_instance)
Expand Down

0 comments on commit 19a452d

Please sign in to comment.