jiebi/CodeConvo huggingface dataset:
Change:
I don't know where the at the beginning of the target comes from, but probably from assumptions about sed version that are wrong. I had to update to gnu-sed 4.2.2 to build.
Also ootb on a Mac doesn't work with the rules specified (on el capitan):
does work
I take it back - updating sed did not appear to work. EDIT: I take that back, I had to clean after fixing paste.
most recent OSX version is UNIX certified, a POSIX requires as file argument when reading input from stdin. For , is only guaranteed to work in GNU sed, you need to insert literal newline and tab character there for portability.
Can someone with a mac send a patch? I don't have a mac...
It's update and every should end in instead of having no arguments. , Tim Hockin wrote:
(user should update sed, make needs changes to paste) , Clayton Coleman wrote:
I think we should stick to portable way for , it's too risky for relying on GNUism. If you don't mind, I will make a PR.
Sure, thanks , Cuong Manh Le wrote:
Are you sure the worked? I pull the latest from master, then run the same command above, I got: File is empty.
Make sure you are in your GOPATH in the correct spot for Kube On Jul 14, 2016, at 2:47 AM, Cuong Manh Le wrote: Are you sure the Makefile worked? I pull the latest from master, then run the same command above, I got: F0714 13:36:50. ] Error: Failed making a parser: unable to add directory "": unable to import "": expected 'package', found 'EOF' make: * [Makefile.generatedfiles:201: gendeepcopy] Error 255 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .
If you get the "expected 'package', found 'EOF'" message it is usually because something somewhere failed, and left an empty .go file. make cleangenerated , Cuong Manh Le wrote:
From BSD sed man page: Maybe try that?
It's not about ERE ( enables it), it's about expanding escape sequences in RHS of search and replace .

Discussion:
# TODO: Re-enable race detection when we switch to a thread-safe etcd client # KUBE_RACE="-race" make -C "${KUBE_ROOT}" test  <del> WHAT="$(kube::test::find_integration_test_dirs | paste -sd' ')"  </del> <ins> WHAT="$(kube::test::find_integration_test_dirs | paste -sd' ' -)"  </ins> KUBE_GOFLAGS="${KUBE_GOFLAGS:-} -tags 'integration no-docker'"  KUBE_RACE=""  KUBE_TIMEOUT="${KUBE_TIMEOUT}"
Change:
Recently we observe increased number of large-cluster startup failures. After very little digging it seems to be a problem in kubelet/cAdvisor/docker. We're seeing the following log repeat itself until the timeout: P0 as it happened at least 3 time in last 2 days. cc
Those particular logs come from kubelet on master machine in this run:
- wild theory. is it possible that the kube-logrotate.service has to be running before Looking at: If so, we could add a in the for Right?
caused kubelet not being able to sync pods. Could it be possible that kubelet-logrotate get removed while cadvisor was traversing the directory recursively to add all of them? If so, we should ignore such errors since the file doesn't exist anymore. /cc
I didn't see in my cluster. Only
logrotation is triggered by and only runs hourly. I assume it was run while cadvisor was starting up, so cadvisor saw the short-lived cgroup. All my comments above are just speculation :)
Offline discussed with and should be the root cause. In this master, we can see: It means that cadvisor did see during . However, because is only a short lived service, when cadvisor tried to , it has already been deleted. That's why we get the error: I've checked some normal clusters, cadvisor doesn't see at all, because it is too short lived. This is only about timing. :) Anyway, cadvisor shouldn't fail when the cgroup is missing at watching, which sometimes does happen. I'll send a fix soon.
Thanks a lot for this debugging! And waiting for the fix.
FYI, I've sent a PR to fix cadvisor side Once that PR is included in kubernetes, we can close this one. :)
Awesome - thanks
Shouldn't we run into the same issue for 1.3 GKE release? If we do, we need to patch 1.3. cc/

