micro/runtime/kubernetes/client/utils_test.go
Milos Gajdos 8dc3fb964e Pass source of service to Deployment API; render templates properly (#969)
* Pass source of service to Deployment API; render templates properly

* Enable Go modules by default. Honor runtime.Service.Exec

* Make sure you remove go.mod and go.sum
2019-11-21 17:31:13 +00:00

27 lines
610 B
Go

package client
import (
"bytes"
"testing"
)
func TestTemplates(t *testing.T) {
name := "foo"
version := "123"
source := "github.com/foo/bar"
// Render default service
s := DefaultService(name, version)
bs := new(bytes.Buffer)
if err := renderTemplate(templates["service"], bs, s); err != nil {
t.Errorf("Failed to render kubernetes service: %v", err)
}
// Render default deployment
d := DefaultDeployment(name, version, source)
bd := new(bytes.Buffer)
if err := renderTemplate(templates["deployment"], bd, d); err != nil {
t.Errorf("Failed to render kubernetes deployment: %v", err)
}
}