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

Fixes according to issues: #19, #20, #21 and #22. #24

Merged
merged 1 commit into from
Jun 11, 2018
Merged
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
4 changes: 4 additions & 0 deletions libraries/google_compute_firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ def ports_protocol_allowed(port_list, protocol = 'tcp', index = 0)
end
end

def exists?
[email protected]?
end

def to_s
"Firewall Rule #{@display_name}"
end
Expand Down
4 changes: 4 additions & 0 deletions libraries/google_compute_image.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def initialize(opts = {})
end
end

def exists?
[email protected]?
end

def to_s
"Image #{@display_name}"
end
Expand Down
6 changes: 5 additions & 1 deletion libraries/google_compute_instance_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class GoogleComputeInstanceGroup < GcpResourceBase
desc 'Verifies settings for a compute instance group'

example "
describe google_compute_instance_group(project: 'chef-inspec-gcp', location: 'us-west2', name: 'gcp-inspec-test') do
describe google_compute_instance_group(project: 'chef-inspec-gcp', zone: 'europe-west2-a', name: 'gcp-inspec-test') do
it { should exist }
its('name') { should eq 'inspec-test' }
its('status') { should eq 'in_use' }
Expand Down Expand Up @@ -38,6 +38,10 @@ def get_named_ports(index = 0, key = :name)
named_ports[index].item[key]
end

def exists?
!@instance_group.nil?
end

def to_s
"Instance Group #{@display_name}"
end
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_container_node_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GoogleContainerNodePool < GcpResourceBase
desc 'Verifies settings for a container nodepool'

example "
describe gcp_container_nodepool(project: 'chef-inspec-gcp', zone: 'gcp-inspec-test', name: 'cluster-name') do
describe google_container_node_pool(project: 'chef-inspec-gcp', zone: 'gcp-inspec-test', cluster_name: 'cluster-name', nodepool_name: 'nodepool_name') do
it { should exist }
its('name') { should eq 'inspec-test' }
its('status') { should eq 'in_use' }
Expand Down
2 changes: 1 addition & 1 deletion libraries/google_service_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def initialize(opts = {})
end

def exists?
!@iam_role.nil?
!@service_account.nil?
end

def to_s
Expand Down