jiebi/CodeConvo huggingface dataset:
Change:
Is this a request for help?: No What keywords did you search in Kubernetes issues before filing this one?: save-config, view-last-applied Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT <!-- If this is a BUG REPORT, please: Fill in as much of the template below as you can. If you leave out information, we can't help you as well. If this is a FEATURE REQUEST, please: Describe in detail the feature/behavior/change you'd like to see. In both cases, be ready for followup questions, and please respond in a timely manner. If we can't reproduce a bug or think a feature already exists, we might close your issue. If we're wrong, PLEASE feel free to reopen it and explain why. --Kubernetes version: Environment: Cloud provider or hardware configuration: GKE OS (e.g. from /etc/os-release): cos What happened: Create this: Then we print it: Notice that is printed as . But the saved config is correct, so it's clearly a YAML-printing error: This seems to be caused by being interpreted as a Go format code, because I also get this for other occurrences of : What you expected to happen: It should print the exact saved data. How to reproduce it (as minimally and precisely as possible): See above.
/sig cli /kind bug
/assign
/unassign Unassign since already has a PR

Discussion:
if err != nil { return err } <del> fmt.Fprintf(o.Out, string(jsonBuffer.Bytes())) </del> <ins> fmt.Fprint(o.Out, string(jsonBuffer.Bytes())) </ins> case "yaml": yamlOutput, err := yaml.JSONToYAML([]byte(str)) if err != nil { return err } <del> fmt.Fprintf(o.Out, string(yamlOutput)) </del> <ins> fmt.Fprint(o.Out, string(yamlOutput)) </ins> } }
Change:
deamonset would not schedule pod on nodes of OutofDisk state,on the other hand, in it's updateNode func, it return directly if there is no change in labels or taints of the node. That is, ds controller could not make sense when a node turn into OutofDisk state, or recover from it. Unless we restart the controller-manager component
/assign
if other conditions in func "nodeShouldRunDaemonPod" changed? say, a node does not have enough cpu or memory resource to create the pod of ds, later I delete pods on it, and it satisfy the request now, but the ds controller could not feel it
, thanks for your cases, they're reasonable to me; let me find solutions for them.

Discussion:
} } <ins> // nodeInSameCondition returns true if all effective types ("Status" is true) equals; // otherwise, returns false. func nodeInSameCondition(old []v1.NodeCondition, cur []v1.NodeCondition) bool { if len(old) == 0 && len(cur) == 0 { return true } c1map := map[v1.NodeConditionType]v1.ConditionStatus{} for _, c := range old { if c.Status == v1.ConditionTrue { c1map[c.Type] = c.Status } } for _, c := range cur { if c.Status != v1.ConditionTrue { continue } if _, found := c1map[c.Type]; !found { return false } delete(c1map, c.Type) } return len(c1map) == 0 } </ins> func (dsc *DaemonSetsController) updateNode(old, cur interface{}) { oldNode := old.(*v1.Node) curNode := cur.(*v1.Node) <del> if reflect.DeepEqual(oldNode.Labels, curNode.Labels) && reflect.DeepEqual(oldNode.Spec.Taints, curNode.Spec.Taints) { // If node labels and taints didn't change, we can ignore this update. </del> <ins> if reflect.DeepEqual(oldNode.Labels, curNode.Labels) && reflect.DeepEqual(oldNode.Spec.Taints, curNode.Spec.Taints) && nodeInSameCondition(oldNode.Status.Conditions, curNode.Status.Conditions) { // If node labels, taints and condition didn't change, we can ignore this update. </ins> return } dsList, err := dsc.dsLister.List(labels.Everything()) if err != nil { glog.V(4).Infof("Error enqueueing daemon sets: %v", err)

ds:            newDaemonSet("ds"), shouldEnqueue: true, }, <ins> { test: "Node conditions changed", oldNode: func() *v1.Node { node := newNode("node1", nil) node.Status.Conditions = []v1.NodeCondition{ {Type: v1.NodeOutOfDisk, Status: v1.ConditionTrue}, } return node }(), newNode:       newNode("node1", nil), ds:            newDaemonSet("ds"), shouldEnqueue: true, }, { test: "Node conditions not changed", oldNode: func() *v1.Node { node := newNode("node1", nil) node.Status.Conditions = []v1.NodeCondition{ {Type: v1.NodeOutOfDisk, Status: v1.ConditionTrue}, {Type: v1.NodeMemoryPressure, Status: v1.ConditionFalse}, {Type: v1.NodeDiskPressure, Status: v1.ConditionFalse}, {Type: v1.NodeNetworkUnavailable, Status: v1.ConditionFalse}, {Type: v1.NodeInodePressure, Status: v1.ConditionFalse}, } return node }(), newNode: func() *v1.Node { node := newNode("node1", nil) node.Status.Conditions = []v1.NodeCondition{ {Type: v1.NodeOutOfDisk, Status: v1.ConditionTrue}, {Type: v1.NodeInodePressure, Status: v1.ConditionFalse}, } return node }(), ds:            newDaemonSet("ds"), shouldEnqueue: false, }, </ins> } for _, c := range cases { manager, podControl, _ := newTestController()
Change:
is sent as a fix. cc It's a test failure reported by the publishing robot.
The line it fails at:
It looks like a vendor copy vs gopath copy issue.
One possible fix is removing from the vendor/ directory. I'm testing locally.
Confirmed removing from the vendor/ directory fixed the test in robot.
We need to add the "issue filer" feature to the publishing robot, we can't rely on to report robot issues everytime :P I'm just not sure how long the publishing robot will be needed (i.e., when we will get rid of the staging/ directory) so not sure whether we should invest more time on the robot.

Discussion:
{% if grains['os_family'] == 'RedHat' -%} {% set daemon_args = "" -%} {% endif -%} <del> {% if grains.etcd_servers is defined -%} {% set etcd_servers = "-etcd_servers=http://" + grains.etcd_servers + ":4001" -%} </del> <ins> {% if grains.api_servers is defined -%} {% set api_servers = "-master=http://" + grains.api_servers + ":7080" -%} </ins> {% else -%} {% set ips = salt['mine.get']('roles:kubernetes-master', 'network.ip_addrs', 'grain').values() -%} <del> {% set etcd_servers = "-etcd_servers=http://" + ips[0][0] + ":4001" -%} </del> <ins> {% set api_servers = "-master=http://" + ips[0][0] + ":7080" -%} </ins> {% endif -%} <del> DAEMON_ARGS="{{daemon_args}} {{etcd_servers}}" </del> <ins> DAEMON_ARGS="{{daemon_args}} {{api_servers}}" </ins>

network_mode: openvswitch networkInterfaceName: eth1 etcd_servers: $MASTER_IP <ins> api_servers: $MASTER_IP </ins> cloud: vagrant cloud_provider: vagrant roles:

network_mode: openvswitch node_ip: $MINION_IP etcd_servers: $MASTER_IP <ins> api_servers: $MASTER_IP </ins> networkInterfaceName: eth1 apiservers: $MASTER_IP roles:
Change:
For reasons that are not entirely clear to me, and as spotted by in , there are two functions for selecting nodes in includeNodeFromNodeList & getNodeConditionPredicate. I think includeNodeFromNodeList should use the logic in getNodeConditionPredicate
/sig network

Discussion:
"//pkg/util/metrics:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", <del> "//vendor/k8s.io/apimachinery/pkg/labels:go_default_library", </del> "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/client-go/kubernetes/typed/core/v1:go_default_library",

"github.com/golang/glog" "k8s.io/apimachinery/pkg/api/errors" <del> "k8s.io/apimachinery/pkg/labels" </del> "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" v1core "k8s.io/client-go/kubernetes/typed/core/v1"

} func (s *ServiceController) createLoadBalancer(service *v1.Service) (*v1.LoadBalancerStatus, error) { <del> nodes, err := s.nodeLister.List(labels.Everything()) </del> <ins> nodes, err := s.nodeLister.ListWithPredicate(getNodeConditionPredicate()) </ins> if err != nil { return nil, err } <del> lbNodes := []*v1.Node{} for ix := range nodes { if includeNodeFromNodeList(nodes[ix]) { lbNodes = append(lbNodes, nodes[ix]) } } </del> // - Only one protocol supported per service // - Not all cloud providers support all protocols and the next step is expected to return //   an error for unsupported protocols <del> return s.balancer.EnsureLoadBalancer(s.clusterName, service, lbNodes) </del> <ins> return s.balancer.EnsureLoadBalancer(s.clusterName, service, nodes) </ins> } // ListKeys implements the interface required by DeltaFIFO to list the keys we
Change:
as discussed via IRC my understanding is that customResource selfLink is broken. For example for resource created the selfLink is while as far as I understand it should be something like: disregard in case I'm wrong.

Discussion:
"bytes" "fmt" "net/http" <ins> "path" </ins> "sync" "sync/atomic" "time"

parameterScheme.AddGeneratedDeepCopyFuncs(metav1.GetGeneratedDeepCopyFuncs()...) parameterCodec := runtime.NewParameterCodec(parameterScheme) <ins> selfLinkPrefix := "" switch customResourceDefinition.Spec.Scope { case apiextensions.ClusterScoped: selfLinkPrefix = "/" + path.Join("apis", customResourceDefinition.Spec.Group, customResourceDefinition.Spec.Version) + "/" case apiextensions.NamespaceScoped: selfLinkPrefix = "/" + path.Join("apis", customResourceDefinition.Spec.Group, customResourceDefinition.Spec.Version, "namespaces") + "/" } </ins> requestScope := handlers.RequestScope{ Namer: handlers.ContextBasedNaming{ GetContext: func(req *http.Request) apirequest.Context { ret, _ := r.requestContextMapper.Get(req) return ret }, <del> SelfLinker:    meta.NewAccessor(), ClusterScoped: customResourceDefinition.Spec.Scope == apiextensions.ClusterScoped, </del> <ins> SelfLinker:         meta.NewAccessor(), ClusterScoped:      customResourceDefinition.Spec.Scope == apiextensions.ClusterScoped, SelfLinkPathPrefix: selfLinkPrefix, </ins> }, ContextFunc: func(req *http.Request) apirequest.Context { ret, _ := r.requestContextMapper.Get(req)

t.Errorf("missing watch event") } } <ins> func TestSelfLink(t *testing.T) { stopCh, apiExtensionClient, clientPool, err := testserver.StartDefaultServer() if err != nil { t.Fatal(err) } defer close(stopCh) noxuDefinition := testserver.NewNoxuCustomResourceDefinition() noxuVersionClient, err := testserver.CreateNewCustomResourceDefinition(noxuDefinition, apiExtensionClient, clientPool) if err != nil { t.Fatal(err) } ns := "not-the-default" noxuNamespacedResourceClient := noxuVersionClient.Resource(&metav1.APIResource{ Name:       noxuDefinition.Spec.Names.Plural, Namespaced: true, }, ns) noxuInstanceToCreate := testserver.NewNoxuInstance(ns, "foo") createdNoxuInstance, err := noxuNamespacedResourceClient.Create(noxuInstanceToCreate) if err != nil { t.Fatal(err) } if e, a := "/apis/mygroup.example.com/v1alpha1/namespaces/not-the-default/noxus/foo", createdNoxuInstance.GetSelfLink(); e != a { t.Errorf("expected %v, got %v", e, a) } // TODO add test for cluster scoped self-link when its available } </ins>
Change:
WHAT: Bug report. See the error log below, I assume the output of iperf in my test environment has an extra newline in the value of , that is What about trim the newline in the returned value before parsing it as an integer? Especially change this line Like,
/sig network
/assign
If it's a bug, may I send a PR to fix this?
Of course. It would be best to also have a commit that adds an e2e test to replicate this issue. It is hard to tell if this is environment specific and it's odd that this has not popped up before.
I see this on an aws/coreos setup
Are you still working on this? Looks like the PR was closed.
Yes, I am still working on it and PR reopen now. BTW, I can reproduce it in my local centos setup. I wonder why k8s CI environment does not has this issue.
Please refer Do think this PR can fix this issue?
/kind bug
I'm seeing this also, running a in a Travis CI Ubuntu Trusty VM.
I never dug into the issue so I don't know.
/unassign /assign

Discussion:
// NewIPerf parses an IPerf CSV output line into an IPerfResult. func NewIPerf(csvLine string) *IPerfResult { <ins> csvLine = strings.Trim(csvLine, "n") </ins> slice := StrSlice(strings.Split(csvLine, ",")) if len(slice) != 9 { framework.Failf("Incorrect fields in the output: %v (%v out of 9)", slice, len(slice))
Change:
In our k8s cluster, a node's status is NotReady, and we checked the kubelet's log, that repeated "skipping pod synchronization" every 5 minutes: I found the code where printing those logs, in the syscLoop function. if runtimeState has error, kubelet will get into endless loop, and will print "skipping pod synchronization" every five minutes. In our case, the node got an error when startup, in the function initializeModules, which called our cloud provider to get node info, because the call returned an error, kubelet set the error to runtimeState, and ran syscLoop next, going to endless loop. I think there is a problem here: Startup function "initializeModules" encountered an error like "failed get node info", which is rarely, kubelet should exit its process and it will be restarted by systemd successfully. Restarting kubelet is more reaonable than printing error log in the endless loop, Restarting event can be mornitored easily, but the admin can hardly detect the endless loop.
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. Prevent issues from auto-closing with an comment. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten /remove-lifecycle stale
/remove-lifecycle rotten

Discussion:
if err := kl.initializeModules(); err != nil { kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.KubeletSetupFailed, err.Error()) <del> glog.Error(err) kl.runtimeState.setInitError(err) </del> <ins> glog.Fatal(err) </ins> } // Start volume manager

networkError             error internalError            error cidr                     string <del> initError                error </del> healthChecks             []*healthCheck }

return s.cidr } <del> func (s *runtimeState) setInitError(err error) { s.Lock() defer s.Unlock() s.initError = err } </del> func (s *runtimeState) runtimeErrors() []string { s.RLock() defer s.RUnlock() var ret []string <del> if s.initError != nil { ret = append(ret, s.initError.Error()) } </del> if !s.lastBaseRuntimeSync.Add(s.baseRuntimeSyncThreshold).After(time.Now()) { ret = append(ret, "container runtime is down") }
Change:
BUG REPORT Kubernetes version 2 Environment: Install tools: What happened: The code in takes care to supply the flag so it will wait on a lock to avoid interference between multiple processes modifying the table. If you read the source you discover it does this by creating a file . However, when is running in a container, is in a local filesystem, so it is not able to lock against processes running on the host or in other containers. And before you decide that the answer is to mount from the host, look at all the issues around leaking netns, e.g. Credit for pointing this out to me. Credit for pointing out locking functionality was to a few months back
Ironically, this is caused by a bugfix that moved to file-based locking. Previously, iptables would lock by reserving an abstract unix socket, which is tied to the network namespace.
Some discussion also in and following comments.
I experimented with this: but it didn't work on CoreOS, as the host wasn't using a version of iptables that used the file lock yet. Just ended up creating a directory call
I guess I should file this as an issue against kubeadm and any of the other sources of kube-proxy container config.
/assign
Should we leave this open (waiting for ... ?)
Waiting for I guess... (which I'm reviewing now)
i think this should not be marked as complete until the kubeadm fixes are in.
/reopen
/close fix in

Discussion:
component: kube-proxy spec: hostNetwork: true <ins> initContainers: - name: touch-lock image: busybox command: ['/bin/touch', '/run/xtables.lock'] securityContext: privileged: true volumeMounts: - mountPath: /run name: run readOnly: false </ins> containers: - name: kube-proxy image: {{pillar['kube_docker_registry']}}/kube-proxy:{{pillar['kube-proxy_docker_tag']}}

- mountPath: /var/lib/kube-proxy/kubeconfig name: kubeconfig readOnly: false <ins> - mountPath: /run/xtables.lock name: iptableslock readOnly: false </ins> volumes: - hostPath: path: /usr/share/ca-certificates

- hostPath: path: /var/log name: varlog <ins> - hostPath: path: /run name: run - hostPath: path: /run/xtables.lock name: iptableslock </ins>
Change:
Seen in happy to send a fix but didn't know if this might have been address with your current refactors. Output:
This looks new. I'd happily review a fix. Thanks.
Dupe of

Discussion:
"//pkg/client/informers/informers_generated/externalversions:go_default_library", "//pkg/controller:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", <ins> "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", </ins> ], )

