jiebi/CodeConvo huggingface dataset:
Change:
Im extracting logs part from The current behavior is as follow: when pod has one container return logs for this one container when pod has more than one container returns error: Error from server: a container name must be specified for pod kube-dns-v14-z0ho6, choose one of: [kubedns dnsmasq healthz] As you can see in both cases init containers are ignored. The question are: in first case should we return error and list all containers including init containers? in second case should we also list init containers?
first case is designed on purpose that way for the usability, especially the users who switch from docker single container to Kubernetes pod. But what you suggested above for the second case are great, we should do it. Mind to send pr fixing it? Thanks!
sure, I will prepare pr. I'm wondering if we should somehow distinguish init containers and normal containers. we can add to init container name but this may be misleading. we can also add second list with init containers. Something like these: Or just show all in one list without any changes. What do you think?
I prefer not introducing a prefix "init:" here. I like the second option better. cc/ WDYT?
I like the second option as well. We generally avoid prefixes or special syntax except in rare cases.
since I know you are also looking at code in these places.
+1 for the second option.

Discussion:
} // getContainerNames returns a formatted string containing the container names <del> func getContainerNames(pod *api.Pod) string { </del> <ins> func getContainerNames(containers []api.Container) string { </ins> names := []string{} <del> for _, c := range pod.Spec.Containers { </del> <ins> for _, c := range containers { </ins> names = append(names, c.Name) } return strings.Join(names, " ")

case 0: return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s", name)) default: <del> containerNames := getContainerNames(pod) return nil, nil, errors.NewBadRequest(fmt.Sprintf("a container name must be specified for pod %s, choose one of: [%s]", name, containerNames)) </del> <ins> containerNames := getContainerNames(pod.Spec.Containers) initContainerNames := getContainerNames(pod.Spec.InitContainers) err := fmt.Sprintf("a container name must be specified for pod %s, choose one of: [%s]", name, containerNames) if len(initContainerNames) > 0 { err += fmt.Sprintf(" or one of the init containers: [%s]", initContainerNames) } return nil, nil, errors.NewBadRequest(err) </ins> } } else { if !podHasContainerWithName(pod, container) {

{Name: "container1"}, {Name: "container2"}, }, <ins> InitContainers: []api.Container{ {Name: "initcontainer1"}, }, }, Status: api.PodStatus{}, }, opts:        &api.PodLogOptions{}, expectedErr: errors.NewBadRequest("a container name must be specified for pod test, choose one of: [container1 container2] or one of the init containers: [initcontainer1]"), }, { in: &api.Pod{ Spec: api.PodSpec{ Containers: []api.Container{ {Name: "container1"}, {Name: "container2"}, }, </ins> }, Status: api.PodStatus{}, },
Change:
ref:
identified one problem: firewall is not open for icmp in GCI setup. I opened it manually. Still does not work.
Here are the symptoms: node can ping each other one node, it can ping all pods on it, and vice versa. one node or pod, it can ping all cbr0 gateways(10.X.X.1). pod, it cannot ping but able to curl. It cannot ping any other pod, even on the same bridge, but able to curl.
My first thought would be somethings blockign ping. your options are iptables, firewall, icmp is disabled alltogether (sysctl or somewhere in /proc/sys/net/ there should be a setting). Try traceroute and see where it gets to.
I have a working version now. GCI setup icmp ACCEPT rules in INPUT chain of filter table. But not in OUTPUT and FORWARD chain.
In summary, 2 problems: is not opened for icmp is filtering icmp on FORWARD chain. ACCEPT on INPUT chain is not enough Will submit a fix
Great detective work, Is this a ping-specific problem, or are there going to be problems with other types of outgoing traffic from pods on GCI as well?
I do not see any problem for udp/tcp traffic so far. e2e tests already covers lots of them. Unfortunately, no e2e covers ping tests and GCI happens to filter it.
We should add a test in networking suite for ping.
Is this missing a milestone 1.3?

Discussion:
function config-ip-firewall { echo "Configuring IP firewall rules" # The GCI image has host firewall which drop most inbound/forwarded packets. <del> # We need to add rules to accept all TCP/UDP packets. </del> <ins> # We need to add rules to accept all TCP/UDP/ICMP packets. </ins> if iptables -L INPUT | grep "Chain INPUT (policy DROP)" > /dev/null; then <del> echo "Add rules to accept all inbound TCP/UDP packets" </del> <ins> echo "Add rules to accept all inbound TCP/UDP/ICMP packets" </ins> iptables -A INPUT -w -p TCP -j ACCEPT iptables -A INPUT -w -p UDP -j ACCEPT <ins> iptables -A INPUT -w -p ICMP -j ACCEPT </ins> fi if iptables -L FORWARD | grep "Chain FORWARD (policy DROP)" > /dev/null; then <del> echo "Add rules to accept all forwarded TCP/UDP packets" </del> <ins> echo "Add rules to accept all forwarded TCP/UDP/ICMP packets" </ins> iptables -A FORWARD -w -p TCP -j ACCEPT iptables -A FORWARD -w -p UDP -j ACCEPT <ins> iptables -A FORWARD -w -p ICMP -j ACCEPT </ins> fi }
Change:
https://k8s- Failed: [] SchedulerPredicates [Serial] validates resource limits of pods that are allowed to run [Conformance] {Kubernetes e2e suite}
- FYI
https://k8s- Failed: [] SchedulerPredicates [Serial] validates resource limits of pods that are allowed to run [Conformance] {Kubernetes e2e suite}
First failure is a dupe of . For second I need to wait for master logs.

Discussion:
framework.ExpectNoError(err) for _, pod := range pods.Items { _, found := nodeToCapacityMap[pod.Spec.NodeName] <del> if found && pod.Status.Phase == api.PodRunning { </del> <ins> if found && pod.Status.Phase != api.PodSucceeded && pod.Status.Phase != api.PodFailed { </ins> framework.Logf("Pod %v requesting resource cpu=%vm on Node %v", pod.Name, getRequestedCPU(pod), pod.Spec.NodeName) nodeToCapacityMap[pod.Spec.NodeName] -= getRequestedCPU(pod) }
Change:
That does not make any sense. should not exist at this point, it's from different integration test and starts with . Is it possible that that another test is running at this time? Each test basically starts with , so parallelism is IMO not possible as the tests will delete keys of each other.
So, it looks like the tests are not running in parallel, however some volumes leak from one test to another one, even past . I have no explanation for this, but I can reproduce it locally with logs I need. I have gut feeling that there is something wrong in the way how controller stops - each test starts a new one and stops it in the end. just closes some channels, there is no way how to wait until and finishes. I'll look at it on Monday, any ideas would be welcome.
The tests might be running in parallel - I think that's what does by default, though I'm not certain.
though that parallelism may only be across separate test suites, so is probably not run in parallel.
I bumped the priority to P0 since it is the main cause for kubernetes-test-go now, which blocks merge queue.
This issue is dropping our merge throughput by 60%...
I've made a quick patch which will at least test theory. I'll post it shortly.
Hm, now I see a failure in integration.TestUnschedulableNodes-- will keep my eye on it
There is an open issue for UnschedulableNodes - FYI
thanks for the PR. Did the test fail again after was merged?
I still see some failures of on my machine, fixed by

Discussion:
if err != nil { t.Errorf("Failed to create PersistentVolume %d: %v", i, err) } <ins> waitForPersistentVolumePhase(testClient, pvs[i].Name, watchPV, api.VolumeAvailable) </ins> } t.Log("volumes created")
Change:
Eg: Suspect it's because of:
If this hasn't been seen in 3 months, okay to close?
Yes we fixed it with

Discussion:
os.Remove(deviceMountPath) return err } <ins> glog.V(4).Infof("formatting spec %v devicePath %v deviceMountPath %v fs %v with options %+v", spec.Name(), devicePath, deviceMountPath, volumeSource.FSType, options) </ins> } return nil }

if spec.Volume != nil && spec.Volume.GCEPersistentDisk != nil { volumeSource = spec.Volume.GCEPersistentDisk readOnly = volumeSource.ReadOnly <ins> glog.V(4).Infof("volume source %v spec %v, readonly flag retrieved from source: %v", volumeSource.PDName, spec.Name(), readOnly) </ins> } else { volumeSource = spec.PersistentVolume.Spec.GCEPersistentDisk readOnly = spec.ReadOnly <ins> glog.V(4).Infof("volume source %v spec %v, readonly flag retrieved from spec: %v", volumeSource.PDName, spec.Name(), readOnly) </ins> } return volumeSource, readOnly }

