From bb3900f44765bd34ab185379939bd6c00f961c19 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 22 Sep 2014 12:39:29 -0700 Subject: [PATCH 1/2] Make "kubecfg -s run ..." select correctly kubecfg run creates a replication controller which sets all pods with a replicationController= label, but then sets up a service selecting on name= instead. This fixes that. kubecfg -s run ... can now actually work. --- pkg/kubecfg/kubecfg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubecfg/kubecfg.go b/pkg/kubecfg/kubecfg.go index d03aea5da4e..11dfd45bc93 100644 --- a/pkg/kubecfg/kubecfg.go +++ b/pkg/kubecfg/kubecfg.go @@ -255,7 +255,7 @@ func createService(name string, port int, client client.Interface) (*api.Service "name": name, }, Selector: map[string]string{ - "name": name, + "replicationController": name, }, } svc, err := client.CreateService(svc) From cf86d6607657306cfc95ab1e7fbff82640922e85 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 22 Sep 2014 15:34:13 -0700 Subject: [PATCH 2/2] rename labels in kubcfg logic --- hack/e2e-suite/update.sh | 2 +- pkg/kubecfg/kubecfg.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/e2e-suite/update.sh b/hack/e2e-suite/update.sh index 7443e1031f1..8fa0cf1255e 100755 --- a/hack/e2e-suite/update.sh +++ b/hack/e2e-suite/update.sh @@ -30,7 +30,7 @@ CONTROLLER_NAME=update-demo function validate() { NUM_REPLICAS=$1 CONTAINER_IMAGE_VERSION=$2 - POD_ID_LIST=$($KUBECFG '-template={{range.Items}}{{.ID}} {{end}}' -l replicationController=${CONTROLLER_NAME} list pods) + POD_ID_LIST=$($KUBECFG '-template={{range.Items}}{{.ID}} {{end}}' -l simpleService=${CONTROLLER_NAME} list pods) # Container turn up on a clean cluster can take a while for the docker image pull. ALL_RUNNING=0 while [ $ALL_RUNNING -ne 1 ]; do diff --git a/pkg/kubecfg/kubecfg.go b/pkg/kubecfg/kubecfg.go index 11dfd45bc93..c85cfc23d59 100644 --- a/pkg/kubecfg/kubecfg.go +++ b/pkg/kubecfg/kubecfg.go @@ -201,7 +201,7 @@ func RunController(image, name string, replicas int, client client.Interface, po DesiredState: api.ReplicationControllerState{ Replicas: replicas, ReplicaSelector: map[string]string{ - "replicationController": name, + "simpleService": name, }, PodTemplate: api.PodTemplate{ DesiredState: api.PodState{ @@ -217,7 +217,7 @@ func RunController(image, name string, replicas int, client client.Interface, po }, }, Labels: map[string]string{ - "replicationController": name, + "simpleService": name, }, }, }, @@ -252,10 +252,10 @@ func createService(name string, port int, client client.Interface) (*api.Service JSONBase: api.JSONBase{ID: name}, Port: port, Labels: map[string]string{ - "name": name, + "simpleService": name, }, Selector: map[string]string{ - "replicationController": name, + "simpleService": name, }, } svc, err := client.CreateService(svc)