import ( "testing" <ins> "time" </ins> metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <ins> "k8s.io/apimachinery/pkg/util/wait" </ins> certificates "k8s.io/kubernetes/pkg/apis/certificates/v1beta1" "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake" informers "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions"

} client := fake.NewSimpleClientset(csr) <del> informerFactory := informers.NewSharedInformerFactory(client, controller.NoResyncPeriodFunc()) </del> <ins> informerFactory := informers.NewSharedInformerFactory(fake.NewSimpleClientset(csr), controller.NoResyncPeriodFunc()) </ins> handler := func(csr *certificates.CertificateSigningRequest) error { csr.Status.Conditions = append(csr.Status.Conditions, certificates.CertificateSigningRequestCondition{

stopCh := make(chan struct{}) defer close(stopCh) <del> go informerFactory.Start(stopCh) </del> <ins> informerFactory.Start(stopCh) informerFactory.WaitForCacheSync(stopCh) wait.PollUntil(10*time.Millisecond, func() (bool, error) { return controller.queue.Len() >= 1, nil }, stopCh) </ins> controller.processNextWorkItem() actions := client.Actions() <del> if len(actions) != 3 { t.Errorf("expected 3 actions") </del> <ins> if len(actions) != 1 { t.Errorf("expected 1 actions") </ins> } <del> if a := actions[0]; !a.Matches("list", "certificatesigningrequests") { t.Errorf("unexpected action: %#v", a) } if a := actions[1]; !a.Matches("watch", "certificatesigningrequests") { t.Errorf("unexpected action: %#v", a) } if a := actions[2]; !a.Matches("update", "certificatesigningrequests") || </del> <ins> if a := actions[0]; !a.Matches("update", "certificatesigningrequests") || </ins> a.GetSubresource() != "approval" { t.Errorf("unexpected action: %#v", a) }
Change:
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see ): No. What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): DisruptionController getPodsForPdb Is this a BUG REPORT or FEATURE REQUEST? FEATURE REQUEST in we have function return pods using . but at the end we perform a copy of the pod array that we listed with : this is not necessary cc
/assign
/kind enhancement

Discussion:
return pdbs[0] } <ins> // This function returns pods using the PodDisruptionBudget object. // IMPORTANT NOTE : the returned pods should NOT be modified. </ins> func (dc *DisruptionController) getPodsForPdb(pdb *policy.PodDisruptionBudget) ([]*v1.Pod, error) { sel, err := metav1.LabelSelectorAsSelector(pdb.Spec.Selector) if sel.Empty() {

if err != nil { return []*v1.Pod{}, err } <del> // TODO: Do we need to copy here? result := make([]*v1.Pod, 0, len(pods)) for i := range pods { result = append(result, &(*pods[i])) } return result, nil </del> <ins> return pods, nil </ins> } func (dc *DisruptionController) worker() {
Change:
<!-- Thanks for filing an issue! Before hitting the button, please answer these questions.--Is this a request for help?: Yes What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): cni binaries, cni vendorDirPrefix Is this a BUG REPORT or FEATURE REQUEST? : feature What happened: Inconsistent find-path priority order for cni binaries in CNI: The priority order is vendor dir bin dir The priority order is bin dir vendor dir What you expected to happen: It would be better if this behavior is consistent. Most probably, vendor dir bin dir makes more sense. /cc:
Issues go stale after 90d of inactivity. Mark the issue as fresh with . Stale issues rot after an additional 30d of inactivity and eventually close. Prevent issues from auto-closing with an comment. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle stale
Stale issues rot after 30d of inactivity. Mark the issue as fresh with . Rotten issues close after an additional 30d of inactivity. If this issue is safe to close now please do so with . Send feedback to sig-testing, kubernetes/test-infra and/or . /lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity. Reopen the issue with . Mark the issue as fresh with . Send feedback to sig-testing, kubernetes/test-infra and/or . /close

Discussion:
// Search for vendor-specific plugins as well as default plugins in the CNI codebase. vendorDir := vendorCNIDir(vendorCNIDirPrefix, confType) cninet := &libcni.CNIConfig{ <del> Path: []string{binDir, vendorDir}, </del> <ins> Path: []string{vendorDir, binDir}, </ins> } network := &cniNetwork{name: confList.Name, NetworkConfig: confList, CNIConfig: cninet} return network, nil