Check the validity of the kubeconfig template [#13]

It's a little tricky to find a balance between "brittle" and "thorough"
in this test--I'd like to verify that e.g. the certificate is in
clusters[0].cluster.certificate-authority-data, not at the root. On the
other hand, we can't actually show that it's a valid kubeconfig file
without actually *using* it, so there's a hard upper limit on the
strength of the assertions. I've settled on verifying that all the
settings make it into the file and the file is syntactically-valid yaml.
This commit is contained in:
Erin Call
2019-12-25 10:10:30 -08:00
parent 801598e1c5
commit 6b331fdf03
3 changed files with 59 additions and 3 deletions

1
go.mod
View File

@@ -3,6 +3,7 @@ module github.com/pelotech/drone-helm3
go 1.13
require (
github.com/go-yaml/yaml v2.1.0+incompatible
github.com/golang/mock v1.3.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/stretchr/testify v1.4.0