jiebi/CodeConvo huggingface dataset:
Change:
ok 1.520s coverage: 25.5% of statements I0414 23:19:35. ] Forwarding from 5000 -5000 W0414 23:19:35. ] Unable to listen on port {5000 5000}: listen tcp 127.0.0.1:5000: bind: address already in use I0414 23:19:35. ] Forwarding from 6000 -6000 I0414 23:19:35. ] Handling connection for 5000 --- FAIL: TestForwardPorts (0.22s) 2: expected to read '1234', got '' FAIL coverage: 83.3% of statements FAIL 0.677s
It looks like the crux is this: ] Unable to listen on port {5000 5000}: listen tcp 127.0.0.1:5000: bind: address already in use listen often needs a retry after a recent close, to account for TIME_WAIT state of the port. But that's pure speculation on my part. We need to repro and fix.
http://hea- is perhaps a better link.
I'll have a go at it in the next few days if nobody else picks it up before me.
There were two issues... one was multiple test cases reusing the same port and deferring the close until the end of the function, not the end of the loop... that was fixed in The other issue was with the fake stream returning an EOF on a Write(), fixed in

Discussion:
s.readCalled = true b := []byte(s.data) n := copy(p, b) <ins> // Indicate we returned all the data, and have no more data (EOF) // Returning an EOF here will cause the port forwarder to immediately terminate, which is correct when we have no more data to send </ins> return n, io.EOF }

s.lock.Lock() defer s.lock.Unlock() s.writeCalled = true <del> s.dataWritten = make([]byte, len(p)) copy(s.dataWritten, p) return len(p), io.EOF </del> <ins> s.dataWritten = append(s.dataWritten, p...) // Indicate the stream accepted all the data, and can accept more (no err) // Returning an EOF here will cause the port forwarder to immediately terminate, which is incorrect, in case someone writes more data return len(p), nil </ins> } func (s *fakeUpgradeStream) Close() error {
Change:
In Jenkins scalability suite, Density test is failing on cleanup: Expected error: <*errors.errorString | 0xc20d27c460: { s: "Error waiting for replication controller my-hostname-density3000--e362-11e4-90b1- replicas to reach 0: Get http://127.0.0.1:4001/v2/keys/registry/controllers/default/my-hostname-density3000--e362-11e4-90b1-?quorum=false&recursive=false&sorted=false: dial tcp 127.0.0.1:4001: cannot assign requested address", } Error waiting for replication controller my-hostname-density3000--e362-11e4-90b1- replicas to reach 0: Get http://127.0.0.1:4001/v2/keys/registry/controllers/default/my-hostname-density3000--e362-11e4-90b1-?quorum=false&recursive=false&sorted=false: dial tcp 127.0.0.1:4001: cannot assign requested address not to have occurred We need some retrying while waiting for rc to be deleted (similar to what I've done for waiting for all replicas in )
This just happened again on Jenkins.

