Fix service generation and add tests I should have included in the first place.

This commit is contained in:
Brendan Burns
2015-02-04 12:14:53 -08:00
parent 926f46bf8a
commit fa6ddf13e5
3 changed files with 152 additions and 9 deletions

View File

@@ -51,9 +51,6 @@ $ kubectl expose streamer --port=4100 --protocol=udp --service-name=video-stream
client, err := f.Client(cmd)
checkErr(err)
rc, err := client.ReplicationControllers(namespace).Get(args[0])
checkErr(err)
generatorName := GetFlagString(cmd, "generator")
generator, found := kubectl.Generators[generatorName]
if !found {
@@ -70,6 +67,8 @@ $ kubectl expose streamer --port=4100 --protocol=udp --service-name=video-stream
params["name"] = GetFlagString(cmd, "service-name")
}
if _, found := params["selector"]; !found {
rc, err := client.ReplicationControllers(namespace).Get(args[0])
checkErr(err)
params["selector"] = kubectl.MakeLabels(rc.Spec.Selector)
}
if GetFlagBool(cmd, "create-external-load-balancer") {