func (b *gcePersistentDiskMounter) SetUpAt(dir string, fsGroup *int64) error { // TODO: handle failed mounts here. notMnt, err := b.mounter.IsLikelyNotMountPoint(dir) <del> glog.V(4).Infof("PersistentDisk set up: %s %v %v", dir, !notMnt, err) </del> <ins> glog.V(4).Infof("PersistentDisk set up: %s %v %v, pd name %v readOnly %v", dir, !notMnt, err, b.pdName, b.readOnly) </ins> if err != nil && !os.IsNotExist(err) { return err }

By("Saturating pet set " + ps.Name) pst.saturate(ps) <ins> By("Verifying petset mounted data directory is usable") ExpectNoError(pst.checkMount(ps, "/data")) </ins> cmd := "echo $(hostname) > /data/hostname; sync;" By("Running " + cmd + " in all pets") <del> pst.execInPets(ps, cmd) </del> <ins> ExpectNoError(pst.execInPets(ps, cmd)) </ins> By("Restarting pet set " + ps.Name) pst.restart(ps) pst.saturate(ps) <ins> By("Verifying petset mounted data directory is usable") ExpectNoError(pst.checkMount(ps, "/data")) </ins> cmd = "if [ "$(cat /data/hostname)" = "$(hostname)" ]; then exit 0; else exit 1; fi" By("Running " + cmd + " in all pets") <del> pst.execInPets(ps, cmd) </del> <ins> ExpectNoError(pst.execInPets(ps, cmd)) </ins> }) It("should handle healthy pet restarts during scale [Feature:PetSet]", func() {

return ps } <del> func (p *petSetTester) execInPets(ps *apps.PetSet, cmd string) { </del> <ins> func (p *petSetTester) checkMount(ps *apps.PetSet, mountPath string) error { for _, cmd := range []string{ // Print inode, size etc fmt.Sprintf("ls -idlh %v", mountPath), // Print subdirs fmt.Sprintf("find %v", mountPath), // Try writing fmt.Sprintf("touch %v", filepath.Join(mountPath, fmt.Sprintf("%v", time.Now().UnixNano()))), } { if err := p.execInPets(ps, cmd); err != nil { return fmt.Errorf("failed to execute %v, error: %v", cmd, err) } } return nil } func (p *petSetTester) execInPets(ps *apps.PetSet, cmd string) error { </ins> podList := p.getPodList(ps) for _, pet := range podList.Items { stdout, err := framework.RunHostCmd(pet.Namespace, pet.Name, cmd) <del> ExpectNoError(err) </del> framework.Logf("stdout of %v on %v: %v", cmd, pet.Name, stdout) <ins> if err != nil { return err } </ins> } <ins> return nil </ins> } func (p *petSetTester) saturate(ps *apps.PetSet) {
Change:
I came upon a cluster that had had the namespace code thoroughly exercised. No namespaces currently existed, but many had been created and deleted in the past. Its etcd had lots of empty directories under each resource that had held items when those namespaces were alive (secrets, serviceaccounts, pods...). Do we need to be doing something to clean these empty directories up? It seems like this etcd was consuming a lot of memory.
or might know the answer to this question.
Right. We should delete them. It might get tricky for concurrent cases like A checks if dir is empty, B creates, then A deletes it. What does it look like currently in creating and deleting namespace?
How much memory does a directory entry take? Does it really sound possible to run out of memory while snapshotting on account of too many empty directories?
-- have you guys encountered this? I think you run with more namespaces than we do. But maybe yours are mostly populated?
Yes, we've seen it. c.f.
Approximate memory use we saw from empty dirs:
cc
The patch we debated carrying is here: Our hope was to just wait to etcd v3 where this would not be a problem.
can you link to your clean-up script here?
I needed another PR to run the pod automatically on master.

Discussion:
mv "${temp_file}" /etc/kubernetes/manifests } <ins> function start-etcd-empty-dir-cleanup-pod { cp "${KUBE_HOME}/kube-manifests/kubernetes/gci-trusty/etcd-empty-dir-cleanup/etcd-empty-dir-cleanup.yaml" "/etc/kubernetes/manifests" } </ins> # Starts etcd server pod (and etcd-events pod if needed). # More specifically, it prepares dirs and files, sets the variable value # in the manifests, and copies them to /etc/kubernetes/manifests.

if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then compute-master-manifest-variables start-etcd-servers <ins> start-etcd-empty-dir-cleanup-pod </ins> start-kube-apiserver start-kube-controller-manager start-kube-scheduler
Change:
Filing separate follow up from . The issue should have been caught by failing. The suite needs a specific feature test that e.g. looks at node labels to verify multiple zones are present. cc
Yes, you make a good point. The tests currently work the other way around. If the tests detect a multi-zone cluster, they run, otherwise they skip. This makes it safe to run against any cluster, and makes test configuration much simpler. To achieve what you suggest, we will need to add a test for multi-zone that is skipped by default (i.e. in all other test jobs), and only runs on that test job (kubernetes-e2e-gce-ubernetes-lite), failing if multiple zones are not detected.
should we target this one for v1.4, or bump it to 1.5?
Moving out of v1.4 as this is a P2.
This issue was labelled only for sig/multicluster and is thus moved over to kubernetes/federation. If this does not seem to be right, please reopen this and notify us /close

Discussion:
var err error image := "gcr.io/google_containers/serve_hostname:v1.4" BeforeEach(func() { <ins> framework.SkipUnlessProviderIs("gce", "gke", "aws") </ins> if zoneCount <= 0 { zoneCount, err = getZoneCount(f.Client) Expect(err).NotTo(HaveOccurred()) } By(fmt.Sprintf("Checking for multi-zone cluster.  Zone count = %d", zoneCount)) framework.SkipUnlessAtLeast(zoneCount, 2, "Zone count is %d, only run for multi-zone clusters, skipping test") <del> framework.SkipUnlessProviderIs("gce", "gke", "aws") </del> // TODO: SkipUnlessDefaultScheduler() // Non-default schedulers might not spread }) It("should spread the pods of a service across zones", func() {
Change:
In nsentermounter, reads mounts from . Because is sym link to and the containerized kubelet usually bind mount host rootfs in slave mode, thus containerized kubelet's mounts is different from what host sees. This causes kubelet unable to umount/detach volumes. The right way to do is to read hosts's proc, i.e.

Discussion:
const ( hostRootFsPath     = "/rootfs" <del> hostProcMountsPath = "/rootfs/proc/mounts" </del> <ins> hostProcMountsPath = "/rootfs/proc/1/mounts" </ins> nsenterPath        = "nsenter" )
Change:
Is there any good reason to have a nonzero burst rate? Ten is way too high for small clusters, and the number seems to be chosen at random even for large clusters (it's not really the size of any typical failure domain). I think that for now we should set it to zero. Does this sound reasonable to you?
I think that by 0 you mean 1. Goal of was to set it in some sane way. I'll send a simple PR changing it to 1.
Yeah sorry, I meant 1. I'm not suggesting to do the full-blown "make rate proportional to cluster size" thing right now, just to change the burst.
got merged, can this be closed?
Yes, thanks for noticing.
- do you know what description should a PR have to auto close the issue?
I think the problem is that you put a stray period after "Fix"

Discussion:
fs.DurationVar(&s.DeploymentControllerSyncPeriod.Duration, "deployment-controller-sync-period", s.DeploymentControllerSyncPeriod.Duration, "Period for syncing the deployments.") fs.DurationVar(&s.PodEvictionTimeout.Duration, "pod-eviction-timeout", s.PodEvictionTimeout.Duration, "The grace period for deleting pods on failed nodes.") fs.Float32Var(&s.DeletingPodsQps, "deleting-pods-qps", 0.1, "Number of nodes per second on which pods are deleted in case of node failure.") <del> fs.Int32Var(&s.DeletingPodsBurst, "deleting-pods-burst", 10, "Number of nodes on which pods are bursty deleted in case of node failure. For more details look into RateLimiter.") </del> <ins> fs.Int32Var(&s.DeletingPodsBurst, "deleting-pods-burst", 1, "Number of nodes on which pods are bursty deleted in case of node failure. For more details look into RateLimiter.") </ins> fs.Int32Var(&s.RegisterRetryCount, "register-retry-count", s.RegisterRetryCount, ""+ "The number of retries for initial node registration.  Retry interval equals node-sync-period.") fs.MarkDeprecated("register-retry-count", "This flag is currently no-op and will be deleted.")
Change:
https://k8s- It seems that when it takes a while, it tries to collect debug info. And that collection is flawed because kubectl needs a container for log collection when the pod has more than one container.

Discussion:
return } for _, pod := range podList.Items { <del> framework.Logf("Kubectl output:n%v", framework.RunKubectlOrDie("log", pod.Name, "--namespace=kube-system")) </del> <ins> framework.Logf("Kubectl output:n%v", framework.RunKubectlOrDie("log", pod.Name, "--namespace=kube-system", "--container=heapster")) </ins> } }
Change:
Sometime yesterday the test started panicking because the framework is nil. No changes were made to the test, did we change framework setup? This is the stack
Aarg now it looks like we inverted the order of running framework.AfterEach and custom AfterEach, so I re-invoke framework.AfterEach in my AfterEach (we used to need this) and it crashes. I'm just going to usher in as it doesn't invoke framework.AfterEach. For the record this will keep failing on 1.3 till the is cherrypicked, but the diff between 1.3 and HEAD is insignificant at this point (and remain insignificant till the cherrypick happens)
Now gce-1.3 passes but will fail because went in without They should pass when is cherrypicked to 1.3 ( for context)

Discussion:
var responseTimes, creationTimes []time.Duration var ingController *IngressController <del> f := framework.Framework{BaseName: "glbc"} </del> <ins> f := framework.NewDefaultFramework("glbc") </ins> BeforeEach(func() { // This test requires a GCE/GKE only cluster-addon
Change:
https://k8s- Failed: [] Kubectl client [] Kubectl run deployment should create a deployment from an image [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl run deployment should create a deployment from an image [Conformance] {Kubernetes e2e suite}
https://k8s- Failed: [] Kubectl client [] Kubectl run deployment should create a deployment from an image [Conformance] {Kubernetes e2e suite}
[FLAKE-PING] This flaky-test issue would love to have more attention...
[FLAKE-PING] This flaky-test issue would love to have more attention...
https://k8s- Failed: [] Kubectl client [] Kubectl run deployment should create a deployment from an image [Conformance] {Kubernetes e2e suite}

Discussion:
}) AfterEach(func() { <del> framework.RunKubectlOrDie("delete", "deployment", dName, nsFlag) </del> <ins> err := wait.Poll(framework.Poll, 2*time.Minute, func() (bool, error) { out, err := framework.RunKubectl("delete", "deployment", dName, nsFlag) if err != nil { if strings.Contains(err.Error(), "could not find default credentials") { err = nil } return false, fmt.Errorf("kubectl delete failed output: %s, err: %v", out, err) } return true, nil }) Expect(err).NotTo(HaveOccurred()) </ins> }) It("should create a deployment from an image [Conformance]", func() {
Change:
Related issue
is there a simple example that you used to recreate the problem?
I used exactly the example below: So Pod sflask-w-init gets into pending state "Init:0/1" forever. Then you can try to run and you can see that is not working while invoking corresponding command with docker works - it displays current date every second.
thanks for the detailed test, please see the PR :)
Duh! already has a PR

Discussion:
if err != nil { return err } <del> if pod.Status.Phase != api.PodRunning { return fmt.Errorf("pod %s is not running and cannot be attached to; current phase is %s", p.PodName, pod.Status.Phase) </del> <ins> if pod.Status.Phase == api.PodSucceeded || pod.Status.Phase == api.PodFailed { return fmt.Errorf("cannot attach a container in a completed pod; current phase is %s", pod.Status.Phase) </ins> } p.Pod = pod // TODO: convert this to a clean "wait" behavior }

return container } } <ins> for _, container := range pod.Spec.InitContainers { if container.Name == p.ContainerName { return container } } </ins> } glog.V(4).Infof("defaulting container name to %s", pod.Spec.Containers[0].Name)

expectedContainer: "bar", name:              "container in flag", }, <ins> { p:                 &AttachOptions{ContainerName: "initfoo"}, args:              []string{"foo"}, expectedPod:       "foo", expectedContainer: "initfoo", name:              "init container in flag", }, </ins> } for _, test := range tests { f, tf, codec := NewAPIFactory() tf.Client = &fake.RESTClient{

Name: "bar", }, }, <ins> InitContainers: []api.Container{ { Name: "initfoo", }, }, </ins> }, Status: api.PodStatus{ Phase: api.PodRunning,
Change:
Now elasticsearchloggingdiscovery will only look for the endpoints in kube-system namespace due to hard-coded api.NamespaceSystem value. Maybe let user to decide in which namespace elasticsearchloggingdiscovery binary will look for endpoints ?

Discussion:
import ( "flag" "fmt" <ins> "os" </ins> "strings" "time"

if err != nil { glog.Fatalf("Failed to make client: %v", err) } <ins> namespace := api.NamespaceSystem envNamespace := os.Getenv("NAMESPACE") if envNamespace != "" { if _, err := c.Namespaces().Get(envNamespace); err != nil { glog.Fatalf("%s namespace doesn't exist: %v", envNamespace, err) } namespace = envNamespace } </ins> var elasticsearch *api.Service // Look for endpoints associated with the Elasticsearch loggging service. // First wait for the service to become available. for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) { <del> elasticsearch, err = c.Services(api.NamespaceSystem).Get("elasticsearch-logging") </del> <ins> elasticsearch, err = c.Services(namespace).Get("elasticsearch-logging") </ins> if err == nil { break }

// Wait for some endpoints. count := 0 for t := time.Now(); time.Since(t) < 5*time.Minute; time.Sleep(10 * time.Second) { <del> endpoints, err = c.Endpoints(api.NamespaceSystem).Get("elasticsearch-logging") </del> <ins> endpoints, err = c.Endpoints(namespace).Get("elasticsearch-logging") </ins> if err != nil { continue }