Discussion:
// initializeRuntimeDependentModules will initialize internal modules that require the container runtime to be up. func (kl *Kubelet) initializeRuntimeDependentModules() { if err := kl.cadvisor.Start(); err != nil { <del> kl.runtimeState.setInternalError(fmt.Errorf("failed to start cAdvisor %v", err)) </del> <ins> // Fail kubelet and rely on the babysitter to retry starting kubelet. // TODO(random-liu): Add backoff logic in the babysitter glog.Fatalf("Failed to start cAdvisor %v", err) </ins> } // eviction manager must start after cadvisor because it needs to know if the container runtime has a dedicated imagefs if err := kl.evictionManager.Start(kl, kl.getActivePods, evictionMonitoringPeriod); err != nil {
Change:
Forked from updateCIDRAllocation has 2 issues: PodCIDR is assigned without confirming that it is still empty. CIDR is released on any kind of Update failure (e.g., request timeout), without confirming whether or not the CIDR value were actually written. cc
See also
Neither nor have been cherrypicked for 1.3 (and is tagged v1.4). Is that appropriate?
I'm not really sure it's worth cherry-picking. The main fix (waiting for full sync before assigning any CIDRS by is cherry-picked, rest are (I believe) minor bugs with a really small chance of surfacing (e.g. we thought that is P1). That being said if we think they should be cherry-picked I can create PRs.
- do you think that should be cherry picked into 1.3 branch?
ping
Sorry, this slipped through for me. I think has been cherrypicked into 1.3. Looking at , it seems like it's a safe enough change (and makes the feature marginally safer). I think it's worth cherrypicking.
Created cherry-pick . After it's merged I think we can close this issue.
Cherry-pick merge. Closing.

Discussion:
// ReleaseCIDR releases the CIDR of the removed node func (r *rangeAllocator) ReleaseCIDR(node *api.Node) error { <del> if node.Spec.PodCIDR == "" { </del> <ins> if node == nil || node.Spec.PodCIDR == "" { </ins> return nil } _, podCIDR, err := net.ParseCIDR(node.Spec.PodCIDR) if err != nil { <del> return fmt.Errorf("Failed to parse node %s, CIDR %s", node.Name, node.Spec.PodCIDR) </del> <ins> return fmt.Errorf("Failed to parse CIDR %s on Node %v: %v", node.Spec.PodCIDR, node.Name, err) </ins> } <del> glog.V(4).Infof("recycle node %s CIDR %s", node.Name, podCIDR) </del> <ins> glog.V(4).Infof("release CIDR %s", node.Spec.PodCIDR) </ins> if err = r.cidrs.release(podCIDR); err != nil { <del> return fmt.Errorf("Failed to release cidr: %v", err) </del> <ins> return fmt.Errorf("Error when releasing CIDR %v: %v", node.Spec.PodCIDR, err) </ins> } return err }

for rep := 0; rep < podCIDRUpdateRetry; rep++ { // TODO: change it to using PATCH instead of full Node updates. node, err = r.client.Core().Nodes().Get(data.nodeName) <del> glog.Infof("Got Node: %v", node) </del> if err != nil { glog.Errorf("Failed while getting node %v to retry updating Node.Spec.PodCIDR: %v", data.nodeName, err) continue } <ins> if node.Spec.PodCIDR != "" { glog.Errorf("Node %v already has allocated CIDR %v. Releasing assigned one if different.", node.Name, node.Spec.PodCIDR) if node.Spec.PodCIDR != data.cidr.String() { if err := r.cidrs.release(data.cidr); err != nil { glog.Errorf("Error when releasing CIDR %v", data.cidr.String()) } } return nil } </ins> node.Spec.PodCIDR = data.cidr.String() if _, err := r.client.Core().Nodes().Update(node); err != nil { glog.Errorf("Failed while updating Node.Spec.PodCIDR (%d retries left): %v", podCIDRUpdateRetry-rep-1, err)
Change:
https://k8s- Failed: TestAdoption {integration}
https://k8s- Failed: TestAdoption {integration}
https://k8s- Failed: TestAdoption {integration}
https://k8s- Failed: TestAdoption {integration}
The problem is that the rc manager hasn't observed pod1, so it creates another pod and scales down, pod1 might get deleted. I'm working on the fix.

Discussion:
if err != nil { t.Fatalf("Failed to create replication controller: %v", err) } <del> pod := newMatchingPod("pod1", ns.Name) </del> <ins> podName := fmt.Sprintf("pod%d", i) pod := newMatchingPod(podName, ns.Name) </ins> pod.OwnerReferences = tc.existingOwnerReferences(rc) _, err = podClient.Create(pod) if err != nil {

stopCh := make(chan struct{}) go podInformer.Run(stopCh) <ins> // wait for the podInformer to observe the pod, otherwise the rc manager // will try to create a new pod rather than adopting the existing one. if err := wait.Poll(10*time.Second, 60*time.Second, func() (bool, error) { objects := podInformer.GetIndexer().List() for _, object := range objects { pod, ok := object.(*api.Pod) if !ok { t.Fatal("expect object to be a pod") } if pod.Name == podName { return true, nil } } return false, nil }); err != nil { t.Fatal(err) } </ins> go rm.Run(5, stopCh) if err := wait.Poll(10*time.Second, 60*time.Second, func() (bool, error) { updatedPod, err := podClient.Get(pod.Name)
Change:
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite} Previous issues for this test:
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl expose should create services for rc [Conformance] {Kubernetes e2e suite} Happened on a presubmit run in .
[FLAKE-PING] This flaky-test issue would love to have more attention...

Discussion:
err := wait.Poll(framework.Poll, timeout, func() (bool, error) { endpoints, err := c.Endpoints(ns).Get(name) if err != nil { <del> if apierrs.IsNotFound(err) { </del> <ins> // log the real error framework.Logf("Get endpoints failed (interval %v): %v", framework.Poll, err) // if the error is API not found or could not find default credentials or TLS handshake timeout, try again if apierrs.IsNotFound(err) || apierrs.IsUnauthorized(err) || apierrs.IsServerTimeout(err) { </ins> err = nil } <del> framework.Logf("Get endpoints failed (interval %v): %v", framework.Poll, err) </del> return false, err }
Change:
This block of code: Appears twice in , in . This seems wrong. Most-likely, the duplicate before is the one that should be removed, because that switch statement is where is set.
This is fixed as part of the following pull: ()[]

Discussion:
klet.podCache = kubecontainer.NewCache() klet.podManager = kubepod.NewBasicPodManager(kubepod.NewBasicMirrorClient(klet.kubeClient)) <del> klet.volumePluginMgr, err = NewInitializedVolumePluginMgr(klet, volumePlugins) if err != nil { return nil, err } klet.volumeManager, err = volumemanager.NewVolumeManager( enableControllerAttachDetach, hostname, klet.podManager, klet.kubeClient, klet.volumePluginMgr, klet.containerRuntime, mounter) </del> // Initialize the runtime. switch containerRuntime { case "docker":
Change:
I've noticed at least 10 separate test flake issues open in which at least one failure looks like this: Current list: &q=is%3Aissue%20label%3Akind%2Fflake%20is%3Aopen%20%22was%20not%20deleted%20within%20limit%22 The 10 current issues (note that some are 'broken test run' issues and might have multiple failure causes): cc
Just to clarify, the pods were deleted in the test (hence the message). I mentioned this before in
I was chasing down another p0 but now that that is resolved will try to look for more that we can do here. On Wednesday, July 27, 2016, Yu-Ju Hong wrote:
- why did you close this - this is happening quite frquently.
Thanks for reopening! We will now automatically choose and owner for auto-opened flake issues. I closed a bunch of old flakes that were created with no assignee. I want them to get recreated with an assignee. The hope is someone will actually look at these.
is another example of this flake.
has the same symptom too.
One more example: would it help if we bump the timeout from 5 min to N (e.g., 8) min? or should we ask tests that create significant number of pods to clean up after themselves?
I am going to try and look at optimizing the requeue behavior for tests that have a lot of pods and we are waiting for them to delete. Looks like once they delete, we don't observe their deletion until the next resync
Opened a PR to improve e2e framework ns deletion to avoid duplicate ns delete operations, and to give more detailed information on what content did not actually get deleted.

Discussion:
import ( "fmt" <ins> "sort" </ins> "time" "k8s.io/kubernetes/pkg/api"

estimate := int64(0) glog.V(4).Infof("namespace controller - deleteAllContent - namespace: %s, gvrs: %v", namespace, groupVersionResources) // iterate over each group version, and attempt to delete all of its resources <ins> // we sort resources to delete in a priority order that deletes pods LAST sort.Sort(sortableGroupVersionResources(groupVersionResources)) </ins> for _, gvr := range groupVersionResources { gvrEstimate, err := deleteAllContentForGroupVersionResource(kubeClient, clientPool, opCache, gvr, namespace, namespaceDeletedAt) if err != nil {

} return estimate, nil } <ins> // sortableGroupVersionResources sorts the input set of resources for deletion, and orders pods to always be last. // the idea is that the namespace controller will delete all things that spawn pods first in order to reduce the time // those controllers spend creating pods only to be told NO in admission and potentially overwhelming cluster especially if they lack rate limiting. type sortableGroupVersionResources []unversioned.GroupVersionResource func (list sortableGroupVersionResources) Len() int { return len(list) } func (list sortableGroupVersionResources) Swap(i, j int) { list[i], list[j] = list[j], list[i] } func (list sortableGroupVersionResources) Less(i, j int) bool { return list[j].Group == "" && list[j].Resource == "pods" } </ins>
Change:
noticed that my own dependency update got the wrong commit in , but verify-godeps didn't fail the PR. I think it is broken. I noticed that it also didn't fail even when I manually edited files in vendor/.
So, it turns out that verify-godeps tries to verify the file but NOT the contents of the vendor/ dir. That is easy to fix, but it flags a handful of errors. PR(s) will be forthcoming.
It looks like ginkgo () and one other delta I can not explain: Ryan, can you see what is up with that dep, maybe we have the wrong hash or we need to git add that file or something?

Discussion:
exit 1 fi <ins> if ! _out="$(diff -Naupr ${KUBE_ROOT}/vendor ${_kubetmp}/vendor)"; then echo "Your vendored results are different:" echo "${_out}" echo "Godeps Verify failed." exit 1 fi </ins> echo "Godeps Verified." # ex: ts=2 sw=2 et filetype=sh
Change:
We download the kube bundle from S3 with curl . But, now that the bundle is well over 1GB, 80 seconds is often not long enough on some of the smaller AWS instances (I think it's a combo of disk slowness, CPU slowness for the SSL and network slowness). PR coming which bumps it to 300 once I have tested it.

Discussion:
for url in "${urls[@]}"; do local file="${url##*/}" rm -f "${file}" <del> if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --max-time 80 --retry 6 --retry-delay 10 "${url}"; then </del> <ins> if ! curl -f --ipv4 -Lo "${file}" --connect-timeout 20 --max-time 300 --retry 6 --retry-delay 10 "${url}"; then </ins> echo "== Failed to download ${url}. Retrying. ==" elif [[ -n "${hash}" ]] && ! validate-hash "${file}" "${hash}"; then echo "== Hash validation of ${url} failed. Retrying. =="
Change:
https://k8s- Failed: [] SchedulerPredicates [Serial] validates that NodeSelector is respected if matching [Conformance] {Kubernetes e2e suite}

Discussion:
// How long a pod is allowed to become "running" and "ready" after a node // restart before test is considered failed. RestartPodReadyAgainTimeout = 5 * time.Minute <ins> // Number of times we want to retry Updates in case of conflict UpdateRetries = 5 </ins> ) var (

func AddOrUpdateLabelOnNode(c *client.Client, nodeName string, labelKey string, labelValue string) { patch := fmt.Sprintf(`{"metadata":{"labels":{"%s":"%s"}}}`, labelKey, labelValue) <del> err := c.Patch(api.MergePatchType).Resource("nodes").Name(nodeName).Body([]byte(patch)).Do().Error() </del> <ins> var err error for attempt := 0; attempt < UpdateRetries; attempt++ { err = c.Patch(api.MergePatchType).Resource("nodes").Name(nodeName).Body([]byte(patch)).Do().Error() if err != nil { if !apierrs.IsConflict(err) { ExpectNoError(err) } else { Logf("Conflict when trying to add a label %v:%v to %v", labelKey, labelValue, nodeName) } } else { break } time.Sleep(100 * time.Millisecond) } </ins> ExpectNoError(err) }

// won't fail if target label doesn't exist or has been removed. func RemoveLabelOffNode(c *client.Client, nodeName string, labelKey string) { By("removing the label " + labelKey + " off the node " + nodeName) <del> node, err := c.Nodes().Get(nodeName) ExpectNoError(err) if node.Labels == nil || len(node.Labels[labelKey]) == 0 { return </del> <ins> var nodeUpdated *api.Node var node *api.Node var err error for attempt := 0; attempt < UpdateRetries; attempt++ { node, err = c.Nodes().Get(nodeName) ExpectNoError(err) if node.Labels == nil || len(node.Labels[labelKey]) == 0 { return } delete(node.Labels, labelKey) nodeUpdated, err = c.Nodes().Update(node) if err != nil { if !apierrs.IsConflict(err) { ExpectNoError(err) } else { Logf("Conflict when trying to remove a label %v from %v", labelKey, nodeName) } } else { break } time.Sleep(100 * time.Millisecond) </ins> } <del> delete(node.Labels, labelKey) nodeUpdated, err := c.Nodes().Update(node) </del> ExpectNoError(err) By("verifying the node doesn't have the label " + labelKey)

// updates labels of nodes given by nodeNames. // In case a given label already exists, it overwrites it. If label to remove doesn't exist // it silently ignores it. <ins> // TODO: migrate to use framework.AddOrUpdateLabelOnNode/framework.RemoveLabelOffNode </ins> func updateNodeLabels(c *client.Client, nodeNames sets.String, toAdd, toRemove map[string]string) { const maxRetries = 5 for nodeName := range nodeNames {
Change:
Recently I was experimenting with changing for a Golang pre-purposed faux editor when editing resources when I noticed that it couldn't be marshaled. Upon inspecting the output JSON I noticed it had the same comments that the default yaml version has. Valid JSON cannot have comments. Since the comment also gives warning / error information upon saving it must be decided where to put that in the JSON output. Perhaps a new JSON property?
Maybe just not save the comments as part of the json to get rid of the warning, but still should them?
Is this a 1.2 thing? I do not see any errors when running the two commands. I made an edit in one run, and did not make an edit in a separate run. Maybe I don't understand the problem that is seen.
there isn't a kubernetes error that is shown, the issue is that the output JSON that kubernetes generates is actually invalid JSON due to the comments at the top. This caused errors when I was trying to unmarshal that JSON in another project.
Okay. Got it. The editor is being very strict about json having no comments.
It's not only about editor, it's simply part of language specification. Explanation for this: IMO if we want to use format, we should comply with it's standard. Also currently used sign for comments is unusual in javascript world, from which json evolved. In this world comments are marked in "C++ like" style (what in early days of JSON was also supported), i mean using and . So IMO in time of converting into JSON - we should strip such comments (I would prefer that), or they should be in some documented and specific to kubernetes way into JSON object.

Discussion:
func RunEdit(f *cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args []string, options *EditOptions) error { var printer kubectl.ResourcePrinter var ext string <ins> var addHeader bool </ins> switch format := cmdutil.GetFlagString(cmd, "output"); format { case "json": printer = &kubectl.JSONPrinter{} ext = ".json" <ins> addHeader = false </ins> case "yaml": printer = &kubectl.YAMLPrinter{} ext = ".yaml" <ins> addHeader = true </ins> default: return cmdutil.UsageError(cmd, "The flag 'output' must be one of yaml|json") }

w = crlf.NewCRLFWriter(w) } <del> results.header.writeTo(w) </del> <ins> if addHeader { results.header.writeTo(w) } </ins> if !containsError { if err := printer.PrintObj(objToEdit, w); err != nil {
Change:
Failed: https://k8s- Run so broken it didn't make JUnit output!
unknown syscall.SysProcAttr field 'Setpgid' in struct literal Looks like we should revert

Discussion:
cmd.Cmd.Stdout = outfile cmd.Cmd.Stderr = outfile <del> // Killing the sudo command should kill the server as well. </del> <ins> // Death of this test process should kill the server as well. </ins> attrs := &syscall.SysProcAttr{} // Hack to set linux-only field without build tags. deathSigField := reflect.ValueOf(attrs).Elem().FieldByName("Pdeathsig") if deathSigField.IsValid() { <del> deathSigField.Set(reflect.ValueOf(syscall.SIGKILL)) </del> <ins> deathSigField.Set(reflect.ValueOf(syscall.SIGTERM)) </ins> } else { cmdErrorChan <- fmt.Errorf("Failed to set Pdeathsig field (non-linux build)") return

const timeout = 10 * time.Second for _, signal := range []string{"-TERM", "-KILL"} { glog.V(2).Infof("Killing process %d (%s) with %s", pid, name, signal) <del> _, err := exec.Command("sudo", "kill", signal, strconv.Itoa(pid)).Output() </del> <ins> cmd := exec.Command("sudo", "kill", signal, strconv.Itoa(pid)) // Run the 'kill' command in a separate process group so sudo doesn't ignore it attrs := &syscall.SysProcAttr{} // Hack to set unix-only field without build tags. setpgidField := reflect.ValueOf(attrs).Elem().FieldByName("Setpgid") if setpgidField.IsValid() { setpgidField.Set(reflect.ValueOf(true)) } else { return fmt.Errorf("Failed to set Setpgid field (non-unix build)") } cmd.SysProcAttr = attrs _, err := cmd.Output() </ins> if err != nil { glog.Errorf("Error signaling process %d (%s) with %s: %v", pid, name, signal, err) continue
Change:
PR broke command due to wrong check . Currently, it displays for every command if you do not specify additional arguments(for example will not work, but will).
please looks at this small fix

Discussion:
} func RunHelp(cmd *cobra.Command, args []string) { <del> foundCmd, a, err := cmd.Root().Find(args) </del> <ins> foundCmd, _, err := cmd.Root().Find(args) </ins> // NOTE(andreykurilin): actually, I did not find any cases when foundCmd can be nil, //   but let's make this check since it is included in original code of initHelpCmd

// if nothing is found, just print usage cmd.Root().Usage() } <del> } else if len(a) == 0 { // help message for help command :) cmd.Root().Usage() </del> } else { <ins> if len(args) == 0 { // help message for help command :) foundCmd = cmd } </ins> helpFunc := foundCmd.HelpFunc() helpFunc(foundCmd, args) }
Change:
It's 400+mb and we need to pull it on every node. This leads to a lot of image pulling flake (), and also gets very expensive in some countries where bandwidth is sold at a premium. We took a stab at halving the size with: , but then realized that we were using an unsupported base image We tried to optimize to ~300Mb by building a smaller ubuntu:15 base, but that's still huge. Every other mandatory system daemon is built on busybox and so takes ~10Mb.
I can try again now that the agent supports
Newer Docker images using the spec from the official repository are based on AlpineLinux and are around ~38MB:

Discussion:
spec: containers: - name: fluentd-elasticsearch <del> image: gcr.io/google_containers/fluentd-elasticsearch:1.17 </del> <ins> image: gcr.io/google_containers/fluentd-elasticsearch:1.19 </ins> resources: limits: memory: 200Mi

dnsPolicy: Default containers: - name: fluentd-cloud-logging <del> image: gcr.io/google_containers/fluentd-gcp:1.21 </del> <ins> image: gcr.io/google_containers/fluentd-gcp:1.25 </ins> resources: limits: memory: 200Mi