Skip to content

Latest commit

 

History

History
79 lines (47 loc) · 3.49 KB

CONTRIBUTING.md

File metadata and controls

79 lines (47 loc) · 3.49 KB

Contributing to the provider

Thank you for your interest in contributing to the vSphere provider. We welcome your contributions. Here you'll find information to help you get started with provider development.

Documentation

Our provider development documentation provides a good start into developing an understanding of provider development. It's the best entry point if you are new to contributing to this provider.

To learn more about how to create issues and pull requests in this repository, and what happens after they are created, you may refer to the resources below:

Cloning the Project

First, you will want to clone the repository into your working directory:

git clone [email protected]:hashicorp/terraform-provider-vsphere

Running the Build

After the clone has been completed, you can enter the provider directory and build the provider.

cd terraform-provider-vsphere
make build

Installing the Local Plugin

After the build is complete, you can install the binary into your $GOPATH/bin folder with:

make install

Developing the Provider

NOTE: Before you start work on a feature, please make sure to check the issue tracker and existing pull requests to ensure that work is not being duplicated. For further clarification, you can also ask in a new issue.

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.16+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

See Building the Provider for details on building the provider.

Testing the Provider

NOTE: Testing the vSphere provider is currently a complex operation as it requires having a vCenter Server endpoint to test against, which should be hosting a standard configuration for a vSphere cluster. Some of the tests will work against ESXi, but YMMV.

Configuring Environment Variables

Most of the tests in this provider require a comprehensive list of environment variables to run. See the individual *_test.go files in the vsphere/ directory for more details. The next section also describes how you can manage a configuration file of the test environment variables.

Using the .tf-vsphere-devrc.mk File

The tf-vsphere-devrc.mk.example file contains an up-to-date list of environment variables required to run the acceptance tests. Copy this to $HOME/.tf-vsphere-devrc.mk, change the permissions to something more secure (e.g. chmod 600 $HOME/.tf-vsphere-devrc.mk), and configure the variables accordingly.

Running the Acceptance Tests

After this is done, you can run the acceptance tests by running:

$ make testacc

If you want to run against a specific set of tests, run make testacc with the TESTARGS parameter containing the run mask as per below:

make testacc TESTARGS="-run=TestAccVSphereVirtualMachine"

This following example would run all of the acceptance tests matching TestAccVSphereVirtualMachine. Change this for the specific tests you want to run.