Skip to content

google_compute_instance_group: location symbol doesn't exist #21

Closed
@darkn3rd

Description

@darkn3rd

Description

The google_compute_instance_group example incorrectly documents location as a valid symbol. Also, if invalid symbol is used, get a cryptic message as the result.

Reproduce

PROJECT_NAME = attribute('project_name', description: 'gcp project name')
CLUSTER_ZONE = attribute('cluster_zone', default: 'us-east1-b', description: 'gcp cluster zone')

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

Actual Result

     ×  Control Source Code Error guestbook-profile/controls/cluster_test.rb:10
     765: unexpected token at 'Not Found'

Expect Result

If there was a bad symbol used, I would expect a message that states: Symbol location: not supported or something.

The example in the class documents this:

  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
    "

When the code expects zone. Interestingly, google uses the term location, but expects a zone, and the Inspec class supports zone.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions