jiebi/CodeConvo huggingface dataset:
Change:
https://k8s-
See flakes on . This test needs to be quarantined until it's deflaked.
This test has been moved in the flaky suite ()
Could you please help triage and fix this test? CC
and I are looking into it...
After comparing the relevant passing and failing test logs in the Flaky suite, this appears to just be a timing issue. doesn't give the PD enough time to detach (5 min timeout). Adding above the delete allows a 10 minute detach window before deletion. This is the pattern we've used in other GCEPD tests and have yet to see similar flakes. I'll have a PR up in a bit to add the detach wait. If there's not more flakes for a week after it's merged, I'll submit a PR to pull the Flaky tag.
So I notice this happens when I upgrade a deployment that moves the pod to another node. I can pretty much recreate it at will now. Is the solution to wait 5 minutes before allowing a pod to be created after it was deleted?
After checking the log, there is something wrong at the node side when reconciler tries to unmount the device (global mount path) because there are still some references to the mount. But unmounting local mount point is successfully. Need to investigate more about this issue.

Discussion:
"strings" "time" <ins> . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" </ins> metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" <ins> "k8s.io/apimachinery/pkg/types" </ins> "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere" "k8s.io/kubernetes/test/e2e/framework" <del> . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" </del> ) func DeleteCinderVolume(name string) error {

