Skip to content

Latest commit

 

History

History
69 lines (43 loc) · 2.98 KB

developers.md

File metadata and controls

69 lines (43 loc) · 2.98 KB

Developer Guide

Prerequisites

  • Go 1.10.0 or later
  • kubectl 1.10 or later
  • An Azure account (to deploy VMs and Azure infrastructure)
  • Git

Building the Provider

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

To compile the provider, run make build. This will build the provider and put the provider binary in the $GOPATH/bin directory.

$ make build
...
$ $GOPATH/bin/terraform-provider-acsengine
...

Structure of Code

The code for this project is organized as follows:

  • The acsengine folder contains most of the Go code specific to configuring acs-engine Kubernetes clusters through Terraform. This folder also contains tests for files in that folder.
  • The docs folder contains user and developer documentation and examples
  • The vendor folder is managed by Golang Dep and should not be modified except through Gopkg.toml.

Git Conventions

We use Git for our version control system. The master branch is the home of current development. Releases will eventually be tagged...

We accept changes to code via GitHub pull requests. Look at CONTRIBUTING.md for guidelines on submitting a PR.

Third Party Dependencies

Third party dependencies reside locally inside the respository under the vendor directory. The dependency manager used is dep. Changes to dependencies can be made at Gopkg.toml.

If there seem to be dependencies missing, you can run make vendor. If you want to check which versions are being used, you can run make vendor-status.

Go Conventions

We follow the Go coding style standards.

To check that your code meets our standards, run make lint. This will run gometalinter.

Unit Tests

Unit tests can run via make test. This will not create any Azure resources.

End-to-End Tests

There are Terraform acceptance tests which create, test, and destroy a cluster. These can be run with make testacc. These will create actual Azure resources. There may be cases where a test stops prematurely and resources are not deleted, so you may want to make sure you do not have unused VMs and resource groups leftover if tests fail.

You will need to have the following environment variables set:

  • ARM_CLIENT_ID: Azure client ID
  • ARM_CLIENT_SECRET: Azure client secret
  • ARM_SUBSCRIPTION_ID: Azure subscription UUID
  • ARM_TENANT_ID: Azure tenant UUID
  • ARM_TEST_VAULT_ID: Azure vault ID used for storing test certificates and keys
  • ARM_TEST_LOCATION: Azure region used for creating test resources
  • SSH_KEY_PUB: Public SSH key