jiebi/CodeConvo huggingface dataset:
Code change:
If you are using a private docker registry, you first need to call something like and provide a user/pass/email. Any further calls to will pick up your identity from a file in $HOME/.dockercfg. Before a kubelet starts a container, it calls the equivalent of . Unfortunately, the auth information is not picked up from $HOME/.dockercfg, and there is no alternate way to configure it. The kubelet needs to support docker registry auth.
Here's where the auth should be getting passed to the docker client:
I'm not certain, but it looks like authenticated docker pulls would have worked before this patch:
See .
ah, search skills failed me again

Related discussion:
text: <ins> # Maintainers Eric Paris <eparis@redhat.com> </ins>
Code change:
https://travis- Seems surprising-- I will look into it later if no one else does first.
Got another flake. Looking into it.

Related discussion:
text: func TestErrorsToAPIStatus(t *testing.T) { cases := map[error]api.Status{ <del> NewAlreadyExistsErr("foo", "bar"): api.Status{ </del> <ins> NewAlreadyExistsErr("foo", "bar"): { </ins> Status:  api.StatusFailure, Code:    http.StatusConflict, Reason:  "already_exists",
Code change:
https://travis- Seems surprising-- I will look into it later if no one else does first.
Got another flake. Looking into it.

Related discussion:
text: ID:   "bar", }, }, <del> NewConflictErr("foo", "bar", errors.New("failure")): api.Status{ </del> <ins> NewConflictErr("foo", "bar", errors.New("failure")): { </ins> Status:  api.StatusFailure, Code:    http.StatusConflict, Reason:  "conflict",
Code change:
https://travis- Seems surprising-- I will look into it later if no one else does first.
Got another flake. Looking into it.

Related discussion:
text: } func TestSyncCreateTimeout(t *testing.T) { <ins> testOver := make(chan struct{}) defer close(testOver) </ins> storage := SimpleRESTStorage{ injectedFunction: func(obj interface{}) (interface{}, error) { <del> time.Sleep(5 * time.Millisecond) </del> <ins> // Eliminate flakes by ensuring the create operation takes longer than this test. <-testOver </ins> return obj, nil }, }
Code change:
https://travis- Seems surprising-- I will look into it later if no one else does first.
Got another flake. Looking into it.

Related discussion:
text: } func TestOpGet(t *testing.T) { <del> simpleStorage := &SimpleRESTStorage{} </del> <ins> testOver := make(chan struct{}) defer close(testOver) simpleStorage := &SimpleRESTStorage{ injectedFunction: func(obj interface{}) (interface{}, error) { // Eliminate flakes by ensuring the create operation takes longer than this test. <-testOver return obj, nil }, } </ins> handler := New(map[string]RESTStorage{ "foo": simpleStorage, }, codec, "/prefix/version")
Code change:
if you delete a service and restart it the port is no longer accessible To reproduce: 1) start a pod 2) start a service All works fine port is assigned - traffic flows 3) delete service 4) start service the port is now not assigned Here are sample configs: pod: Service:
I thought this was a known issue, but I could not find another issue on the same topic. Note that all containers started after the first instance of the service was created will have environment variables referring to that instance and won't see environment variables referring to the new instance until they restart. This is a fundamental shortcoming of the current approach.
I understand what you just replied but that is not the issue here. The problem is that when you delete a service , no other service can resuse that port successfully. The port is removed from a netstat listing. When a new service tries to use that port it gets allocated but you can not communicate to the pod through it. It is hosed until I re-install the cluster. (I have not tried rebooting the cluster) BTW this is a bug not a design issue.
Ah. The previous issue I was thinking of was . It sounds like the issue hasn't been completely resolved.
I will take a look at this today.
Sorry for the problem, has the fix. --brendan
Thanks! On Aug 19, 2014, at 2:26 PM, brendandburns wrote:

Related discussion:
text: for _, service := range services { activeServices.Insert(service.ID) info, exists := proxier.getServiceInfo(service.ID) <del> if exists && info.port == service.Port { </del> <ins> if exists && info.active && info.port == service.Port { </ins> continue } <del> if exists { </del> <ins> if exists && info.port != service.Port { </ins> proxier.StopProxy(service.ID) } glog.Infof("Adding a new service %s on port %d", service.ID, service.Port)
Code change:
if you delete a service and restart it the port is no longer accessible To reproduce: 1) start a pod 2) start a service All works fine port is assigned - traffic flows 3) delete service 4) start service the port is now not assigned Here are sample configs: pod: Service:
I thought this was a known issue, but I could not find another issue on the same topic. Note that all containers started after the first instance of the service was created will have environment variables referring to that instance and won't see environment variables referring to the new instance until they restart. This is a fundamental shortcoming of the current approach.
I understand what you just replied but that is not the issue here. The problem is that when you delete a service , no other service can resuse that port successfully. The port is removed from a netstat listing. When a new service tries to use that port it gets allocated but you can not communicate to the pod through it. It is hosed until I re-install the cluster. (I have not tried rebooting the cluster) BTW this is a bug not a design issue.
Ah. The previous issue I was thinking of was . It sounds like the issue hasn't been completely resolved.
I will take a look at this today.
Sorry for the problem, has the fix. --brendan
Thanks! On Aug 19, 2014, at 2:26 PM, brendandburns wrote:

Related discussion:
text: } } <ins> func TestProxyUpdateDeleteUpdate(t *testing.T) { lb := NewLoadBalancerRR() lb.OnUpdate([]api.Endpoints{{JSONBase: api.JSONBase{ID: "echo"}, Endpoints: []string{net.JoinHostPort("127.0.0.1", port)}}}) p := NewProxier(lb) proxyPort, err := p.addServiceOnUnusedPort("echo") if err != nil { t.Fatalf("error adding new service: %#v", err) } conn, err := net.Dial("tcp", net.JoinHostPort("127.0.0.1", proxyPort)) if err != nil { t.Fatalf("error connecting to proxy: %v", err) } conn.Close() p.OnUpdate([]api.Service{}) if err := waitForClosedPort(p, proxyPort); err != nil { t.Fatalf(err.Error()) } proxyPortNum, _ := strconv.Atoi(proxyPort) p.OnUpdate([]api.Service{ {JSONBase: api.JSONBase{ID: "echo"}, Port: proxyPortNum}, }) testEchoConnection(t, "127.0.0.1", proxyPort) } </ins> func TestProxyUpdatePort(t *testing.T) { lb := NewLoadBalancerRR() lb.OnUpdate([]api.Endpoints{{JSONBase: api.JSONBase{ID: "echo"}, Endpoints: []string{net.JoinHostPort("127.0.0.1", port)}}})
Code change:
if you delete a service and restart it the port is no longer accessible To reproduce: 1) start a pod 2) start a service All works fine port is assigned - traffic flows 3) delete service 4) start service the port is now not assigned Here are sample configs: pod: Service:
I thought this was a known issue, but I could not find another issue on the same topic. Note that all containers started after the first instance of the service was created will have environment variables referring to that instance and won't see environment variables referring to the new instance until they restart. This is a fundamental shortcoming of the current approach.
I understand what you just replied but that is not the issue here. The problem is that when you delete a service , no other service can resuse that port successfully. The port is removed from a netstat listing. When a new service tries to use that port it gets allocated but you can not communicate to the pod through it. It is hosed until I re-install the cluster. (I have not tried rebooting the cluster) BTW this is a bug not a design issue.
Ah. The previous issue I was thinking of was . It sounds like the issue hasn't been completely resolved.
I will take a look at this today.
Sorry for the problem, has the fix. --brendan
Thanks! On Aug 19, 2014, at 2:26 PM, brendandburns wrote:

Related discussion:
text: } testEchoConnection(t, "127.0.0.1", newPort) } <ins> func TestProxyUpdatePortLetsGoOfOldPort(t *testing.T) { lb := NewLoadBalancerRR() lb.OnUpdate([]api.Endpoints{{JSONBase: api.JSONBase{ID: "echo"}, Endpoints: []string{net.JoinHostPort("127.0.0.1", port)}}}) p := NewProxier(lb) proxyPort, err := p.addServiceOnUnusedPort("echo") if err != nil { t.Fatalf("error adding new service: %#v", err) } // add a new dummy listener in order to get a port that is free l, _ := net.Listen("tcp", ":0") _, newPort, _ := net.SplitHostPort(l.Addr().String()) portNum, _ := strconv.Atoi(newPort) l.Close() // Wait for the socket to actually get free. if err := waitForClosedPort(p, newPort); err != nil { t.Fatalf(err.Error()) } if proxyPort == newPort { t.Errorf("expected difference, got %s %s", newPort, proxyPort) } p.OnUpdate([]api.Service{ {JSONBase: api.JSONBase{ID: "echo"}, Port: portNum}, }) if err := waitForClosedPort(p, proxyPort); err != nil { t.Fatalf(err.Error()) } testEchoConnection(t, "127.0.0.1", newPort) proxyPortNum, _ := strconv.Atoi(proxyPort) p.OnUpdate([]api.Service{ {JSONBase: api.JSONBase{ID: "echo"}, Port: proxyPortNum}, }) if err := waitForClosedPort(p, newPort); err != nil { t.Fatalf(err.Error()) } testEchoConnection(t, "127.0.0.1", proxyPort) } </ins>
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: trap "teardown" EXIT <del> POD_ID_LIST=$($CLOUDCFG -json -l name=myNginx list pods | jq ".items[].id") </del> <ins> POD_ID_LIST=$($CLOUDCFG '-template={{range.Items}}{{.ID}} {{end}}' -l name=myNginx list pods) </ins> # 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
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: sleep 5 ALL_RUNNING=1 for id in $POD_ID_LIST; do <del> CURRENT_STATUS=$(remove-quotes $($CLOUDCFG -json get "pods/$(remove-quotes ${id})" | jq '.currentState.info["mynginx"].State.Running and .currentState.info["net"].State.Running')) </del> <ins> CURRENT_STATUS=$($CLOUDCFG -template '{{and .CurrentState.Info.mynginx.State.Running .CurrentState.Info.net.State.Running}}' get pods/$id) </ins> if [ "$CURRENT_STATUS" != "true" ]; then ALL_RUNNING=0 fi
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: sleep 5 <del> POD_LIST_1=$($CLOUDCFG -json list pods | jq ".items[].id") </del> <ins> POD_LIST_1=$($CLOUDCFG '-template={{range.Items}}{{.ID}} {{end}}' list pods) </ins> echo "Pods running: ${POD_LIST_1}" $CLOUDCFG stop redisSlaveController
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: $CLOUDCFG delete services/redismaster $CLOUDCFG delete pods/redis-master-2 <del> POD_LIST_2=$($CLOUDCFG -json list pods | jq ".items[].id") </del> <ins> POD_LIST_2=$($CLOUDCFG '-template={{range.Items}}{{.ID}} {{end}}' list pods) </ins> echo "Pods running after shutdown: ${POD_LIST_2}" exit 0
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: <ins> #!/bin/bash # Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #     http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Launches an nginx container and verifies it can be reached. Assumes that # we're being called by hack/e2e-test.sh (we use some env vars it sets up). # Exit on error set -e source "${KUBE_REPO_ROOT}/cluster/kube-env.sh" source "${KUBE_REPO_ROOT}/cluster/$KUBERNETES_PROVIDER/util.sh" function validate() { POD_ID_LIST=$($CLOUDCFG '-template={{range.Items}}{{.ID}} {{end}}' -l name=$controller 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 echo "Waiting for all containers in pod to come up." sleep 5 ALL_RUNNING=1 for id in $POD_ID_LIST; do CURRENT_STATUS=$($CLOUDCFG -template '{{and .CurrentState.Info.datacontroller.State.Running .CurrentState.Info.net.State.Running}}' get pods/$id) if [ "$CURRENT_STATUS" != "true" ]; then ALL_RUNNING=0 fi done done ids=($POD_ID_LIST) if [ ${#ids[@]} -ne $1 ]; then echo "Unexpected number of pods: ${#ids[@]}" exit 1 fi } controller=dataController # Launch a container $CLOUDCFG -p 8080:80 run brendanburns/data 2 $controller function teardown() { echo "Cleaning up test artifacts" $CLOUDCFG stop $controller $CLOUDCFG rm $controller } trap "teardown" EXIT validate 2 $CLOUDCFG resize $controller 1 validate 1 $CLOUDCFG resize $controller 2 validate 2 # TODO: test rolling update here, but to do so, we need to make the update blocking # $CLOUDCFG -u=20s rollingupdate $controller # # Wait for the replica controller to recreate # sleep 10 # # validate 2 exit 0 </ins>
Code change:
We have an e2e test that runs the guestbook example. We should also have one that runs through the other example.

Related discussion:
text: LEAVE_UP=${2:-0} TEAR_DOWN=${3:-0} <del> HAVE_JQ=$(which jq) if [[ -z ${HAVE_JQ} ]]; then echo "Please install jq, e.g.: 'sudo apt-get install jq' or, " echo "'sudo yum install jq' or, " echo "if you're on a mac with homebrew, 'brew install jq'." exit 1 fi </del> # Exit on error set -e
Code change:
Running vagrant from scratch gives the error: For vagrant cluster, the last minion cannot be detected. The /tmp/minions file only shows two minions, but after a while, using the same command, i.e. will get three minions. There is a race between kube-up and validate-, we should wait a while before panic.
I can look to fix this.

Related discussion:
text: for (( i=0; i <${NUM_MINIONS}; i++)) do KUBE_MINION_IP_ADDRESSES[$i]="${MINION_IP_BASE}$[$i+2]" MINION_NAMES[$i]="${MINION_IP_BASE}$[$i+2]" <del> done </del>  No newline at end of file <ins> VAGRANT_MINION_NAMES[$i]="minion-$[$i+1]" done </ins>
Code change:
Running vagrant from scratch gives the error: For vagrant cluster, the last minion cannot be detected. The /tmp/minions file only shows two minions, but after a while, using the same command, i.e. will get three minions. There is a race between kube-up and validate-, we should wait a while before panic.
I can look to fix this.

Related discussion:
text: source $(dirname ${BASH_SOURCE})/${KUBE_CONFIG_FILE-"config-default.sh"} function detect-master () { <del> echo "KUBE_MASTER_IP: $KUBE_MASTER_IP" echo "KUBE_MASTER: $KUBE_MASTER" </del> <ins> echo "KUBE_MASTER_IP: $KUBE_MASTER_IP" echo "KUBE_MASTER: $KUBE_MASTER" </ins> } # Get minion IP addresses and store in KUBE_MINION_IP_ADDRESSES[] function detect-minions { <del> echo "Minions already detected" </del> <ins> echo "Minions already detected" </ins> } # Verify prereqs on host machine
Code change:
As a sysadmin When using the Vagrant cluster provided And logged in as the vagrant user to the master or minions I would like to be able to call docker commands wihout requiring the 'sudo' prefix. For Fedora =19 and RHEL=7 this can be enabled by adding the vagrant user to the docker group in /etc/groups
This should be trivial, but its tricker to do because of the whole salt configuration process as the docker group is only created on each kubernetes-minion once docker is installed by the salt-minion. To do this properly, we would need a salt state change for this, and new flag in to let you specify additional users that should be in the docker group.

Related discussion:
text: 'roles:kubernetes-pool-vsphere': - match: grain - static-routes <ins> 'roles:kubernetes-pool-vagrant': - match: grain - vagrant </ins>
Code change:
As a sysadmin When using the Vagrant cluster provided And logged in as the vagrant user to the master or minions I would like to be able to call docker commands wihout requiring the 'sudo' prefix. For Fedora =19 and RHEL=7 this can be enabled by adding the vagrant user to the docker group in /etc/groups
This should be trivial, but its tricker to do because of the whole salt configuration process as the docker group is only created on each kubernetes-minion once docker is installed by the salt-minion. To do this properly, we would need a salt state change for this, and new flag in to let you specify additional users that should be in the docker group.

Related discussion:
text: <ins> vagrant: user.present: - optional_groups: - docker - remove_groups: False - require: - pkg: docker-io </ins>
Code change:
As a sysadmin When using the Vagrant cluster provided And logged in as the vagrant user to the master or minions I would like to be able to call docker commands wihout requiring the 'sudo' prefix. For Fedora =19 and RHEL=7 this can be enabled by adding the vagrant user to the docker group in /etc/groups
This should be trivial, but its tricker to do because of the whole salt configuration process as the docker group is only created on each kubernetes-minion once docker is installed by the salt-minion. To do this properly, we would need a salt state change for this, and new flag in to let you specify additional users that should be in the docker group.

Related discussion:
text: etcd_servers: $MASTER_IP roles: - kubernetes-pool <ins> - kubernetes-pool-vagrant </ins> cbr-cidr: $MINION_IP_RANGE minion_ip: $MINION_IP EOF
Code change:
When creating replication controller (e.g. frontend php-redis from guestbook example), scheduler gets stuck and never recovers. This is a race, I have to run several times to see the error (A script to delete controller and pods, then create new controller, leave enough time in between for k8s to react). I've created PR for an attempted fix.
I saw this too while following the guest book and creating the php/frontend step. In my case, I had 2 minions while the replication controller configuration had configured 3 replicas, so 2 pods got scheduled -each on another minion, the third pod had empty Host (saw that when doing 'list pods'), and the 3 of them were stuck in "waiting" status. I deleted the controller and the pods, fixed the configuration in json file to be 2 replicas and recreated the controller and everything worked. Does your fix take care of this use case? (too many replicas, too few minions/one of the pods is not scheduled)
This is different from your use case. If you have more replicas than minions, then the scheduler will get stuck for sure (with the error msg probably being 'failed to find a fit for pod'). AFAICT, it's not support yet.
If you remove the HostPorts, it should work for you. thanks for report.
, thanks for your replies. I understand why it isn't working, but I'd expect one of the 2 options to happen instead of the current situation: the creation of replication controller if there are less minions than replicas, AND there is a hostPort property. In other words - validation of the content during creation. least schedule all replicas that can get a minion (in my case 2 out of 3) and leave only one at "waiting". Is there an issue open about the use case I describe?
should be true today. is less possible than it seems like-- minions can come and go, and become over or under loaded in the time between creation and when the pod shows up at the scheduler. So even if we check up front, we still have to check again later, and sometimes the first check will pass but not the second.

Related discussion:
text: return map[string][]api.Pod{}, err } for _, scheduledPod := range pods { <del> host := scheduledPod.CurrentState.Host </del> <ins> host := scheduledPod.DesiredState.Host </ins> machineToPods[host] = append(machineToPods[host], scheduledPod) } return machineToPods, nil
Code change:
When creating replication controller (e.g. frontend php-redis from guestbook example), scheduler gets stuck and never recovers. This is a race, I have to run several times to see the error (A script to delete controller and pods, then create new controller, leave enough time in between for k8s to react). I've created PR for an attempted fix.
I saw this too while following the guest book and creating the php/frontend step. In my case, I had 2 minions while the replication controller configuration had configured 3 replicas, so 2 pods got scheduled -each on another minion, the third pod had empty Host (saw that when doing 'list pods'), and the 3 of them were stuck in "waiting" status. I deleted the controller and the pods, fixed the configuration in json file to be 2 replicas and recreated the controller and everything worked. Does your fix take care of this use case? (too many replicas, too few minions/one of the pods is not scheduled)
This is different from your use case. If you have more replicas than minions, then the scheduler will get stuck for sure (with the error msg probably being 'failed to find a fit for pod'). AFAICT, it's not support yet.
If you remove the HostPorts, it should work for you. thanks for report.
, thanks for your replies. I understand why it isn't working, but I'd expect one of the 2 options to happen instead of the current situation: the creation of replication controller if there are less minions than replicas, AND there is a hostPort property. In other words - validation of the content during creation. least schedule all replicas that can get a minion (in my case 2 out of 3) and leave only one at "waiting". Is there an issue open about the use case I describe?
should be true today. is less possible than it seems like-- minions can come and go, and become over or under loaded in the time between creation and when the pod shows up at the scheduler. So even if we check up front, we still have to check again later, and sometimes the first check will pass but not the second.

Related discussion:
text: {CPU: 2000}, }, }, <ins> Host: "machine1", </ins> } cpuAndMemory := api.PodState{ Manifest: api.ContainerManifest{