Skip to content

Commit

Permalink
Merge pull request #18 from lawrencegripper/lg/issue/couchbasecrd
Browse files Browse the repository at this point in the history
Add additional test cases. Fix apiVersion: v1 issue. Add retry on create
  • Loading branch information
lawrencegripper authored Apr 18, 2019
2 parents ae8538a + 3870b8c commit 2699cc2
Show file tree
Hide file tree
Showing 52 changed files with 1,062 additions and 4,891 deletions.
3 changes: 3 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ test: fmtcheck
testacc: fmtcheck
TF_ACC=1 go test ./kubernetes -v $(TESTARGS) -timeout 120m -count=1

testacc-startk3:
rm -f -r /var/lib/rancher/k3s/data && /home/lawrence/go/bin/k3s server

testacck3: fmtcheck
TF_ACC=1 TF_LOG=DEBUG KUBECONFIG=/etc/rancher/k3s/k3s.yaml go test ./kubernetes -v $(TESTARGS) -timeout 120m -count=1

Expand Down
28 changes: 12 additions & 16 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@
[[constraint]]
name = "github.com/stretchr/testify"
version = "1.3.0"

[[constraint]]
name = "github.com/cenkalti/backoff"
version = "2.1.1"
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,43 @@ spec:
}
```

The provider also support a retry when creating the resource `create_retry_count = 15`. This is useful for `CRD`s who's operators are also being created during the `terraform` operation to allow time for the `CRD` definition to be created in the cluster.

```hcl
provider "k8sraw" {
create_retry_count = 15
}
resource "k8sraw_yaml" "test" {
yaml_body = <<YAML
apiVersion: couchbase.com/v1
kind: CouchbaseCluster
metadata:
name: name-here-cluster
spec:
baseImage: name-here-image
version: name-here-image-version
authSecret: name-here-operator-secret-name
exposeAdminConsole: true
adminConsoleServices:
- data
cluster:
dataServiceMemoryQuota: 256
indexServiceMemoryQuota: 256
searchServiceMemoryQuota: 256
eventingServiceMemoryQuota: 256
analyticsServiceMemoryQuota: 1024
indexStorageSetting: memory_optimized
autoFailoverTimeout: 120
autoFailoverMaxCount: 3
autoFailoverOnDataDiskIssues: true
autoFailoverOnDataDiskIssuesTimePeriod: 120
autoFailoverServerGroup: false
YAML
}
```


## Building The Provider

Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-kubernetes`
Expand Down
4 changes: 3 additions & 1 deletion _examples/crds/basic_crd.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
provider "k8sraw" {}
provider "k8sraw" {
create_retry_count = 15
}


resource "k8sraw_yaml" "test" {
Expand Down
Loading

0 comments on commit 2699cc2

Please sign in to comment.