jiebi/CodeConvo huggingface dataset:
Change:
fails with this trace: Please help.
Thanks for trying Kubernetes, sorry it didn't work for you. Do you have an old version of go installed? We currently are building with go 1.2, you can run to find the version. I tried to repro. this on a clean client, and I can't seem to reproduce the problem, also our Travis build is green: https://travis-, so I think that the problem must be somewhere in your set up. Please let me know some more details and we can help you debug. Best! --brendan
I validated that this is due to trying to compile with Go version 1.0 rather than 1.2. I'll update the scripts to validate that the appropriate version of Go is installed. So please upgrade your installed version of golang, and try again. Thanks! --brendan

Discussion:
exit 1 fi <ins> # Travis continuous build uses a head go release that doesn't report # a version number, so we skip this check on Travis.  Its unnecessary # there anyway. if [ ${TRAVIS} != "true" ]; then GO_VERSION=($(go version)) if [ ${GO_VERSION[2]} < "go1.2" ]; then echo "Detected go version: ${GO_VERSION}." echo "Kubernetes requires go version 1.2 or greater." echo "Please install Go version 1.2 or later" exit 1 fi fi </ins> pushd $(dirname "${BASH_SOURCE}")/.. >/dev/null KUBE_REPO_ROOT="${PWD}" KUBE_TARGET="${KUBE_REPO_ROOT}/output/go"
Change:
To remove dependence on jq and generally make scripting much easier, we should make another output flag which takes a formatter. We can use go's template package, which is very flexible.

Discussion:
"os" "strconv" "strings" <ins> "text/template" </ins> "time" kube_client "github.com/GoogleCloudPlatform/kubernetes/pkg/client"

verbose      = flag.Bool("verbose", false, "If true, print extra information") proxy        = flag.Bool("proxy", false, "If true, run a proxy to the api server") www          = flag.String("www", "", "If -proxy is true, use this directory to serve static files") <ins> templateFile = flag.String("template_file", "", "If present load this file as a golang template and us it for output printing") templateStr  = flag.String("template", "", "If present parse this string as a golang template and us it for output printing") </ins> ) func usage() {

} var printer kubecfg.ResourcePrinter <del> if *json { </del> <ins> switch { case *json: </ins> printer = &kubecfg.IdentityPrinter{} <del> } else if *yaml { </del> <ins> case *yaml: </ins> printer = &kubecfg.YAMLPrinter{} <del> } else { </del> <ins> case len(*templateFile) > 0 || len(*templateStr) > 0: var data []byte if len(*templateFile) > 0 { var err error data, err = ioutil.ReadFile(*templateFile) if err != nil { glog.Fatalf("Error reading template %s, %vn", *templateFile, err) return false } } else { data = []byte(*templateStr) } tmpl, err := template.New("output").Parse(string(data)) if err != nil { glog.Fatalf("Error parsing template %s, %vn", string(data), err) return false } printer = &kubecfg.TemplatePrinter{ Template: tmpl, } default: </ins> printer = &kubecfg.HumanReadablePrinter{} }

"io" "strings" "text/tabwriter" <ins> "text/template" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels"

return err } } <ins> type TemplatePrinter struct { Template *template.Template } func (t *TemplatePrinter) Print(data []byte, w io.Writer) error { obj, err := api.Decode(data) if err != nil { return err } return t.PrintObj(obj, w) } func (t *TemplatePrinter) PrintObj(obj interface{}, w io.Writer) error { return t.Template.Execute(w, obj) } </ins>
Change:
It shouldn't: But my shell-fu is weak, maybe there's something wrong with that?
I think it's missing some quotes. I'll make a PR.

Discussion:
ALREADY_UP=${1:-0} LEAVE_UP=${2:-0} <del> # Exit on error set -e </del> HAVE_JQ=$(which jq) if [[ -z ${HAVE_JQ} ]]; then echo "Please install jq, e.g.: 'sudo apt-get install jq' or, "

exit 1 fi <ins> # Exit on error set -e </ins> # Use testing config export KUBE_CONFIG_FILE="config-test.sh" export KUBE_REPO_ROOT="$(dirname $0)/.."
Change:
I'd like to make the case for moving the check out of the Storage interface and put that responsibility at a higher level. It was introduced . The case for moving it up 1) the interface it's implemented under already provides the primitives necessary to reproduce the check (GetPod) 2) it couples creation storage tightly to the (unreliable) infrastructure, which means consumers of the interface must anticipate both apiserver, storage, and infrastructure issues (vs just apiserver and storage) 3) as an API consumer I may want to know when my pod moves to pending, vs to started (which could be multiple orders of mangnitude longer) Would there be strong disagreement if I opened a pull moving the async wait to above the interface? Or is there a strong design reason to couple this here that I missed?
Hey Clayton, I think in general, I was trying to have it only return when it was "done" but as you point out, there are lots of problems with this, I think that falling back to "in our control" is perhaps the correct semantic. We've been thinking along similar lines, namely that we should only do acceptance testing (e.g. "is this pod feasible") before returning 200 and stopping waiting, instead of waiting for the task to go fully running. I took a rough design that proposed, and pasted it into: So if that design makes sense to you, and achieves the the same goals as what you are suggesting (I think it does) let's move towards that. The first thing might to roll back the other PR, and then move forward from the previous state. Thanks --brendan
Agree that we're "done" when the pod is accepted and stored in the system, and needn't wait until it's running. Ultimately, one should be able to wait on events (i.e., we'd wrap etcd's watch); one such event would be the state change from assigned to running, and that's how clients should get this behavior if they need it.
Agreed
This is fixed

Discussion:
}, }, Sync:       false, <del> PollPeriod: time.Second * 20, </del> <ins> PollPeriod: time.Second * 2, </ins> Timeout:    time.Second * 20, } }
Change:
Before enabling the cloud storage API, I'm unable to launch the test cluster. dev-build-and- appears to run successfully, but hangs at the end as the machines have not been properly configured. From on the kubernetes-master: AccessDeniedException: 403 Access Not Configured. Please go to the Google Developers Console () for your pro ject, select APIs and Auth and enable the Google Cloud Storage JSON API.

