Add unit test for komposeConvert

This commit is contained in:
Janet Kuo
2016-08-12 18:21:56 -07:00
parent 3fcfb71006
commit 14726f1a53
6 changed files with 259 additions and 36 deletions
+2 -11
View File
@@ -19,6 +19,7 @@ package kobject
import (
"github.com/Sirupsen/logrus"
"github.com/fatih/structs"
"k8s.io/kubernetes/pkg/api"
)
var unsupportedKey = map[string]int{
@@ -162,19 +163,9 @@ type EnvVar struct {
type Ports struct {
HostPort int32
ContainerPort int32
Protocol Protocol
Protocol api.Protocol
}
// Protocol defines network protocols supported for things like container ports.
type Protocol string
const (
// ProtocolTCP is the TCP protocol.
ProtocolTCP Protocol = "TCP"
// ProtocolUDP is the UDP protocol.
ProtocolUDP Protocol = "UDP"
)
func CheckUnsupportedKey(service interface{}) {
s := structs.New(service)
for _, f := range s.Fields() {