volumeName, err := framework.CreatePDWithRetry() Expect(err).NotTo(HaveOccurred()) defer func() { <del> framework.ExpectNoError(framework.DeletePDWithRetry(volumeName)) </del> <ins> // - Get NodeName from the pod spec to which the volume is mounted. // - Force detach and delete. pod, err := f.PodClient().Get(config.Prefix+"-client", metav1.GetOptions{}) Expect(err).NotTo(HaveOccurred(), "Failed getting pod %q.", config.Prefix+"-client") detachAndDeletePDs(volumeName, []types.NodeName{types.NodeName(pod.Spec.NodeName)}) </ins> }() defer func() {
Change:
I was running an experiment to verify that Taints are correctly updated when Condition changes from Unreachable to NotReady and found out that Kubelet can't start when the docker is not running. I did an experiment on CVM and: made no op made no op - wait reverted changes to The result is following: Is this expected, or kubelet should normally start and report itself as 'NotReady'?
Thanks for reporting! kubelet shouldn't panic in this case. This is a bug, and I uploaded a PR to fix this.
We should cherry-pick the fix. On the side note, the impact of this bug at startup is limited because kubelet would fail to start if docker isn't running already.

Discussion:
} else { dv, err = ds.getDockerVersion() } <ins> if err != nil { return nil, err } </ins> apiVersion, err := semver.Parse(dv.APIVersion) if err != nil {
Change:
https://k8s- This is upgrading from the latest 1.6 branch to master.
If you're not the right person to look into this, please find someone who can.
PR changed the MakePod() call to CreatePod() instead, which I don't think is correct because TestContainerOutput() will already create the pod. what was the reason for changing it?
Hmmm although it looks like the upgrade test was failing even before then, so maybe that's just a red herring.
Actually the test started failing consistently with the same pv_util signature after 3/31, which coincides with the change to call CreatePod(). So I think yes, that is the reason for the latest failures. I will work on a change to move it back to MakePod(). However, the upgrade test in general has been failing for a while. But the signatures have been different. Here's the signature before 3/31: https://k8s-
we updated MakePod to allow passing multiple claims to pod spec. As part of review comment I addressed this change. in the previous code, pod spec has MountPath for volume set to : "/mnt", in the new code we set the mount path to "/mnt/volume1"

Discussion:
func (PersistentVolumeUpgradeTest) Name() string { return "persistent-volume-upgrade" } const ( <del> pvTestFile string = "/mnt/pv_upgrade_test" </del> <ins> pvTestFile string = "/mnt/volume1/pv_upgrade_test" </ins> pvTestData string = "keep it pv" pvWriteCmd string = "echo "" + pvTestData + "" > " + pvTestFile pvReadCmd  string = "cat " + pvTestFile

// testPod creates a pod that consumes a pv and prints it out. The output is then verified. func (t *PersistentVolumeUpgradeTest) testPod(f *framework.Framework, cmd string) { <del> pod := framework.CreatePod(f.ClientSet, f.Namespace.Name, []*v1.PersistentVolumeClaim{t.pvc}, false, cmd) </del> <ins> pod := framework.MakePod(f.Namespace.Name, []*v1.PersistentVolumeClaim{t.pvc}, false, cmd) </ins> expectedOutput := []string{pvTestData} f.TestContainerOutput("pod consumes pv", pod, 0, expectedOutput) }
Change:
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG Create/delete rolebinding kube-aggregator:authentication-reader in different namespace cause to the failure detail:

Discussion:
kubectl delete clusterrolebinding kube-aggregator:system:kube-aggregator > /dev/null 2>&1 || true kubectl create clusterrolebinding kube-aggregator:system:auth-delegator --clusterrole=system:auth-delegator --serviceaccount=kube-public:kube-aggregator kubectl create clusterrolebinding kube-aggregator:system:kube-aggregator --clusterrole=system:kube-aggregator --serviceaccount=kube-public:kube-aggregator <del> kubectl delete rolebinding kube-aggregator:authentication-reader > /dev/null 2>&1 || true </del> <ins> kubectl delete rolebinding -n kube-system kube-aggregator:authentication-reader > /dev/null 2>&1 || true </ins> kubectl create rolebinding -n kube-system kube-aggregator:authentication-reader --role=extension-apiserver-authentication-reader --serviceaccount=kube-public:kube-aggregator # make sure the resources we're about to create don't exist
Change:
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT Kubernetes version (use ): kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.5", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-03-22T00:23:49Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.5", GitCommit:"", GitTreeState:"clean", BuildDate:"2017-03-22T00:17:51Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"} What happened: kubectl get namespace $NS NAME STATUS AGE $NS Active 0y Show 0y, a kubectl get namespace $NS-o=yaml apiVersion: v1 kind: Namespace metadata: creationTimestamp: 2016-04-18T07:37:18Z shows that its almost a year old now. What you expected to happen: Show 1y or 12m, 0y is a bit confusing. How to reproduce it (as minimally and precisely as possible): Anything else we need to know:
let me take a look at it
A tiny issue in the printers, fixing it now

Discussion:
return fmt.Sprintf("%dm", minutes) } else if hours := int(d.Hours()); hours < 24 { return fmt.Sprintf("%dh", hours) <del> } else if hours < 24*364 { </del> <ins> } else if hours < 24*365 { </ins> return fmt.Sprintf("%dd", hours/24) } return fmt.Sprintf("%dy", int(d.Hours()/24/365))
Change:
<!-- Thanks for filing an issue! Before hitting the button, please answer these questions.--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.): nginx-load-balancer-conf Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT Kubernetes version (use ): ` Environment: Cloud provider or hardware configuration: OpenStack OS (e.g. from /etc/os-release): Ubuntu 16.04.2 LTS Kernel (e.g. ): 4.4.0-71-generic -Ubuntu SMP Fri Mar 24 12:59:01 UTC 2017 x8664 x8664 x86_64 GNU/Linux Install tools: juju Others: What happened: I used the "registry" action to create docker registry inside the cluster. It modified nginx-load-balancer-conf config map. It replaced: body-size: 1024m with (incorrect): max-body-size: 1024m What you expected to happen: Expected ConfigMap to stay as it was How to reproduce it (as minimally and precisely as possible): Deploy cluster with juju and then use "registry" action to create docker registry Anything else we need to know:

Discussion:
if check_cm_response == 0: # There is an existing ConfigMap, patch it <del> patch = '{"data":{"max-body-size":"1024m"}}' </del> <ins> patch = '{"data":{"body-size":"1024m"}}' </ins> patch_cm_command = kubectl + ['patch', 'cm', cm_name, '-p', patch] patch_cm_response = call(patch_cm_command)
Change:
What we see in if any mismatches for volumes are around: The Problem: Obviously this can get pretty large. Since theres not much variability, it seems like rolling up all the orphanXYZ messages would be more useful and readable. Note this runs in the sync loop, so it happens every few (2) seconds for me. Obviously we see this worse on larger nodes (100 * n) / before but , I've only reproduced this on a local cluster for this PR.

Discussion:
} // cleanupOrphanedPodDirs removes the volumes of pods that should not be <del> // running and that have no containers running. </del> <ins> // running and that have no containers running.  Note that we roll up logs here since it runs in the main loop. </ins> func (kl *Kubelet) cleanupOrphanedPodDirs( pods []*v1.Pod, runningPods []*kubecontainer.Pod) error { allPods := sets.NewString()

if err != nil { return err } <del> errlist := []error{} </del> <ins> orphanRemovalErrors := []error{} orphanVolumeErrors := []error{} </ins> for _, uid := range found { if allPods.Has(string(uid)) { continue

// If there are still volume directories, do not delete directory volumePaths, err := kl.getPodVolumePathListFromDisk(uid) if err != nil { <del> glog.Errorf("Orphaned pod %q found, but error %v occurred during reading volume dir from disk", uid, err) </del> <ins> orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("Orphaned pod %q found, but error %v occurred during reading volume dir from disk", uid, err)) </ins> continue } if len(volumePaths) > 0 { <del> glog.Errorf("Orphaned pod %q found, but volume paths are still present on disk.", uid) </del> <ins> orphanVolumeErrors = append(orphanVolumeErrors, fmt.Errorf("Orphaned pod %q found, but volume paths are still present on disk.", uid)) </ins> continue } glog.V(3).Infof("Orphaned pod %q found, removing", uid) if err := removeall.RemoveAllOneFilesystem(kl.mounter, kl.getPodDir(uid)); err != nil { glog.Errorf("Failed to remove orphaned pod %q dir; err: %v", uid, err) <del> errlist = append(errlist, err) </del> <ins> orphanRemovalErrors = append(orphanRemovalErrors, err) } } logSpew := func(errs []error) { if len(errs) > 0 { glog.Errorf("%v : There were a total of %v errors similar to this.  Turn up verbosity to see them.", errs[0], len(errs)) for _, err := range errs { glog.V(5).Infof("Orphan pod: %v", err) } </ins> } } <del> return utilerrors.NewAggregate(errlist) </del> <ins> logSpew(orphanVolumeErrors) logSpew(orphanRemovalErrors) return utilerrors.NewAggregate(orphanRemovalErrors) </ins> }
Change:
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=true {spdy}
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=true {spdy}
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=true {spdy}
Should be fixed by
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=true {spdy}
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=true {spdy}

Discussion:
package spdy import ( <ins> "bufio" </ins> "fmt" <ins> "io" "net" </ins> "net/http" "strings" <ins> "sync/atomic" </ins> "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/runtime"

type responseUpgrader struct { } <ins> // connWrapper is used to wrap a hijacked connection and its bufio.Reader. All // calls will be handled directly by the underlying net.Conn with the exception // of Read and Close calls, which will consider data in the bufio.Reader. This // ensures that data already inside the used bufio.Reader instance is also // read. type connWrapper struct { net.Conn closed    int32 bufReader *bufio.Reader } func (w *connWrapper) Read(b []byte) (n int, err error) { if atomic.LoadInt32(&w.closed) == 1 { return 0, io.EOF } return w.bufReader.Read(b) } func (w *connWrapper) Close() error { err := w.Conn.Close() atomic.StoreInt32(&w.closed, 1) return err } </ins> // NewResponseUpgrader returns a new httpstream.ResponseUpgrader that is // capable of upgrading HTTP responses using SPDY/3.1 via the // spdystream package.

w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31) w.WriteHeader(http.StatusSwitchingProtocols) <del> conn, _, err := hijacker.Hijack() </del> <ins> conn, bufrw, err := hijacker.Hijack() </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error hijacking response: %v", err)) return nil } <del> spdyConn, err := NewServerConnection(conn, newStreamHandler) </del> <ins> connWithBuf := &connWrapper{Conn: conn, bufReader: bufrw.Reader} spdyConn, err := NewServerConnection(connWithBuf, newStreamHandler) </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error creating SPDY server connection: %v", err)) return nil
Change:
https://k8s- Failed: TestServeAttachContainer {server}
https://k8s- Failed: TestServeAttachContainer {server}
Should be fixed by

Discussion:
package spdy import ( <ins> "bufio" </ins> "fmt" <ins> "io" "net" </ins> "net/http" "strings" <ins> "sync/atomic" </ins> "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/runtime"

type responseUpgrader struct { } <ins> // connWrapper is used to wrap a hijacked connection and its bufio.Reader. All // calls will be handled directly by the underlying net.Conn with the exception // of Read and Close calls, which will consider data in the bufio.Reader. This // ensures that data already inside the used bufio.Reader instance is also // read. type connWrapper struct { net.Conn closed    int32 bufReader *bufio.Reader } func (w *connWrapper) Read(b []byte) (n int, err error) { if atomic.LoadInt32(&w.closed) == 1 { return 0, io.EOF } return w.bufReader.Read(b) } func (w *connWrapper) Close() error { err := w.Conn.Close() atomic.StoreInt32(&w.closed, 1) return err } </ins> // NewResponseUpgrader returns a new httpstream.ResponseUpgrader that is // capable of upgrading HTTP responses using SPDY/3.1 via the // spdystream package.

w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31) w.WriteHeader(http.StatusSwitchingProtocols) <del> conn, _, err := hijacker.Hijack() </del> <ins> conn, bufrw, err := hijacker.Hijack() </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error hijacking response: %v", err)) return nil } <del> spdyConn, err := NewServerConnection(conn, newStreamHandler) </del> <ins> connWithBuf := &connWrapper{Conn: conn, bufReader: bufrw.Reader} spdyConn, err := NewServerConnection(connWithBuf, newStreamHandler) </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error creating SPDY server connection: %v", err)) return nil
Change:
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=false {spdy}
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=false {spdy}
Should be fixed by
https://k8s- Failed: TestRoundTripAndNewConnection/redirect=false {spdy}

Discussion:
package spdy import ( <ins> "bufio" </ins> "fmt" <ins> "io" "net" </ins> "net/http" "strings" <ins> "sync/atomic" </ins> "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/runtime"

type responseUpgrader struct { } <ins> // connWrapper is used to wrap a hijacked connection and its bufio.Reader. All // calls will be handled directly by the underlying net.Conn with the exception // of Read and Close calls, which will consider data in the bufio.Reader. This // ensures that data already inside the used bufio.Reader instance is also // read. type connWrapper struct { net.Conn closed    int32 bufReader *bufio.Reader } func (w *connWrapper) Read(b []byte) (n int, err error) { if atomic.LoadInt32(&w.closed) == 1 { return 0, io.EOF } return w.bufReader.Read(b) } func (w *connWrapper) Close() error { err := w.Conn.Close() atomic.StoreInt32(&w.closed, 1) return err } </ins> // NewResponseUpgrader returns a new httpstream.ResponseUpgrader that is // capable of upgrading HTTP responses using SPDY/3.1 via the // spdystream package.

w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31) w.WriteHeader(http.StatusSwitchingProtocols) <del> conn, _, err := hijacker.Hijack() </del> <ins> conn, bufrw, err := hijacker.Hijack() </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error hijacking response: %v", err)) return nil } <del> spdyConn, err := NewServerConnection(conn, newStreamHandler) </del> <ins> connWithBuf := &connWrapper{Conn: conn, bufReader: bufrw.Reader} spdyConn, err := NewServerConnection(connWithBuf, newStreamHandler) </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error creating SPDY server connection: %v", err)) return nil
Change:
https://k8s- Failed: TestServeExec {streaming}
Should be fixed by

Discussion:
package spdy import ( <ins> "bufio" </ins> "fmt" <ins> "io" "net" </ins> "net/http" "strings" <ins> "sync/atomic" </ins> "k8s.io/apimachinery/pkg/util/httpstream" "k8s.io/apimachinery/pkg/util/runtime"

type responseUpgrader struct { } <ins> // connWrapper is used to wrap a hijacked connection and its bufio.Reader. All // calls will be handled directly by the underlying net.Conn with the exception // of Read and Close calls, which will consider data in the bufio.Reader. This // ensures that data already inside the used bufio.Reader instance is also // read. type connWrapper struct { net.Conn closed    int32 bufReader *bufio.Reader } func (w *connWrapper) Read(b []byte) (n int, err error) { if atomic.LoadInt32(&w.closed) == 1 { return 0, io.EOF } return w.bufReader.Read(b) } func (w *connWrapper) Close() error { err := w.Conn.Close() atomic.StoreInt32(&w.closed, 1) return err } </ins> // NewResponseUpgrader returns a new httpstream.ResponseUpgrader that is // capable of upgrading HTTP responses using SPDY/3.1 via the // spdystream package.

w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31) w.WriteHeader(http.StatusSwitchingProtocols) <del> conn, _, err := hijacker.Hijack() </del> <ins> conn, bufrw, err := hijacker.Hijack() </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error hijacking response: %v", err)) return nil } <del> spdyConn, err := NewServerConnection(conn, newStreamHandler) </del> <ins> connWithBuf := &connWrapper{Conn: conn, bufReader: bufrw.Reader} spdyConn, err := NewServerConnection(connWithBuf, newStreamHandler) </ins> if err != nil { runtime.HandleError(fmt.Errorf("unable to upgrade: error creating SPDY server connection: %v", err)) return nil
Change:
https://k8s- Failed: TestTokenCreation {serviceaccount} Previous issues for this test:
https://k8s- Failed: TestTokenCreation {serviceaccount}
fixed in (same fix as , missed that there was a second test involving resource conflicts)

Discussion:
}, "new serviceaccount with no secrets with resource conflict": { ClientObjects: []runtime.Object{updatedServiceAccount(emptySecretReferences()), createdTokenSecret()}, <ins> IsAsync:       true, MaxRetries:    1, </ins> AddedServiceAccount: serviceAccount(emptySecretReferences()), ExpectedActions: []core.Action{ core.NewGetAction(schema.GroupVersionResource{Version: "v1", Resource: "serviceaccounts"}, metav1.NamespaceDefault, "default"), <ins> core.NewGetAction(schema.GroupVersionResource{Version: "v1", Resource: "serviceaccounts"}, metav1.NamespaceDefault, "default"), </ins> }, }, "updated serviceaccount with no secrets": {
Change:
close it may make kubelet crash, though the possibility is small. keep it open is just ok. And to avoid getThresholdEvents blocked for ever, stopCh should be passed in it.
Thanks for the PR!

Discussion:
}, nil } <del> func getThresholdEvents(eventfd int, eventCh chan<- int) { </del> <ins> func getThresholdEvents(eventfd int, eventCh chan<- struct{}, stopCh <-chan struct{}) { </ins> for { buf := make([]byte, 8) _, err := syscall.Read(eventfd, buf) if err != nil { return } <del> eventCh <- 0 </del> <ins> select { case eventCh <- struct{}{}: case <-stopCh: return } </ins> } } func (n *memcgThresholdNotifier) Start(stopCh <-chan struct{}) { <del> eventCh := make(chan int, 1) go getThresholdEvents(n.eventfd, eventCh) </del> <ins> eventCh := make(chan struct{}) go getThresholdEvents(n.eventfd, eventCh, stopCh) </ins> for { select { case <-stopCh:

syscall.Close(n.watchfd) syscall.Close(n.controlfd) syscall.Close(n.eventfd) <del> close(eventCh) </del> return case <-eventCh: glog.V(2).Infof("eviction: threshold crossed")
Change:
It tries to contact the api server for the discovery docs and fails because no api server is running. Could first look in its local cache if it's passed --local?
I think here has similar meaning as , it will not contact api-server to do real patch, but it will fetch the resource from api-server. What you mean look in it's local cache? to find the resource in local cache? I think you have specified the resource in your command line.
Use of --local flag should completely eliminate communication with api-server I have sent a PR which should fix this issue A command like kubectl set image --local -f busybox=busybox:1.26 -o yaml should load the local yaml file and print out the patched version (image should get updated to busybox:1.26) in yaml format on the screen. With the submitted patch such behavior is achived

Discussion:
o.Record = cmdutil.GetRecordFlag(cmd) o.ChangeCause = f.Command(cmd, false) o.PrintObject = f.PrintObject <ins> o.Local = cmdutil.GetFlagBool(cmd, "local") </ins> o.DryRun = cmdutil.GetDryRunFlag(cmd) o.Output = cmdutil.GetFlagString(cmd, "output") o.ResolveImage = f.ResolveImage

cmd := NewCmdImage(f, buf, buf) cmd.SetOutput(buf) cmd.Flags().Set("output", "name") <ins> cmd.Flags().Set("local", "true") </ins> mapper, typer := f.Object() tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}

o.Encoder = f.JSONEncoder() o.ShortOutput = cmdutil.GetFlagString(cmd, "output") == "name" o.Record = cmdutil.GetRecordFlag(cmd) <ins> o.Local = cmdutil.GetFlagBool(cmd, "local") </ins> o.ChangeCause = f.Command(cmd, false) o.PrintObject = f.PrintObject o.Cmd = cmd
Change:
New kubectl plugin loader introduced by does not check before deref'ing . This occurs if the plugins directory does not exist or the user running doesn't have permission on the plugin directory.

Discussion:
// read the base directory tree searching for plugin descriptors // fails silently (descriptors unable to be read or unmarshalled are logged but skipped) err = filepath.Walk(base, func(path string, fileInfo os.FileInfo, walkErr error) error { <del> if fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename || walkErr != nil { </del> <ins> if walkErr != nil || fileInfo.IsDir() || fileInfo.Name() != PluginDescriptorFilename { </ins> return nil }