Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 2.07 KB

CONTRIBUTING.md

File metadata and controls

31 lines (20 loc) · 2.07 KB

Contributing to Terraform Provider Google

This provider is generated by Magic Modules, and the repository contents are effectively read-only.

To get started making a contribution, see https://github.com/GoogleCloudPlatform/magic-modules#magic-modules.

Documentation not yet migrated

Most content on this page has been migrated to the Magic Modules README (https://github.com/GoogleCloudPlatform/magic-modules). The remaining sections in this document have not made it over yet; most are maintainer-specific.

Ensuring no plan-time difference to latest provider release (optional)

In a case where you are editing an existing field you might want to ensure the resource you are modifying doesn't result in a diff to existing deployments. You can run set the environment variable RELEASE_DIFF before running a test. This will append plan only steps using the latest released/published provider (google or google-beta) after all configuration deployments to ensure uniformity.

export RELEASE_DIFF=true
TF_LOG=TRACE make testacc TEST=./google TESTARGS='-run=TestAccContainerNodePool_basic' > output.log

Sweepers

Running provider tests often can lead to dangling test resources caused by test failures. Terraform has a capability to run Sweepers which can go through and delete resources. In TPG, sweepers mainly:

  1. List every resource in a project of a specific kind
  2. Iterate through the list and determine if a resource is sweepable
  3. If sweepable, delete the resource

Sweepers run by using the -sweep and -sweep-run TESTARGS flags:

TF_LOG=TRACE make testacc TEST=./google TESTARGS='-sweep=us-central1 -sweep-run=<sweeper-name-here>' > output.log