Discussion:
hack/dev-build-and-up.sh ``` <ins> The script above relies on Google Storage to deploy the software to instances running in GCE. It uses the Google Storage APIs so the "Google Cloud Storage JSON API" setting must be enabled for the project in the Google Developers Console (https://cloud.google.com/console#/project). The instances must also be able to connect to each other using their private IP. The script uses the "default" network which should have a firewall rule called "default-allow-internal" which allows traffic on any port on the private IPs. If this rule is missing from the default network or if you change the network being used in `cluster/config-default.sh` create a new rule with the following field values: * Source Ranges: 10.0.0.0/8 * Allowed Protocols or Port: tcp:1-65535;udp:1-65535;icmp </ins> ### Running a container (simple version) Once you have your instances up and running, the `build-go.sh` script sets up
Change:
Here if we with , then we are only able to watch the latest change. In this case if the key is modified after the returns but before the we call the , then we will miss the event. To avoid the window time, we'd better specify the to be the index in the response of the . BTW, I think if we use with , we can probably eliminate the first call.
This is fixed in

Discussion:
"//vendor/gopkg.in/gcfg.v1:go_default_library", "//vendor/k8s.io/api/core/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", <del> "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", </del> "//vendor/k8s.io/client-go/informers:go_default_library", "//vendor/k8s.io/client-go/tools/cache:go_default_library", ],

"golang.org/x/net/context" "k8s.io/api/core/v1" k8stypes "k8s.io/apimachinery/pkg/types" <del> "k8s.io/apimachinery/pkg/util/wait" </del> "k8s.io/client-go/informers" "k8s.io/client-go/tools/cache" v1helper "k8s.io/kubernetes/pkg/apis/core/v1/helper"

// Initialize passes a Kubernetes clientBuilder interface to the cloud provider func (vs *VSphere) Initialize(clientBuilder controller.ControllerClientBuilder) { <ins> } // Initialize Node Informers func (vs *VSphere) SetInformers(informerFactory informers.SharedInformerFactory) { </ins> if vs.cfg == nil { return } // Only on controller node it is required to register listeners. // Register callbacks for node updates <del> client := clientBuilder.ClientOrDie("vsphere-cloud-provider") factory := informers.NewSharedInformerFactory(client, 5*time.Minute) nodeInformer := factory.Core().V1().Nodes() nodeInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ </del> <ins> glog.V(4).Infof("Setting up node informers for vSphere Cloud Provider") nodeInformer := informerFactory.Core().V1().Nodes().Informer() nodeInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{ </ins> AddFunc:    vs.NodeAdded, DeleteFunc: vs.NodeDeleted, }) <del> go nodeInformer.Informer().Run(wait.NeverStop) glog.V(4).Infof("vSphere cloud provider initialized") </del> <ins> glog.V(4).Infof("Node informers in vSphere cloud provider initialized") </ins> } // Creates new worker node interface and returns
Change:
This leads to the following errors when running the example Guest Book application: If the proxy and the endpoint are on the same machine then the proxy works because everything defaults to 127.0.0.1 Successful proxy logs
I have this problem too. I think this has something to do with not having pod_registry/fillPodInfo called on the pods, but I'm not sure how to get the code where it needs to be.
I have repro-d this, I should be able to close it down soon. Sorry! --brendan , Ryan Fowler wrote:
please see for the fix. Sorry for the issue!
This issue is resolved. Closing.

Discussion:
apiVersion: v1 kind: Pod metadata: <del> name: l7-lb-controller-v0.9.2 </del> <ins> name: l7-lb-controller-v0.9.3 </ins> namespace: kube-system labels: k8s-app: glbc <del> version: v0.9.2 </del> <ins> version: v0.9.3 </ins> kubernetes.io/cluster-service: "true" kubernetes.io/name: "GLBC" spec: terminationGracePeriodSeconds: 600 hostNetwork: true containers: <del> - image: gcr.io/google_containers/glbc:0.9.2 </del> <ins> - image: gcr.io/google_containers/glbc:0.9.3 </ins> livenessProbe: httpGet: path: /healthz

# TODO: split this out into args when we no longer need to pipe stdout to a file #6428 - sh - -c <del> - '/glbc --verbose=true --default-backend-service=kube-system/default-http-backend --sync-period=600s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1' </del> <ins> - '/glbc --verbose=true --apiserver-host=http://localhost:8080 --default-backend-service=kube-system/default-http-backend --sync-period=600s --running-in-cluster=false --use-real-cloud=true --config-file-path=/etc/gce.conf --healthz-port=8086 1>>/var/log/glbc.log 2>&1' </ins> volumes: - hostPath: path: /etc/gce.conf
Change:
With the current master HEAD, the apiserver never gets to a happy state. Here's what gets printed in many times. I think it's due to validation failure on the cadvisor manifest. Here's the relevent section of
Ryan, I haven't figured out the root cause of your issue yet, but I think I can help you rule out those validation failures on the cadvisor manifest. I saw the exact same validation errors on my , but I still can query /api/v1beta1/pods through apiserver. Both my apiserver and kubelet from yesterday afternoon, not include the latest merged PRs last night. Will try to see if I could reproduce your issue here.
I just pulled the code from HEAD, and ran into the same problem as Ryan. I need to attend a meeting now. Right after that, I will look into it if no one else are working it.
I seem to recall a cAdvisor path change in your PR? Related?
I will look
Just back from the meeting. I think the issue is caused by incompatibility between apiserver and kubelete. I noticed that there is a error msg in the initial your posed: E0722 14:55:52. ] Error synchronizing container list: &url.Error{Op:"Get", URL:"http://kubernetes-minion-", Err:(*net.OpError)(0xc2103ca2c0)} It is the same error I observed on my apiserver html page. Looks like apiserver failed to retrieve healthz/ from minions, then failed the query of /api/v1beta1/pods. To prove my hypothesis, I teared down my entire cluster and built a new one, and everything runs fine. I guess you just simply push the new kubelet binary over to some of minions in your cluster? Unfortunately I haven't figured out the exact where healthz/ failed yet.
We started validating manifests in the kubelet (using Tim's code) with my pull.
Looking into fixing the cAdvisor manifest. Assigning to myself.
Actually we started validating before with Tim's pull - I a unit test for validating manifests. We really need to get API validation in - I may try to get to that soon.

Discussion:
containerPort: 8080 hostPort: 5000 volumeMounts: <del> - name: var-run </del> <ins> - name: varrun </ins> mountPath: /var/run readOnly: false <del> mountType: HOST - name: var-lib-docker </del> <ins> - name: varlibdocker </ins> mountPath: /var/lib/docker readOnly: true <del> mountType: HOST </del> - name: cgroups mountPath: /sys/fs/cgroup readOnly: true <del> mountType: HOST </del> volumes: <del> -name: var-run -name: var-lib-docker -name: var-cgroups </del> <ins> - name: varrun source: hostDir: path: /var/run - name: varlibdocker source: hostDir: path: /var/lib/docker - name: cgroups source: hostDir: path: /sys/fs/cgroup </ins>
Change:
dev-build-and-{push|up}.sh scripts silently push an old version.

Discussion:
# First build a release $(dirname $0)/../release/release.sh <ins> if [ "$?" != "0" ]; then echo "Building a release failed!" exit 1 fi </ins> # Now push this out to the cluster $(dirname $0)/../cluster/kube-push.sh

# First build a release $(dirname $0)/../release/release.sh <ins> if [ "$?" != "0" ]; then echo "Building the release failed!" exit 1 fi </ins> # Now bring a new cluster up with that release. $(dirname $0)/../cluster/kube-up.sh
Change:
https://travis-
Taking a look.
The problem is that TestWatch is using a 10ms timeout, and after parallel test change, we seem to hit the unlucky case more often. This happens when the etcdWatch.translate goroutine never gets a chance to consume the etcdIncoming channel within 10ms. A naive fix would be to remove this 10ms timeout, and have the test rely on the default 30 sec timeout which comes with the test harness.
Ah, I see. Nice catch.

Discussion:
"fmt" "reflect" "testing" <del> "time" </del> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/conversion"

}, } <del> select { case event := <-watching.ResultChan(): if e, a := watch.Added, event.Type; e != a { t.Errorf("Expected %v, got %v", e, a) } if e, a := pod, event.Object; !reflect.DeepEqual(e, a) { t.Errorf("Expected %v, got %v", e, a) } case <-time.After(10 * time.Millisecond): t.Errorf("Expected 1 call but got 0") </del> <ins> event := <-watching.ResultChan() if e, a := watch.Added, event.Type; e != a { t.Errorf("Expected %v, got %v", e, a) } if e, a := pod, event.Object; !reflect.DeepEqual(e, a) { t.Errorf("Expected %v, got %v", e, a) </ins> } // Test error case
Change:
Spin up a cluster. Create a container on each of two machines. Try to ping each other's IPs. No love. It seems we need an extra iptables rule. For example, for a minion with the 10.244.2.0/24 subnet assigned, we need: iptables -t nat -A POSTROUTING -s 10.244.2.0/24 ! -d 10.244.2.0/24 -j MASQUERADE
Hrm, I can't repro this. I tried: ping 10.244.2.1 from a different kubernetes VM and it worked. (or do you mean from inside a container?)
From within a container to another container
repro'ed it for me, too.
Is this just ping? Or is this any network traffic? , Tim Hockin wrote:
Any traffic - the kernel is not masquerading it because our iptables magic doesn't match packets coming from inside a container on a veth. I saw this while trying to do another round of perf tests.

Discussion:
''' ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''} <del> iptables_rule = { </del> <ins> iptables_rule_1 = { </ins> 'table': 'nat', 'chain': 'POSTROUTING', 'rule': '-o eth0 -j MASQUERADE ! -d 10.0.0.0/8' } <ins> iptables_rule_2 = { 'table': 'nat', 'chain': 'POSTROUTING', 'rule': '-s %s -j MASQUERADE ! -d %s' % (cidr, cidr) } </ins> def bridge_exists(name): 'Determine if a bridge exists already.'

ret['details'] = {} # This module function is strange and returns True if the rule exists. # If not, it returns a string with the error from the call to iptables. <del> ret['iptables_rule_exists'] =  __salt__['iptables.check'](**iptables_rule) == True </del> <ins> ret['iptables_rule_1_exists'] =  __salt__['iptables.check'](**iptables_rule_1) == True ret['iptables_rule_2_exists'] =  __salt__['iptables.check'](**iptables_rule_2) == True </ins> return ret # This is a little hacky.  I should probably import a real library for this

and current_state['details']['mtu'] == mtu and desired_network in current_state['details']['networks'] and current_state['details']['up'] <del> and current_state['iptables_rule_exists']): </del> <ins> and current_state['iptables_rule_1_exists'] and current_state['iptables_rule_2_exists']): </ins> ret['result'] = True ret['comment'] = 'System already in the correct state' return ret

__salt__['cmd.run']( 'ip link set dev {0} up'.format(name)) new_state = get_current_state() <del> if not new_state['iptables_rule_exists']: __salt__['iptables.append'](**iptables_rule) </del> <ins> if not new_state['iptables_rule_1_exists']: __salt__['iptables.append'](**iptables_rule_1) if not new_state['iptables_rule_2_exists']: __salt__['iptables.append'](**iptables_rule_2) </ins> new_state = get_current_state() ret['comment'] = 'The state of "{0}" was changed!'.format(name)
Change:
https://travis-
Looking.
Another instance, or a different thing? https://travis-

Discussion:
// OnUpdate manages the active set of service proxies. // Active service proxies are reinitialized if found in the update set or // shutdown if missing from the update set. <del> func (proxier Proxier) OnUpdate(services []api.Service) { </del> <ins> func (proxier *Proxier) OnUpdate(services []api.Service) { </ins> glog.Infof("Received update notice: %+v", services) activeServices := util.StringSet{} for _, service := range services {
Change:
In issue it appeared that consensus was reached that a service id could contain a hyphen, but that it would be translated to an underscore in the environment variables (this issues was the root problem, back in ). However, the replacement does not appear to have been done: hyphens are still not replaced with underscores in env-var names. (Although now underscores are blocked in service names!)
Hm, that's weird. I thought that this code was doing replacement. Did that get removed?
Thanks for looking into this lavalamp. Was your question directed at me? I don't see any string replacement code in the code you linked to, at least not for the (I do see escaping for the port in line 198)
Ah, no, I was just thinking out loud there. Maybe knows what happened?
Ah, that's an oversight. We do it for the Docker link style variables, but not the old school ones. I'll send a PR.
PR sent.

Discussion:
return result, err } for _, service := range services.Items { <del> name := strings.ToUpper(service.ID) + "_SERVICE_PORT" </del> <ins> name := makeEnvVariableName(service.ID) + "_SERVICE_PORT" </ins> value := strconv.Itoa(service.Port) result = append(result, api.EnvVar{Name: name, Value: value}) result = append(result, makeLinkVariables(service, machine)...)

return nil } <ins> func makeEnvVariableName(str string) string { return strings.ToUpper(strings.Replace(str, "-", "_", -1)) } </ins> func makeLinkVariables(service api.Service, machine string) []api.EnvVar { <del> prefix := strings.ToUpper(service.ID) </del> <ins> prefix := makeEnvVariableName(service.ID) </ins> var port string if service.ContainerPort.Kind == util.IntstrString { port = service.ContainerPort.StrVal } else { port = strconv.Itoa(service.ContainerPort.IntVal) } <del> portPrefix := prefix + "_PORT_" + strings.ToUpper(strings.Replace(port, "-", "_", -1)) + "_TCP" </del> <ins> portPrefix := prefix + "_PORT_" + makeEnvVariableName(port) + "_TCP" </ins> return []api.EnvVar{ { Name:  prefix + "_PORT",

func TestServiceRegistryMakeLinkVariables(t *testing.T) { service := api.Service{ <del> JSONBase:      api.JSONBase{ID: "foo"}, </del> <ins> JSONBase:      api.JSONBase{ID: "foo-bar"}, </ins> Selector:      map[string]string{"bar": "baz"}, ContainerPort: util.IntOrString{Kind: util.IntstrString, StrVal: "a-b-c"}, } <del> vars := makeLinkVariables(service, "mars") </del> <ins> registry := registrytest.NewServiceRegistry() registry.List = api.ServiceList{ Items: []api.Service{service}, } machine := "machine" vars, err := GetServiceEnvironmentVariables(registry, machine) if err != nil { t.Errorf("unexpected err: %v", err) } </ins> for _, v := range vars { if !util.IsCIdentifier(v.Name) { t.Errorf("Environment variable name is not valid: %v", v.Name)
Change:
This error appears every 10 seconds (with .bashlogout & .bashprofile also), when set up with vagrant: Aug 12 23:16:58 kubernetes-minion-1 kubelet[]: E0812 23:16:58. ] Could not read directory: , (open not a directory) This is because the kubelet root directory defaults to /var/lib/kubelet, which is also the homedir for the kubelet user, and so the user's default files trip up kubelet. Manually deleting the files (rm *) causes the errors to stop without any obvious ill-effects.
fixed in

Discussion:
// Volume information is extracted from the directory structure: // (ROOT_DIR)/(POD_ID)/volumes/(VOLUME_KIND)/(VOLUME_NAME) for _, podIDDir := range podIDDirs { <ins> if !podIDDir.IsDir() { continue } </ins> podID := podIDDir.Name() podIDPath := path.Join(mountPath, podID, "volumes") volumeKindDirs, err := ioutil.ReadDir(podIDPath)
Change:
From: https://travis- a test failure on a PR that documentation, so no failure expected. E0813 16:12:46. ] unknown action: update E0813 16:12:46. ] unexpected nil node: &etcd.Response{Action:"set", Node:(etcd.Node)(nil), PrevNode:(etcd.Node)(nil), EtcdIndex:0x0, RaftIndex:0x0, RaftTerm:0x0} E0813 16:12:46. ] failure to decode api object: 'foobar' from &etcd.Response{Action:"set", Node:(etcd.Node)(0xc2100d4720), PrevNode:(etcd.Node)(nil), EtcdIndex:0x0, RaftIndex:0x0, RaftTerm:0x0} &etcd.Node{Key:"", Value:"foobar", Dir:false, Expiration:(time.Time)(nil), TTL:0, Nodes:etcd.Nodes(nil), ModifiedIndex:0x0, CreatedIndex:0x0} E0813 16:12:46. ] etcd.Watch stopped unexpectedly: Injected error ("/some/key") E0813 16:12:46. ] watch was unable to retrieve the current index for the provided key: 101: () --- FAIL: TestWatchFromOtherError (0.00 seconds) returning /some/key: &{ <nil<nil0 0 0} &etcd.EtcdError{ErrorCode:101, Message:"", Cause:"", Index:0x2} watch should have closed channel: &tools.etcdWatcher{encoding:(_conversion.Scheme)(0xc21001fa50), versioner:(api.jsonBaseResourceVersioner)(0xc586f0), transform:(tools.TransformFunc)(nil), list:false, filter:(tools.FilterFunc)(nil), etcdIncoming:(chan etcd.Response)(0xc2100bf240), etcdStop:(chan bool)(0xc2100bf2a0), etcdCallEnded:(chan struct {})(0xc2100bf300), outgoing:(chan watch.Event)(0xc2100bf360), userStop:(chan struct {})(0xc2100bf3c0), stopped:false, stopLock:sync.Mutex{state:0, sema:0x0}, emit:(func(watch.Event))(0x457940)} FAIL FAIL 0.474s ok 1.179s coverage: 83.6% of statements ok 1.286s coverage: 92.9% of statements ok 1.165s coverage: 84.4% of statements ok 1.283s coverage: 100.0% of statements The command "./hack/test-" exited with 123.

Discussion:
if ok { t.Fatalf("expected result channel to be closed") } <del> case <-time.After(1 * time.Millisecond): </del> <ins> case <-time.After(1 * time.Second): </ins> t.Fatalf("watch should have closed channel: %#v", watching) }