jiebi/CodeConvo huggingface dataset:
Change:
Running the pre-built 0.8.0 binaries this flag does not work. Looks like the
I think that code happens only when setting up events, right? The hostnameOverride flag seems to still be there: what do you think about making this function take hostnameOverride as a parameter?
Yeah, it should fix the issue. Will fix it tonight.

Discussion:
record.StartLogging(glog.Infof) } <del> func SetupEventSending(client *client.Client) { </del> <ins> func SetupEventSending(client *client.Client, hostname string) { </ins> glog.Infof("Sending events to api server.") <del> hostname := util.GetHostname("") </del> record.StartRecording(client.Events(""), api.EventSource{ Component: "kubelet",

//   3 Standalone 'kubernetes' binary // Eventually, #2 will be replaced with instances of #3 func RunKubelet(kcfg *KubeletConfig) { <ins> kcfg.Hostname = util.GetHostname(kcfg.HostnameOverride) </ins> if kcfg.KubeClient != nil { <del> kubelet.SetupEventSending(kcfg.KubeClient) </del> <ins> kubelet.SetupEventSending(kcfg.KubeClient, kcfg.Hostname) </ins> } else { glog.Infof("No api server defined - no events will be sent.") } kubelet.SetupLogging() kubelet.SetupCapabilities(kcfg.AllowPrivileged) <del> kcfg.Hostname = util.GetHostname(kcfg.HostnameOverride) </del> cfg := makePodSourceConfig(kcfg) k, err := createAndInitKubelet(kcfg, cfg) if err != nil {
Change:
-- is the old old format for names.
Just to be sure, is "pod [podFullName] container [container.Name]" the new preferred format? I also see some places comma separating that form.
The new form should either be a list of fields, a strict, or the result of BuildDockerName(...) On Jan 15, 2015 5:37 AM, "commonlisp" wrote:
Closed with

Discussion:
for _, container := range pod.Spec.Containers { expectedHash := dockertools.HashContainer(&container) <ins> dockerContainerName := dockertools.BuildDockerName(uid, podFullName, &container) </ins> if dockerContainer, found, hash := dockerContainers.FindPodContainer(podFullName, uid, container.Name); found { containerID := dockertools.DockerID(dockerContainer.ID) glog.V(3).Infof("pod %q container %q exists as %v", podFullName, container.Name, containerID)

// Check RestartPolicy for container recentContainers, err := dockertools.GetRecentDockerContainersWithNameAndUUID(kl.dockerClient, podFullName, uid, container.Name) if err != nil { <del> glog.Errorf("Error listing recent containers with name and uid:%s--%s--%s", podFullName, uid, container.Name) </del> <ins> glog.Errorf("Error listing recent containers:%s", dockerContainerName) </ins> // TODO(dawnchen): error handling here? } if len(recentContainers) > 0 && pod.Spec.RestartPolicy.Always == nil { if pod.Spec.RestartPolicy.Never != nil { <del> glog.V(3).Infof("Already ran container with name %s--%s--%s, do nothing", podFullName, uid, container.Name) </del> <ins> glog.V(3).Infof("Already ran container with name %s, do nothing", dockerContainerName) </ins> continue } if pod.Spec.RestartPolicy.OnFailure != nil { // Check the exit code of last run if recentContainers[0].State.ExitCode == 0 { <del> glog.V(3).Infof("Already successfully ran container with name %s--%s--%s, do nothing", podFullName, uid, container.Name) </del> <ins> glog.V(3).Infof("Already successfully ran container with name %s, do nothing", dockerContainerName) </ins> continue } } } <del> glog.V(3).Infof("Container with name %s--%s--%s doesn't exist, creating %#v", podFullName, uid, container.Name, container) </del> <ins> glog.V(3).Infof("Container with name %s doesn't exist, creating %#v", dockerContainerName) </ins> ref, err := containerRef(pod, &container) if err != nil { glog.Errorf("Couldn't make a ref to pod %v, container %v: '%v'", pod.Name, container.Name, err)
Change:
I believe the problem is that requires a schema of but that Kubernetes does not have the ability to handle that schema yet. I just want to confirm this is true however. So with a schema like: It fails when used like so: If I try a schema that looks like: then the error is: The error generation comes from: Am I correct that it is impossible to use the command against ?
For clarity's sake here is my version info:
Rename cloud-delivery-test to cloud-delivery-test2 or something else. kubectl rollingupdate doesn't update an existing ReplicationController, it replaces it with a new one.
Doc:
Looking into this now. I am able to run kubectl rollingupdate against a 0.8.0 cluster using a v1beta1 schema. So it may just be broken for v1beta2/v1beta3.
Also, v1beta3 isn't enabled by default. Here's a message about how to enable it: !topic/kubernetes-dev/ZqbLnrg5--8 It's user error. I think we need a clearer error message when the 2 replication controllers have the same name.
good catch. can you confirm the command works with a distinctly named controller?
I see guys, ok, thank-you. Until patch I don't think this was made clear anywhere : ) I will try this out tomorrow and confirm but surely it will work. Thanks again.
Thanks It works differently from kubecfg rollingupdate, so I'm sure other people will encounter the same issue.

Discussion:
if mapping.Kind != "ReplicationController" { usageError(cmd, "%s does not specify a valid ReplicationController", filename) } <ins> if oldName == newName { usageError(cmd, "%s cannot have the same name as the existing ReplicationController %s", filename, oldName) } </ins> err = CompareNamespaceFromFile(cmd, namespace) checkErr(err)
Change:
We should support multiple objects on the command line, but, failing that, some kind of error message would be useful. /cc
Fixing, just fixed the equiv in create

Discussion:
"fmt" "io" <del> "github.com/golang/glog" </del> "github.com/spf13/cobra" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"

Do() found := 0 <del> r.IgnoreErrors(errors.IsNotFound).Visit(func(r *resource.Info) error { </del> <ins> err := r.IgnoreErrors(errors.IsNotFound).Visit(func(r *resource.Info) error { </ins> found++ if err := resource.NewHelper(r.Client, r.Mapping).Delete(r.Namespace, r.Name); err != nil { return err

fmt.Fprintf(out, "%sn", r.Name) return nil }) <ins> checkErr(err) </ins> if found == 0 { <del> glog.V(2).Infof("No resource(s) found") </del> <ins> fmt.Fprintf(cmd.Out(), "No resources foundn") </ins> } }, }

"strings" "testing" <ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/client" )

} } <ins> func TestDeleteNoObjects(t *testing.T) { f, tf, codec := NewAPIFactory() tf.Printer = &testPrinter{} tf.Client = &client.FakeRESTClient{ Codec: codec, Client: client.HTTPClientFunc(func(req *http.Request) (*http.Response, error) { switch p, m := req.URL.Path, req.Method; { case p == "/ns/test/pods" && m == "GET": return &http.Response{StatusCode: 200, Body: objBody(codec, &api.PodList{})}, nil default: t.Fatalf("unexpected request: %#vn%#v", req.URL, req) return nil, nil } }), } buf := bytes.NewBuffer([]byte{}) stderr := bytes.NewBuffer([]byte{}) cmd := f.NewCmdDelete(buf) cmd.SetOutput(stderr) cmd.Flags().String("namespace", "test", "") cmd.Run(cmd, []string{"pods"}) if buf.String() != "" { t.Errorf("unexpected output: %s", buf.String()) } if stderr.String() != "No resources foundn" { t.Errorf("unexpected output: %s", stderr.String()) } } </ins> func TestDeleteMultipleObject(t *testing.T) { pods, svc := testData()
Change:
I believe this is a regression with HEAD. Everything runs happily until I upgrade it to HEAD: influx-grafana/ influxdb kubernetes/heapster_influxdb kubernetes-minion- name=influxdb Running Then, I ssh into minion-2 and stop the kubelet. After this, all pods' status in cluster become to Unknown. Then I restart kubelet, and wait for long time (more than 20 mins), but all pods' status stay at Unknown:
I will take a look.
Now I suspect it is not caused by an unhealthy minion. I noticed that another issue filed by today (), all pods' status are Unknown too.
True problem is ExtractList instead of ExtractObj. This will always read an empty boundpods object: But the watch afterwards works correctly. So the weird behavior is that it kills everything when the watch expires. sorry I failed to notice this when reviewing your change! BoundPods isn't technically a list even though it looks like it. (the bound pods are not stored as sub-keys in etcd)
It turns out the issue is more serious than what I initially expected. Any pods scheduled to a node by apiserver, and running for a while will be killed by kubelet because a bug caused by But any changes to etcd key of that boundpods under /registry/nodes/<XX/boundpods will make watch result correct, and restarting previous killed boundPods. To prove my theory, I delete one pod php1 from my test cluster. Before deletion, all pods are unknown: Now after I delete php1 by running: delete -f testing/php1 Running: cluster/../cluster/gce/../../_output/dockerized/bin/linux/amd64/kubectl delete -f testing/php1 php1 All pods on same node (kubernetes-minion-) are restarted I think I know the root cause is, and will sent a fix soon.
I think you hit the same issue earlier.
maybe you can write a little test for this? :)

Discussion:
func (s *sourceEtcd) run() { boundPods := api.BoundPods{} <del> err := s.helper.ExtractToList(s.key, &boundPods) </del> <ins> err := s.helper.ExtractObj(s.key, &boundPods, false) </ins> if err != nil { glog.Errorf("etcd failed to retrieve the value for the key %q. Error: %v", s.key, err) return
Change:
Test log with failure: https://travis- Stack trace of panicing thead:
I think there are two issues: integration test should not have failed with fatal error. Not sure why, but probably related to the 501 error. the anonymous function inside got passed a bad value.

Discussion:
} match := label.Matches(labels.Set(controller.Labels)) if match { <del> pods, _ := r.ListPods(ctx, labels.Set(controller.Spec.Selector).AsSelector()) </del> <ins> pods, err := r.ListPods(ctx, labels.Set(controller.Spec.Selector).AsSelector()) if err != nil { glog.Warningf("Error listing pods: %v", err) // No object that's useable so drop it on the floor return false } if pods == nil { glog.Warningf("Pods list is nil.  This should never happen...") // No object that's useable so drop it on the floor return false } </ins> controller.Status.Replicas = len(pods.Items) } return match
Change:
The v1beta{1/2}.Minion field appears to be duplicated in the method parameter section where ever it appears.
Repro: Use the steps outlined here to stand up a cluster on GCE: View the swagger docs at https://{kubernetes master}/swaggerapi/api/v1beta2
Thanks Ian for reporting! The issue seems to be due to this line: Reads(versionedObject) is twice and hence minion in beta1 and beta2 and Pod in beta3 is repeated twice in POST body params. Will send a PR to fix.

Discussion:
createRoute := ws.POST(path).To(h). Doc("create a " + kind). <del> Operation("create" + kind). Reads(versionedObject) // from the request </del> <ins> Operation("create" + kind) </ins> addParamIf(createRoute, namespaceParam, namespaceScope) if _, ok := storage.(RESTCreater); ok { ws.Route(createRoute.Reads(versionedObject)) // from the request
Change:
To reproduce: remove status and hostip (hostip is part of status internally) After the update, host ip is gone... Probably a conversion issue
This looks like an instance of .

Discussion:
// Clear out the self link, if specified, since it's not in the registry either. minion.SelfLink = "" <del> // TODO: GetMinion will health check the minion, but we shouldn't require the minion to be // running for updating labels. </del> oldMinion, err := rs.registry.GetMinion(ctx, minion.Name) if err != nil { return nil, err } <ins> // This is hacky, but minion HostIP has been moved from spec to status since v1beta2. When updating // minion from older client, HostIP will be lost.  Fix it here temporarily until we strip out status // info from user input. if minion.Status.HostIP == "" { minion.Status.HostIP = oldMinion.Status.HostIP } </ins> if errs := validation.ValidateMinionUpdate(oldMinion, minion); len(errs) > 0 { return nil, kerrors.NewInvalid("minion", minion.Name, errs) }
Change:
It seems that exec probes must emit "ok" to be considered success, rather than return 0. If this is what we really want, we should document it somewhere.
This is (was?) a limitation of docker exec, which didn't return the code. Brendan On Jan 28, 2015 8:38 AM, "Tim Hockin" wrote:
The doc says it looks at exit status, so we need to fix one or the other.
for kubelet
for exec
could you take a look at this? Feel free to re-assign it back to me.
FWIW the current behavior isn't SO bad, and it makes clear a failure in the thing that probed vs a failed probe. Just saying, we don't NECESSARILY need to change it. On Jan 28, 2015 5:26 PM, "Dawn Chen" wrote:
With docker 1.5 we can go back to using the exitCode instead of "ok" string. OOM kills will also have special exitCodes in docker 1.5. , Tim Hockin wrote:
ok, I'm going to change the docs for now, we can change back when we standardize on 1.5...

Discussion:
### Hook Handler Implementations Hook handlers are the way that hooks are surfaced to containers.  Containers can select the type of hook handler they would like to implement.  Kubernetes currently supports two different hook handler types: <del> * Exec - Executes a specific command (e.g. pre-stop.sh) inside the cgroup and namespaces of the container.  Resources consumed by the command are counted against the container.  Commands which return non-zero values are treated as container failures (and will cause kubelet to forcibly restart the container).  Parameters are passed to the command as traditional linux command line flags (e.g. pre-stop.sh --reason=HEALTH) </del> <ins> * Exec - Executes a specific command (e.g. pre-stop.sh) inside the cgroup and namespaces of the container.  Resources consumed by the command are counted against the container.  Commands which print "ok" to standard out (stdout) are treated as healthy, any other output is treated as container failures (and will cause kubelet to forcibly restart the container).  Parameters are passed to the command as traditional linux command line flags (e.g. pre-stop.sh --reason=HEALTH) </ins> * HTTP - Executes an HTTP request against a specific endpoint on the container.  HTTP error codes (5xx) and non-response/failure to connect are treated as container failures. Parameters are passed to the http endpoint as query args (e.g. http://some.server.com/some/path?reason=HEALTH)
Change:
I now see this in /var/log/salt/minion I think this is the problem: (They just pushed a new version of SaltStack, 2014.7.1 which includes the issue) I think it's an easy fix; we just change the options from "xz" to "z". PR on its way...
Ugh... even after changing xz -z, that exposes another bug where salt messed up quoting: If we don't pass tar_options at all, there is yet another code path, which isn't broken but uses the built-in Python tarfile library to extract the tar file. I think that's our only option, unless we want to revert to the old saltstack until the new one becomes stable.
Appears fixed.

Discussion:
- source_hash: {{ etcd_tar_hash }} - archive_format: tar - if_missing: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64 <ins> {% if grains['saltversioninfo'] <= (2014, 7, 0, 0) %} </ins> - tar_options: xz <ins> {% endif %} </ins> file.directory: - name: /usr/local/src/etcd-{{ etcd_version }}-linux-amd64 - user: root
Change:
I launched a pod forgetting that I had not uploaded my into the node's folder. Of course the image pull failed but the error message was not helpful: e.g. It should finish off the message with "because credentials for are not available to Kubernetes. This may be because blah"

Discussion:
return keyring.Lookup(image) } <ins> type FakeKeyring struct { auth docker.AuthConfiguration ok   bool } func (f *FakeKeyring) Lookup(image string) (docker.AuthConfiguration, bool) { return f.auth, f.ok } </ins>

glog.V(1).Infof("Pulling image %s without credentials", image) } <del> return p.client.PullImage(opts, creds) </del> <ins> err := p.client.PullImage(opts, creds) // If there was no error, or we had credentials, just return the error. if err == nil || ok { return err } // Image spec: [<registry>/]<repository>/<image>[:<version] so we count '/' explicitRegistry := (strings.Count(image, "/") == 2) glog.Errorf("Foo: %s", explicitRegistry) // Hack, look for a private registry, and decorate the error with the lack of // credentials.  This is heuristic, and really probably could be done better // by talking to the registry API directly from the kubelet here. if explicitRegistry { return fmt.Errorf("image pull failed for %s, this may be because there are no credentials on this request.  details: (%v)", image, err) } return err </ins> } func (p throttledDockerPuller) Pull(image string) error {

} } <ins> func TestDockerKeyringLookupFails(t *testing.T) { fakeKeyring := &credentialprovider.FakeKeyring{} fakeClient := &FakeDockerClient{ Err: fmt.Errorf("test error"), } dp := dockerPuller{ client:  fakeClient, keyring: fakeKeyring, } err := dp.Pull("host/repository/image:version") if err == nil { t.Errorf("unexpected non-error") } msg := "image pull failed for host/repository/image, this may be because there are no credentials on this request.  details: (test error)" if err.Error() != msg { t.Errorf("expected: %s, saw: %s", msg, err.Error()) } } </ins> func TestDockerKeyringLookup(t *testing.T) { empty := docker.AuthConfiguration{}
Change:
The schema understood by the Kubernetes configuration file is not described any where. The current practice mostly is copy/paste existing samples (for example ) and edit them. There is a need to define a comprehensive list of elements, and their documentation, so that other examples can leverage them.
Configuration files specify exactly our API objects. See:
This is exactly what I was looking for but not easily googlable, or documented clearly.
Could you please put a link to the swagger UI here?
The only mention in the public docs is here: which links directly to the struct definition on github. It appears that the Swagger docs have been deprecated, and I'm unable to find any documentation for the KubeletConfiguration resource kind in the new docs. It's referred to in at least one place, but is still not actually covered:

Discussion:
Design docs are in [design](design). <ins> API objects are explained at [http://kubernetes.io/third_party/swagger-ui/](http://kubernetes.io/third_party/swagger-ui/). </ins> ## Primary concepts * **Overview** ([overview.md](overview.md)): A brief overview

A "Status" object SHOULD be returned by an API when an operation is not successful (when the server would return a non 2xx HTTP status code). The status object contains fields for humans and machine consumers of the API to determine failures. The information in the status object supplements, but does not override, the HTTP status code's meaning. <del> An "Operation" object MAY be returned by any non-GET API if the operation may take a significant amount of time. The name of the Operation may be used to retrieve the final result of an operation at a later time. </del> TODO: More details (refer to another doc for details) <del> TODO: Use SelfLink to retrieve operation instead. </del> Synthetic Resources -------------------

* GET /watch/&lt;resourceNamePlural&gt; - Receive a stream of JSON objects corresponding to changes made to any resource of the given kind over time. * GET /watch/&lt;resourceNamePlural&gt;/&lt;name&gt; - Receive a stream of JSON objects corresponding to changes made to the named resource of the given kind over time. * GET /redirect/&lt;resourceNamePlural&gt;/&lt;name&gt; - If the named resource can be described by a URL, return an HTTP redirect to that URL instead of a JSON response. For example, a service exposes a port and IP address and a client could invoke the redirect verb to receive an HTTP 307 redirection to that port and IP. <ins> * GET /proxy/&lt;resourceNamePlural&gt;/&lt;name&gt;/{subpath:*} - Proxy GET request to the named resource of the given kind. Can be used for example, to access log files on pods. </ins> Support of additional verbs is not required for all object types. <del> TODO: document proxy </del> TODO: more documentation of Watch

------ TODO: Document events (refer to another doc for details) <ins> API Documentation ----------------- API documentation can be found at [http://kubernetes.io/third_party/swagger-ui/](http://kubernetes.io/third_party/swagger-ui/). </ins>
Change:
NodeController is unable to register the value of , because it contains mixed case from the OS (in this case OSX). I'm not positive that all Linux systems are guaranteed to lowercase hostname -f, but it's likely that automated processes may end up collecting hostnames from sources that preserve case and passing that to the kubelet or master. I believe we should lowercase names detected from hostname -f and the values the node controller users - it's a minor thing, but internally we can guarantee that we treat node names as insensitive and in their canonical interior form.
cc
I'll take a look tmr.

Discussion:
"errors" "net" "reflect" <ins> "strings" </ins> "sync" "time"

// RegisterNodes registers the given list of nodes, it keeps retrying for `retryCount` times. func (s *NodeController) RegisterNodes(nodes *api.NodeList, retryCount int, retryInterval time.Duration) error { registered := util.NewStringSet() <ins> nodes = s.canonicalizeName(nodes) </ins> for i := 0; i < retryCount; i++ { for _, node := range nodes.Items { if registered.Has(node.Name) {

func (s *NodeController) isRunningCloudProvider() bool { return s.cloud != nil && len(s.matchRE) > 0 } <ins> // canonicalizeName takes a node list and lowercases all nodes' name. func (s *NodeController) canonicalizeName(nodes *api.NodeList) *api.NodeList { for i := range nodes.Items { nodes.Items[i].Name = strings.ToLower(nodes.Items[i].Name) } return nodes } </ins>

expectedFail:         false, }, { <ins> // Canonicalize node names. machines: []string{"NODE0", "node1"}, fakeNodeHandler: &FakeNodeHandler{ CreateHook: func(fake *FakeNodeHandler, node *api.Node) bool { if node.Name == "NODE0" { return false } return true }, }, retryCount:           1, expectedRequestCount: 2, expectedCreateCount:  2, expectedFail:         false, }, { </ins> // No machine to register. machines: []string{}, fakeNodeHandler: &FakeNodeHandler{
Change:
rebase raced with change and missed a line in commit , leaving that test referencing the old file.

Discussion:
It("should be submitted and removed", func() { podClient := c.Pods(api.NamespaceDefault) <del> By("loading the pod json") pod := loadPodOrDie(assetPath("api", "examples", "pod.json")) </del> <ins> By("creating the pod") name := "pod-update-" + string(util.NewUUID()) </ins> value := strconv.Itoa(time.Now().Nanosecond()) <del> pod.Name = pod.Name + "-" + randomSuffix() pod.Labels["time"] = value pod.Spec.Containers[0].Ports[0].HostPort = 0 </del> <ins> pod := &api.Pod{ ObjectMeta: api.ObjectMeta{ Name: name, Labels: map[string]string{ "name": "foo", "time": value, }, }, Spec: api.PodSpec{ Containers: []api.Container{ { Name:  "nginx", Image: "dockerfile/nginx", Ports: []api.Port{{ContainerPort: 80}}, LivenessProbe: &api.Probe{ Handler: api.Handler{ HTTPGet: &api.HTTPGetAction{ Path: "/index.html", Port: util.NewIntOrStringFromInt(8080), }, }, InitialDelaySeconds: 30, }, }, }, }, } </ins> By("submitting the pod to kubernetes") _, err := podClient.Create(pod)
Change:
The issue is a missing = in the arguments for starting kube-apiserver. Fix at: in branch:

Discussion:
"        ExecStart=/opt/bin/kube-apiserver n", "        --address=0.0.0.0 n", "        --port=8080 n", <del> "        --portal_net 10.244.0.0/16 n", </del> <ins> "        --portal_net=10.244.0.0/16 n", </ins> "        --etcd_servers=http://127.0.0.1:4001 n", "        --public_address_override=$private_ipv4 n", "        --logtostderr=truen",