Discussion:
return fmt.Errorf("Failed to resize replication controller %s to zero: %v", name, err) } <del> if err := wait.Poll(time.Second, time.Minute*20, client.ControllerHasDesiredReplicas(c, rc)); err != nil { return fmt.Errorf("Error waiting for replication controller %s replicas to reach 0: %v", name, err) </del> <ins> // Wait up to 20 minutes until all replicas are killed. endTime := time.Now().Add(time.Minute * 20) for { if time.Now().After(endTime) { return fmt.Errorf("Timeout while waiting for replication controller %s replicas to 0", name) } remainingTime := endTime.Sub(time.Now()) err := wait.Poll(time.Second, remainingTime, client.ControllerHasDesiredReplicas(c, rc)) if err != nil { glog.Errorf("Error while waiting for replication controller %s replicas to read 0: %v", name, err) } else { break } </ins> } // Delete the replication controller.
Change:
With the move to running the kube-apiserver in a pod, I am getting errors of the form: The root null pointer is from this line: The line numbers in the stack are from my continuing debug of the original null pointer. We need to protect against a null pointer in this path, which appears to only be invoked when doing a list call that matches a single item based on field selector. Will submit a PR to address.
With proper line numbers:

Discussion:
} response, err := h.Client.Get(key, false, false) <del> if err != nil && !IsEtcdNotFound(err) { </del> <ins> if err != nil { if IsEtcdNotFound(err) { return nil } </ins> return err }
Change:
cluster/saltbase/salt/monit/kube-apiserver appears not to be referenced by and so can be deleted, I think
/cc
created PR thanks!

Discussion:
<del> check process kube-apiserver with pidfile /var/run/kube-apiserver.pid group kube-apiserver start program = "/etc/init.d/kube-apiserver start" stop program = "/etc/init.d/kube-apiserver stop" if failed host 127.0.0.1 port 8080 protocol http request "/index.html" then restart </del>
Change:
This is wrong because something else could have updated the pod in the mean time, invalidating your resource version. (Specifically, kubelet writes statuses.) It should do a get/update loop that retries as long as it gets a conflict error. to find an owner
PR almost ready - just struggling to get e2e tests to run :-)
At last. SUCCESS! -- 5 Passed 34 Skipped I0424 09:04:47. ] All tests pass PR incoming in a few minutes.

Discussion:
"time" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/util/wait" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/watch" . "github.com/onsi/ginkgo"

By("deleting the pod") podClient.Delete(pod.Name) }() <del> _, err := podClient.Create(pod) </del> <ins> pod, err := podClient.Create(pod) </ins> if err != nil { <del> Fail(fmt.Sprintf("Failed to create pod: %v", err)) </del> <ins> Failf("Failed to create pod: %v", err) </ins> } expectNoError(waitForPodRunning(c, pod.Name))

pods, err := podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything()) Expect(len(pods.Items)).To(Equal(1)) <del> By("retrieving the pod") podOut, err := podClient.Get(pod.Name) if err != nil { Fail(fmt.Sprintf("Failed to get pod: %v", err)) } By("updating the pod") value = "time" + value pod.Labels["time"] = value pod.ResourceVersion = podOut.ResourceVersion pod.UID = podOut.UID pod.Spec.Host = podOut.Spec.Host pod, err = podClient.Update(pod) if err != nil { Fail(fmt.Sprintf("Failed to update pod: %v", err)) } </del> <ins> // Standard get, update retry loop expectNoError(wait.Poll(time.Millisecond*500, time.Second*30, func() (bool, error) { By("updating the pod") value = strconv.Itoa(time.Now().Nanosecond()) if pod == nil { // on retries we need to re-get pod, err = podClient.Get(name) if err != nil { return false, fmt.Errorf("failed to get pod: %v", err) } } pod.Labels["time"] = value pod, err = podClient.Update(pod) if err == nil { Logf("Successfully updated pod") return true, nil } if errors.IsConflict(err) { Logf("Conflicting update to pod, re-get and re-update: %v", err) pod = nil // re-get it when we retry return false, nil } return false, fmt.Errorf("failed to update pod: %v", err) })) </ins> expectNoError(waitForPodRunning(c, pod.Name)) By("verifying the updated pod is in kubernetes") pods, err = podClient.List(labels.SelectorFromSet(labels.Set(map[string]string{"time": value})), fields.Everything()) Expect(len(pods.Items)).To(Equal(1)) <del> fmt.Println("pod update OK") </del> <ins> Logf("Pod update OK") </ins> }) It("should contain environment variables for services", func() {
Change:
Right now at the end of I get We should update the output to point to the appropriate v1beta3 URL endpoints instead.
/cc
Ref and . cc
And as a minor nit, not all of those URLs need a trailing slash hack e.g. I don't think it is required for Elasticsearch. I think most recently worked on this code?
Thanks for fixing this

