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

google_compute_instance_group doesn't respond to exists? or exist? #22

Closed
darkn3rd opened this issue Jun 8, 2018 · 2 comments
Closed
Assignees

Comments

@darkn3rd
Copy link

darkn3rd commented Jun 8, 2018

Summary

When using it { should exist } as per embedded documentation for google_compute_instance_group, getting error. Also, if this is indeed not supported, it would not be consistent with other resources.

Reproduce

describe google_compute_instance_group(project: PROJECT_NAME, zone: CLUSTER_ZONE, name: 'gke-guestbook-default-pool-d84d40bd-grp') do
    it { should exist }
end

Actual Result

     ×  Instance Group gke-guestbook-default-pool-d84d40bd-grp should exist
     expected Instance Group gke-guestbook-default-pool-d84d40bd-grp to exist but it does not respond to either `exist?` or `exists?`

Expected

Expected this to work as per embedded documentation:

Embedded Docs:

  class GoogleComputeInstanceGroup < GcpResourceBase
    name 'google_compute_instance_group'
    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
        it { should exist }
        its('name') { should eq 'inspec-test' }
        its('status') { should eq 'in_use' }
        ...
      end
    "
@darkn3rd
Copy link
Author

darkn3rd commented Jun 8, 2018

Also, as per embedded doc example, the its('status') { should eq 'in_use' } is invalid:

     ×  Instance Group gke-guestbook-default-pool-d84d40bd-grp status
     undefined method `status' for Instance Group gke-guestbook-default-pool-d84d40bd-grp:#<Class:0x00007fc4b684a1c0>

@skpaterson
Copy link

Well spotted, the exists methods were missing for google_compute_instance_group - will get these added ASAP.

@skpaterson skpaterson self-assigned this Jun 11, 2018
skpaterson pushed a commit that referenced this issue Jun 11, 2018
* Ensure resources have consistent exists methods.
* Corrected a coupld of arguments in example doc strings.

Signed-off-by: Stuart Paterson <spaterson@chef.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants