No description
  • Go 97.9%
  • Shell 1.2%
  • HTML 0.8%
  • Makefile 0.1%
Find a file
Raúl Sánchez 99b640fbab
Merge pull request #383 from rawmind0/notallowed
Add configurable retry logic when Rancher responds with 405 method not allowed for node templates
2020-07-20 17:05:43 +02:00
rancher2 Add configurable retry logic when Rancher responds with 405 method not allowed for node templates 2020-07-20 13:31:50 +02:00
scripts Updated Rancher support to v2.4.5. Go modules and vendor files and acceptance tests 2020-06-28 16:39:53 +02:00
vendor Updated Rancher support to v2.4.5. Go modules and vendor files and acceptance tests 2020-06-28 16:39:53 +02:00
website Add configurable retry logic when Rancher responds with 405 method not allowed for node templates 2020-07-20 13:31:50 +02:00
.gitignore updated to start rancher 2018-11-16 15:55:47 -07:00
.travis.yml Updated go to 1.13, modules and vendor files 2020-06-08 10:52:02 +02:00
CHANGELOG.md Updated CHANGELOG.md 2020-07-20 16:56:24 +02:00
GNUmakefile Updated gofmt command to use -s to simplify code notation 2020-06-08 10:52:05 +02:00
go.mod Updated Rancher support to v2.4.5. Go modules and vendor files and acceptance tests 2020-06-28 16:39:53 +02:00
go.sum Updated Rancher support to v2.4.5. Go modules and vendor files and acceptance tests 2020-06-28 16:39:53 +02:00
LICENSE Intitial commit 2018-08-09 18:43:40 +02:00
main.go tf-sdk-migrator migrate 2019-10-18 10:19:19 -06:00
README.md Updated gofmt command to use -s to simplify code notation 2020-06-08 10:52:05 +02:00

Terraform Provider for Rancher v2

Go Report Card

Requirements

  • Terraform >= 0.11.x
  • Go 1.13 to build the provider plugin
  • Docker 17.03.x to run acceptance tests

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-rancher2

$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone git@github.com:terraform-providers/terraform-provider-rancher2

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-rancher2
$ make build

Using the provider

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it. Documentation about the provider specific configuration options can be found on the provider's website.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.9+ 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 $GOPATH/bin .

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

To just compile provider binary on repo path and test on terraform:

$ make bin
$ terraform init
$ terraform plan
$ terraform apply

Testing the Provider

In order to test the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, a running rancher system, a rancher API key and a working k8s cluster imported are needed. Also, acceptance tests are covering Rancher server upgrade, v2.3.6 and v2.4.2

To run acceptance tests, you can simply run make testacc. scripts/gotestacc.sh will be run, deploying all needed requirements, running acceptance tests and cleanup.

$ make testacc

Due to network limitation on docker for osx and/or windows, there is a way to run dockerized acceptance test.

$ EXPOSE_HOST_PORTS=true make docker-testacc