Discussion:
"fmt" "io" "os" <del> "strings" </del> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" cmdutil "github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd/util"

if err != nil { return err } <del> printService(out, "Kubernetes master", client.Host, false) </del> <ins> printService(out, "Kubernetes master", client.Host) </ins> mapper, typer := factory.Object() cmdNamespace, err := factory.DefaultNamespace()

b.Do().Visit(func(r *resource.Info) error { services := r.Object.(*api.ServiceList).Items for _, service := range services { <del> splittedLink := strings.Split(strings.Split(service.ObjectMeta.SelfLink, "?")[0], "/") // insert "proxy" into the link splittedLink = append(splittedLink, "") copy(splittedLink[4:], splittedLink[3:]) splittedLink[3] = "proxy" link := client.Host + strings.Join(splittedLink, "/") + "/" printService(out, service.ObjectMeta.Labels["name"], link, true) </del> <ins> link := client.Host + "/api/v1beta3/proxy/namespaces/" + service.ObjectMeta.Namespace + "/services/" + service.ObjectMeta.Name printService(out, service.ObjectMeta.Labels["name"], link) </ins> } return nil })

// TODO consider printing more information about cluster } <del> func printService(out io.Writer, name, link string, warn bool) { </del> <ins> func printService(out io.Writer, name, link string) { </ins> ct.ChangeColor(ct.Green, false, ct.None, false) fmt.Fprint(out, name) ct.ResetColor()

ct.ChangeColor(ct.Yellow, false, ct.None, false) fmt.Fprint(out, link) ct.ResetColor() <del> // TODO remove this warn once trailing slash is no longer required if warn { fmt.Fprint(out, " (note the trailing slash)") } </del> fmt.Fprintln(out, "") }
Change:
Take great care merging! Example PR run (look at the "succeeded" builds): https://travis-
Somewhat related, (bug) and (fix, as yet unmerged) mean that "guestbook" and "shell" e2e tests are being silently skipped on all platforms since Wed last week (4/15). should merge shortly and resolve the issue.
From the Travis run, So it looks like either the shell script is eating the exit code, or the test is exiting 0 even when tests fail. Similarly for Shippable, it seems.
I think broke this. It appears that will always exit 0, even when tests fail or timeout. We should revert this change ASAP.
Fixed by

Discussion:
if [[ ! ${KUBE_COVER} =~ ^[yY]$ ]]; then kube::log::status "Running unit tests without code coverage" go test "${goflags[@]:+${goflags[@]}}"  <del> ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" || true </del> <ins> ${KUBE_RACE} ${KUBE_TIMEOUT} "${@+${@/#/${KUBE_GO_PACKAGE}/}}" </ins> return 0 fi

-cover -covermode="${KUBE_COVERMODE}"  -coverprofile="${cover_report_dir}/{}/${cover_profile}"  "${cover_params[@]+${cover_params[@]}}"  <del> "${KUBE_GO_PACKAGE}/{}" || true </del> <ins> "${KUBE_GO_PACKAGE}/{}" </ins> COMBINED_COVER_PROFILE="${cover_report_dir}/combined-coverage.out" {
Change:
Now that kube-apiserver runs in a container, no longer exists: /cc
Actually fixed by .

Discussion:
# Restart the kube-apiserver on a node ($1) function restart-apiserver { <del> ssh-to-node "$1" "sudo /etc/init.d/kube-apiserver restart" </del> <ins> ssh-to-node "$1" "sudo docker kill `sudo docker ps | grep /kube-apiserver | awk '{print $1}'`" </ins> } # Perform preparations required to run e2e tests

# Restart the kube-proxy on master ($1) function restart-apiserver() { echo "... in restart-kube-apiserver()"  >&2 <del> ssh-to-node "$1" "sudo /etc/init.d/kube-apiserver restart" </del> <ins> ssh-to-node "$1" "sudo docker kill `sudo docker ps | grep /kube-apiserver | awk '{print $1}'`" </ins> } # Execute after running tests to perform any required clean-up.  This is called
Change:
attemting to run throws and error with ERROR: Error: - does not specify a valid ReplicationController
The documentation is a little ambiguous, as the second example suggests that - should work but the Synopsis section does not. Could you either fix the documentation or the command?
Calvin, can you post the contents of , and the schema of the original rc? There are some for the schema when providing a target from file, which may not be met.
running works, I was interpreting the error message that it though - was a rc
will work for any object schema file. I.e, that is the same command you use to create a podreplicationcontroller from file. The type being created is determined by the contents of the file. Looking back at the code, the error you saw indicates that does not contain a replicationcontroller spec. If you can create it, that must mean it's something else; can you post/link the contents?
yes I need to clean it up first
That looks like a valid rc spec, but the labels may be insufficient for rollingupdate. In order to do a rollingupdate you need to have a label to control the update. Typically this would be a "version" label. Example Basically the selector for the old and new rc must share at least one label key with a differing value. By the way, rollingupdate is currently getting a simplified version, which generates the new rc spec for you. This is wip that will be available in next week's GKE release. See
ah I see, I actually have a dynamic version in there so that will be easy to do thanks Jeff Lowdermilk wrote:
so with an updated config still does not work while does work with the first one still erroring out with so likely my missing selector issue was an unrelated issue
From your last comment, seems this is resolved. If you are still having trouble, lmk and I will reopen.
still not fixed because I can't do
I'm pretty sure that's a piping issue with the wrapper command that likely doesn't occur if you use kubectl directly. Try Note that steps 1,2 will be unnecessary with the next gcloud release; you will be able to use kubectl directly after creating a cluster.
With cloudsdk 0.9.60, standalone kubectl works by default with GKE clusters. The wrapper command is no longer needed and will be removed in a future release. Let me know if you have problems running against a GKE cluster.
I am running across this issue with a recent build of .
is still throwing errors with version 0.17 used directly (without wrapping)

Discussion:
return err } var ok bool <ins> // Handle filename input from stdin. The resource builder always returns an api.List // when creating resource(s) from a stream. if list, ok := obj.(*api.List); ok { if len(list.Items) > 1 { return cmdutil.UsageError(cmd, "%s specifies multiple items", filename) } obj = list.Items[0] } </ins> newRc, ok = obj.(*api.ReplicationController) if !ok { if _, kind, err := typer.ObjectVersionAndKind(obj); err == nil {
Change:
a set of endpoints to your GlusterFS cluster. Example a pod that uses the GlusterFS Volume Plugin in ReadWrite Mode (readonly=false) to mount a particular GlusterFS volume. Example the pod is running the contents of that GlusterFS Volume and see that your files exist. the pod - "kubectl delete pod glusterfs" the contents of your GlusterFS Volume and see that your files no longer exist. Environment: GlusterFS - verified with GlusterFS running on either Fedora 21 or RHEL 6.5. Kubernetes - running on Fedora 21 Note: This issue does not occur if the GlusterFS Volume Plugin is in ReadOnly Mode (readonly=true)
heh, this is why I wanted to refactor the mount/unmount/cleanup code - get it right once :)
cc
I went back to commit (the original merge for glusterfs volume) and couldn't replicate the bug. after updating to HEAD i could replicate. so something changed between first merge and HEAD causing issue.
It's caused by commit : This is called before unmounting of volumes, which are mounted somewhere into . why RemoveAll()? It was not there before your commit.
Fixed in PR
Sorry for injecting the bug. I was thinking of moving volume & pod dir cleanup into the function, but it didn't pan out, and the code was left unintentionally. Thanks for fixing it! The logic still seems strange in some cases. looks at the containers we failed to kill, and skip cleaning up volumes associated with them. But doesn't look at the those containers and would just go ahead and remove the directories for all the pods that we supposedly killed. I will file and issue later.
Is this fixed now? If so, please close. , Yu-Ju Hong wrote:

Discussion:
<ins> ### Warning: Only use this plugin  in Read Only mode. There is currently [a critical bug](https://github.com/GoogleCloudPlatform/kubernetes/issues/7317) that deletes your data when used in Read/Write mode. </ins> ## Glusterfs [Glusterfs](http://www.gluster.org) is an open source scale-out filesystem. These examples provide information about how to allow containers use Glusterfs volumes.

$ kubectl get pods ``` <del> If you ssh to that machine, you can run `docker ps` to see the actual pod and `mount` to see if the Glusterfs volume is mounted. </del>  No newline at end of file <ins> If you ssh to that machine, you can run `docker ps` to see the actual pod and `mount` to see if the Glusterfs volume is mounted. </ins>
Change:
Authenticated requests to master with an invalid URL path should return a non-status 200 response code. Preferably a 404 (not found). Sample output: { "paths": [ "/api", "/api/v1beta1", "/api/v1beta2", "/api/v1beta3", "/healthz", "/healthz/ping", "/logs/", "/metrics", "/static/", "/swagger-ui/", "/swaggerapi/", "/validate", "/version" ] }

Discussion:
func IndexHandler(container *restful.Container, muxHelper *MuxHelper) func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { <ins> status := http.StatusOK if r.URL.Path != "/" && r.URL.Path != "/index.html" { // Since "/" matches all paths, handleIndex is called for all paths for which there is no handler registered. // We want to to return a 404 status with a list of all valid paths, incase of an invalid URL request. status = http.StatusNotFound } </ins> var handledPaths []string // Extract the paths handled using restful.WebService for _, ws := range container.RegisteredWebServices() {

// Extract the paths handled using mux handler. handledPaths = append(handledPaths, muxHelper.RegisteredPaths...) sort.Strings(handledPaths) <del> writeRawJSON(http.StatusOK, api.RootPaths{Paths: handledPaths}, w) </del> <ins> writeRawJSON(status, api.RootPaths{Paths: handledPaths}, w) </ins> } }

{"GET", "/api", "", code200}, {"GET", "/healthz", "", code200}, {"GET", "/version", "", code200}, <ins> {"GET", "/invalidURL", "", code404}, </ins> } return requests }
Change:
doesn't have a valid SSL certificate (it looks like it's a GCS bucket since says that I should be using a domain name). We should find a source for the image that can be fetch securely.
Split off of . /cc since I can't assign this to you directly.
you made a (meaningful) change in libvirt_coreos a few months ago. Does still work? Any idea on a better source?
works (at least for my needs) . I use it everyday for dev and I'd like to keep it working. I was not aware of this issue. Having a look and let you know.
I had a look at but I found no reference to maybe something changed since this issue is quite old. Could you check again and eventually share more details on the issue? Thanks in advance
Back in mid-2015 I was looking for places where we were fetching resources dynamically during cluster creation and trying to make sure that the fetches were done over SSL (to prevent a malicious actor from being able to inject code into new clusters) -- see The idea was to try and switch from to . If I run the wget command directly, it appears to work fine over SSL (and is actually way faster for me -- the http endpoint said it would take 3 hrs to download and the https endpoint took 12s).
I've created to switch it to https

Discussion:
virsh pool-create-as $POOL dir --target "$POOL_PATH" fi <del> wget -N -P "$ROOT" http://${COREOS_CHANNEL:-alpha}.release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2 </del> <ins> wget -N -P "$ROOT" https://${COREOS_CHANNEL:-alpha}.release.core-os.net/amd64-usr/current/coreos_production_qemu_image.img.bz2 </ins> if [[ "$ROOT/coreos_production_qemu_image.img.bz2" -nt "$POOL_PATH/coreos_base.img" ]]; then bunzip2 -f -k "$ROOT/coreos_production_qemu_image.img.bz2" virsh vol-delete coreos_base.img --pool $POOL 2> /dev/null || true
Change:
When we populate the addresses of the nodes in we call NodeAddresses, which for the gce provider gets the external IP from the which as expected puts the IP address of the master into the external IP field. The Legacy IP field is still filled in by asking the cloud provider for the instance data, so it contains the public IP of the node. /cc
If we merge this should get fixed, because the external IPs will be calculated on the nodes rather than on the master.
Since we are going to delay adding until I can rebase on top of it seems like it's worth fixing this separately.
This is blocking so assigning to him.

Discussion:
"google.golang.org/cloud/compute/metadata" ) <del> const EXTERNAL_IP_METADATA_URL = "http://169.254.169.254/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip" </del> // GCECloud is an implementation of Interface, TCPLoadBalancer and Instances for Google Compute Engine. type GCECloud struct { service          *compute.Service

// NodeAddresses is an implementation of Instances.NodeAddresses. func (gce *GCECloud) NodeAddresses(instance string) ([]api.NodeAddress, error) { <del> externalIP, err := gce.metadataAccess(EXTERNAL_IP_METADATA_URL) </del> <ins> externalIP, err := gce.getExternalIP(instance) </ins> if err != nil { <del> return nil, err </del> <ins> return nil, fmt.Errorf("couldn't get external IP for instance %s: %v", instance, err) </ins> } <del> nodeAddresses := []api.NodeAddress{{Type: api.NodeExternalIP, Address: externalIP}} if legacyHostAddress, err := gce.getLegacyHostAddress(instance); err == nil { nodeAddresses = append(nodeAddresses, *legacyHostAddress) } return nodeAddresses, nil </del> <ins> return []api.NodeAddress{ {Type: api.NodeExternalIP, Address: externalIP}, // TODO(mbforbes): Remove NodeLegacyHostIP once v1beta1 is removed. {Type: api.NodeLegacyHostIP, Address: externalIP}, }, nil </ins> } <del> func (gce *GCECloud) getLegacyHostAddress(instance string) (*api.NodeAddress, error) { </del> <ins> func (gce *GCECloud) getExternalIP(instance string) (string, error) { </ins> inst, err := gce.getInstanceByName(instance) if err != nil { <del> return nil, err </del> <ins> return "", err </ins> } ip := net.ParseIP(inst.NetworkInterfaces[0].AccessConfigs[0].NatIP) if ip == nil { <del> return nil, fmt.Errorf("invalid network IP: %s", inst.NetworkInterfaces[0].AccessConfigs[0].NatIP) </del> <ins> return "", fmt.Errorf("invalid network IP: %s", inst.NetworkInterfaces[0].AccessConfigs[0].NatIP) </ins> } <del> return &api.NodeAddress{Type: api.NodeLegacyHostIP, Address: ip.String()}, nil </del> <ins> return ip.String(), nil </ins> } // ExternalID returns the cloud provider ID of the specified instance.
Change:
Tried to run through this guide: On VMware, there is no eth1, so the flannel configuration dies. Once you get past that, there is also an issue where etcdctl doesn't properly update the flannel network settings because the etcd server isn't set to the master.

Discussion:
etcd-servers: http://localhost:4001 metadata: "role=master" flannel: <del> interface: eth1 </del> units: - name: setup-network-environment.service command: start

etcd-servers: http://<master-private-ip>:4001 metadata: "role=node" flannel: <del> interface: eth1 </del> etcd_endpoints: http://<master-private-ip>:4001 units: - name: etcd.service

- name: 50-network-config.conf content: | [Service] <ins> Environment=ETCDCTL_PEERS=http://<master-private-ip>:4001 </ins> ExecStartPre=/bin/bash -c "until curl http://<master-private-ip>:4001/v2/machines; do sleep 2; done" ExecStartPre=/usr/bin/etcdctl set /coreos.com/network/config '{"Network":"10.244.0.0/16", "Backend": {"Type": "vxlan"}}' - name: docker.service