jiebi/CodeConvo huggingface dataset:
Change:
We need to write e2e tests which combines horizontal pod autoscaling with deployments (scale sub-resourcer should point to a deployment object). The tests should be similar to The library from should be extended and allow creation of a resource consumer as a deployment (currently it is always replication controller). The new tests should create a deployment resource consumer and pass a scale-sub-resource to the deployment to autoscaler.
part of
/cc
/cc FYI requests have been made to verify behavior at scale on *this.
Yeah that sounds like a good test to run re: scale out to n node cc also

Discussion:
: ${KUBE_GCE_INSTANCE_PREFIX:="e2e-autoscaling"} : ${PROJECT:="k8s-jnks-e2e-gce-autoscaling"} : ${FAIL_ON_GCP_RESOURCE_LEAK:="true"} <ins> : ${ENABLE_DEPLOYMENTS:=true} </ins> # Override GCE default for cluster size autoscaling purposes. ENABLE_CLUSTER_MONITORING="googleinfluxdb" ADMISSION_CONTROL="NamespaceLifecycle,InitialResources,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"

titleDown := "%s should scale from 5 pods to 3 pods and from 3 to 1 (via %s, with scale resource: CPU)" // CPU tests via deployments <del> It(fmt.Sprintf(titleUp, "[Skipped]", kindDeployment), func() { </del> <ins> It(fmt.Sprintf(titleUp, "[Autoscaling Suite]", kindDeployment), func() { </ins> scaleUp("deployment", kindDeployment, rc, f) }) <del> It(fmt.Sprintf(titleDown, "[Skipped]", kindDeployment), func() { </del> <ins> It(fmt.Sprintf(titleDown, "[Autoscaling Suite]", kindDeployment), func() { </ins> scaleDown("deployment", kindDeployment, rc, f) })
Change:
Jenkins project: kubernetes-e2e-gce-autoscaling failed last couple of runs: Initial Resources [Skipped][Autoscaling Suite] should set initial resources based on historical data Expected <int64: to be ~ <int:
couple failing instances:
Re-opening. This flaked again:
status?
The test is disabled and there is no plan to enable it within next few weeks, so closing the issue and I'll back to it some time in the future.

Discussion:
"fmt" "time" <ins> influxdb "github.com/influxdb/influxdb/client" </ins> . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "k8s.io/kubernetes/pkg/api"

var _ = Describe("Initial Resources", func() { f := NewFramework("initial-resources") <del> It("[Skipped] should set initial resources based on historical data", func() { </del> <ins> It("[Skipped][Autoscaling Suite] should set initial resources based on historical data", func() { // Cleanup data in InfluxDB that left from previous tests. influxdbClient, err := getInfluxdbClient(f.Client) expectNoError(err, "failed to create influxdb client") _, err = influxdbClient.Query("drop series autoscaling.cpu.usage.2m", influxdb.Second) expectNoError(err) _, err = influxdbClient.Query("drop series autoscaling.memory.usage.2m", influxdb.Second) expectNoError(err) </ins> cpu := 100 mem := 200 for i := 0; i < 10; i++ {

return result, nil } <ins> func getInfluxdbClient(c *client.Client) (*influxdb.Client, error) { kubeMasterHttpClient, ok := c.Client.(*http.Client) if !ok { Failf("failed to get master http client") } proxyUrl := fmt.Sprintf("%s/api/v1/proxy/namespaces/%s/services/%s:api/", getMasterHost(), api.NamespaceSystem, influxdbService) config := &influxdb.ClientConfig{ Host: proxyUrl, // TODO(vishh): Infer username and pw from the Pod spec. Username:   influxdbUser, Password:   influxdbPW, Database:   influxdbDatabaseName, HttpClient: kubeMasterHttpClient, IsSecure:   true, } return influxdb.NewClient(config) } </ins> func getInfluxdbData(c *influxdb.Client, query string) (map[string]bool, error) { series, err := c.Query(query, influxdb.Second) if err != nil {

expectNoError(err) expectNoError(expectedServicesExist(c)) // TODO: Wait for all pods and services to be running. <del> kubeMasterHttpClient, ok := c.Client.(*http.Client) if !ok { Failf("failed to get master http client") } proxyUrl := fmt.Sprintf("%s/api/v1/proxy/namespaces/%s/services/%s:api/", getMasterHost(), api.NamespaceSystem, influxdbService) config := &influxdb.ClientConfig{ Host: proxyUrl, // TODO(vishh): Infer username and pw from the Pod spec. Username:   influxdbUser, Password:   influxdbPW, Database:   influxdbDatabaseName, HttpClient: kubeMasterHttpClient, IsSecure:   true, } influxdbClient, err := influxdb.NewClient(config) </del> <ins> influxdbClient, err := getInfluxdbClient(c) </ins> expectNoError(err, "failed to create influxdb client") expectedNodes, err := getAllNodesInCluster(c)
Change:
Documentation says that port number for is optional, but I've found that not to be true. It's due to the way it detects whether the disk is attached or not. also must be an IP. Refer to:
/cc
I see what you meant. Good catch. According to , the disk path contains both ip and port. So port is indeed required even for default port 3260. If you don't have a pr yet, I'll provide a fix to the doc.
I don't have a CLA in file yet, so I'll leave it up to you. Thanks.
check this out

Discussion:
import ( "strconv" <ins> "strings" </ins> "github.com/golang/glog" "k8s.io/kubernetes/pkg/api"

} lun := strconv.Itoa(iscsi.Lun) <ins> portal := portalBuilder(iscsi.TargetPortal) </ins> return &iscsiDiskBuilder{ iscsiDisk: &iscsiDisk{ podUID:  podUID, volName: spec.Name(), <del> portal:  iscsi.TargetPortal, </del> <ins> portal:  portal, </ins> iqn:     iscsi.IQN, lun:     lun, manager: manager, <del> mounter: mounter, </del> <ins> mounter: &mount.SafeFormatAndMount{mounter, exec.New()}, </ins> plugin:  plugin}, fsType:   iscsi.FSType, readOnly: readOnly,

func (c *iscsiDiskCleaner) TearDownAt(dir string) error { return diskTearDown(c.manager, *c, dir, c.mounter) } <ins> func portalBuilder(portal string) string { if !strings.Contains(portal, ":") { portal = portal + ":3260" } return portal } </ins>

t.Errorf("Expected true for builder.IsReadOnly") } } <ins> func TestPortalBuilder(t *testing.T) { if portal := portalBuilder("127.0.0.1"); portal != "127.0.0.1:3260" { t.Errorf("wrong portal: %s", portal) } if portal := portalBuilder("127.0.0.1:3260"); portal != "127.0.0.1:3260" { t.Errorf("wrong portal: %s", portal) } } </ins>
Change:
From time to time, different tests are failing with the error like this: Expected error: <*errors.errorString | 0xc20bcd3a30: { s: "Only 29 pods started out of 30", } Only 29 pods started out of 30 not to have occurred Few examples:
I didn't see this happening for ~month now. Closing this - feel free to reopen if you observe it again.

Discussion:
} if oldRunning != config.Replicas { <del> if pods, err := config.Client.Pods(api.NamespaceAll).List(labels.Everything(), fields.Everything()); err == nil { </del> <ins> // List only pods from a given replication controller. if pods, err := config.Client.Pods(api.NamespaceAll).List(label, fields.Everything()); err == nil { </ins> for _, pod := range pods.Items { <del> Logf("Pod %st%st%st%s", pod.Namespace, pod.Name, pod.Spec.NodeName, pod.DeletionTimestamp) </del> <ins> Logf("Pod %st%st%st%s", pod.Name, pod.Spec.NodeName, pod.Status.Phase, pod.DeletionTimestamp) </ins> } } else { Logf("Can't list pod debug info: %v", err)
Change:
Jenkins project kubernetes-e2e-gke-ci build: One more flakiness blocks entire submit queue.
cc/
Looking into this.
do you have a longer test trace for me? I cannot see much that could be flaky due to the tests. It just does this: start pod without-label remember NodeName delete without-label set label <some-uuid=42 on NodeName launch pod with-label and NodeSelector set to {"": nodeName, <some-uuid":42} The only idea I have is that the patch command does not work reliably (assuming that the NodeSelector support in the scheduler works and is not flaky itself):
here is the most recent failure from our Jenkins build:
thanks for the logs. This clarifies what happens: the kubelet does not know its new labels. Maybe, its node storage didn't update fast enough and there is a race with the scheduler:
This might be fixed with .

Discussion:
}) expectNoError(err) defer c.Pods(ns).Delete(labelPodName, api.NewDeleteOptions(0)) <del> expectNoError(waitForPodRunningInNamespace(c, labelPodName, ns)) </del> <ins> // check that pod got scheduled. We intentionally DO NOT check that the // pod is running because this will create a race condition with the // kubelet and the scheduler: the scheduler might have scheduled a pod // already when the kubelet does not know about its new label yet. The // kubelet will then refuse to launch the pod. expectNoError(waitForPodNotPending(c, ns, labelPodName)) </ins> labelPod, err := c.Pods(ns).Get(labelPodName) expectNoError(err) Expect(labelPod.Spec.NodeName).To(Equal(nodeName))
Change:
We have a couple fields in the API for Unix UID and GID. We should define and and use them everywhere.
Is really correct? As you pointed out, GID is an unsigned int32, isn't it?
If I recall, POSIX does not actually specify signedness and some Unixes differ on it. int64 seems like a safe superset, unless we know of any OS that uses 64 bit UID/GID ? On Oct 16, 2015 6:58 AM, "Paul Morie" wrote:
I personally don't know of one. How about you ?
int64 also has the nice property of allowing negative values without wraparound. (uidt)-1 is a thing, sadly, and (uidt)-2 is apparently a thing, too. , Paul Morie wrote:
Okay, you've got me on the fence.
I will change and will change when he's back from PTO.
We might want to talk through the effects of changing this on the origin policy stuff before we start doing it.
Okay, after talking to I suggest that we do the following: Change the types of and to and respectively in and Have another commit that makes the following type changes: Introduce and as has suggested in this issue Changes the types in and in applicable fields This will be easier for us to consume in our rebase of OpenShift onto Kubernetes than if we modify and before going into master. Any objections?
I don'[t object as long as the final goal is correct , Paul Morie wrote:

Discussion:
<ins> /* Copyright 2016 The Kubernetes Authors All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package types // int64 is used as a safe bet against wrap-around (uid's are general // int32) and to support uid_t -1, and -2. type UnixUserID int64 type UnixGroupID int64 </ins>
Change:
I'm running Kubernetes under Docker (following guide). I tried to set up an RC that would run a registry:2 container and attach a gitRepo volume with the SSL certs I want to use. When I run it though, I get this error: If k8s supports git repositories as volumes though, it feels like the executable should be included in the container.
k8s supports git repositories as volumes but it's an optional feature that not everyone wants, so it would not be appropriate to require/include the git executable. This is similar to how k8s supports nfs volumes, but we don't require you to run the kubelet on an os with nfs kernel support, because not everyone wants it.
Hmm. Okay, that makes sense. Would it be feasible to create tags for those containers that have git?
I think I misunderstood the request. I think it's actually reasonable to add git to hyperkube, since afaict, it's only used for single node docker. The Dockerfile is , feel free to send a pr.

Discussion:
util-linux  socat  curl  <ins> git  </ins> && DEBIAN_FRONTEND=noninteractive apt-get autoremove -y  && DEBIAN_FRONTEND=noninteractive apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Change:
When pushing, I noticed this weird issue: This is because in my auto-scaling group on AWS I have turned up the desired number of nodes from the environment variable's default. The script should allow for more without question, so the check should be = not ==.

Discussion:
if (( "${found}" == "${EXPECTED_NUM_NODES}" )) && (( "${ready}" == "${EXPECTED_NUM_NODES}")); then break <ins> elif (( "${found}" > "${EXPECTED_NUM_NODES}" )) && (( "${ready}" > "${EXPECTED_NUM_NODES}")); then echo -e "${color_red}Detected ${ready} ready nodes, found ${found} nodes out of expected ${EXPECTED_NUM_NODES}. Found more nodes than expected, your cluster may not behave correctly.${color_norm}" break </ins> else # Set the timeout to ~10minutes (40 x 15 second) to avoid timeouts for 100-node clusters. if (( attempt > 40 )); then
Change:
I set a non-exist image in rc and watch event. kubelet is supposed to throw failed pull event and actually we get failed pull event. But I noticed there is an "successfully pulled image" event.

Discussion:
err := p.client.PullImage(opts, docker.AuthConfiguration{}) if err == nil { <ins> // Sometimes PullImage failed with no error returned. exist, ierr := p.IsImagePresent(image) if ierr != nil { glog.Warningf("Failed to inspect image %s: %v", image, ierr) } if !exist { return fmt.Errorf("image pull failed for unknown error") } </ins> return nil }
Change:
Trying to get logs fails saying : But desribing the pod shows Pod Status and Container State are both :
Not sure how severe this is for the case of fluentd since it in fact logs to /var/logs, not to stdout. But it seems like a bug.
This happens with another mirror pod I created, so it isn't just fluentd.
does not seem to be related to

Discussion:
return fmt.Errorf("unable to get logs for container %q in pod %q namespace %q: unable to find pod", containerName, name, namespace) } <del> podStatus, found := kl.statusManager.GetPodStatus(pod.UID) </del> <ins> podUID := pod.UID if mirrorPod, ok := kl.podManager.GetMirrorPodByPod(pod); ok { podUID = mirrorPod.UID } podStatus, found := kl.statusManager.GetPodStatus(podUID) </ins> if !found { return fmt.Errorf("failed to get status for pod %q in namespace %q", name, namespace) }
Change:
Horizontal pod autoscaler makes decision to scale down after 1 minute from the previous scale down, although downscaleForbiddenWindow is 5 minutes. This causes flakiness of hpa e2e tests with stability checks:
CC
Found root cause: HPA was incorrectly resetting last scale time during status update when there was no rescale.
CC

Discussion:
CurrentReplicas:                 currentReplicas, DesiredReplicas:                 desiredReplicas, CurrentCPUUtilizationPercentage: currentUtilization, <ins> LastScaleTime:                   hpa.Status.LastScaleTime, </ins> } if rescale { now := unversioned.NewTime(now)
Change:
Blocking merges, P0
Looks like this e2e code hasn't changed since .
Ugh. What changed is that we moved it off teh flaky list. Perhaps wrongly so. , Stephen Milner wrote:
Ah, I see. removed a number of e2e service items from variables. Relevant here:
the test is actually still running " Services should serve identically named services in different namespaces on different load-balancers" is running green.. Saad's fix where we correctly wait for GCE operations to complete, is checked in. Closing this issue.
Looks like this test is failing forever in and
Somehow I lost this one. Will look at it ASAP , Janet Kuo wrote:
The problem is that this test depends on the api proxy which doesn't do UDP, as far as I can tell, so it could never have worked when UDP support was . I will see what I can do to rectify.
Fixed test is - it's a doozy.
I've asked oncall to move this to the head of the queue. It's hard to figure out existing flakes when the test driving them has been totally changed. I want to re-examine all flakes after tghis
is in. I am going to close a few issues and wait for reoccurence, which is to be handled P(-1)

Discussion:
"PD" "ServiceAccounts" "Networkingsshouldsfunctionsforsintra-podscommunication"  # possibly causing Ginkgo to get stuck, issue: #13485 <ins> "Services.*identicallysnamed" # error waiting for reachability, issue: #16285 </ins> ) # Tests that should not run on soak cluster.
Change:
I wanted to drop a note that I haven't forgotten about this issue. I have spent some time investigating and have yet to determine why some test runs result in the data not being forwarded correctly. I hope to resume digging into this soon, but I've got some planning tasks I need to complete first.
I have determined the root cause of this. In the test case, it: a port forwarding session, listening on a local port a TCP connection to the local port a goroutine copies data from the local port to the remote a goroutine copies data from the remote to the local port data to the TCP connection data from the TCP connection port forwarding, which results in the client streams being closed The problem is that the data written in step 3 is only to the local TCP port. There's no guarantee that the goroutine in 2.i copies the data to the remote before step 5 happens. In fact, if you reverse steps 3 () and 4 () so the write happens immediately before you close the stopChan, this test fails very quickly. I am thinking about how to fix this...
Not done yet:
Saw this again today:
- this was a different failure than this one. I've just opened for it and closing this one

Discussion:
// kubelet.PortForwarder. type fakePortForwarder struct { lock sync.Mutex <ins> // stores data expected from the stream per port expected map[uint16]string </ins> // stores data received from the stream per port received map[uint16]string // data to be sent to the stream per port

func (pf *fakePortForwarder) PortForward(name string, uid types.UID, port uint16, stream io.ReadWriteCloser) error { defer stream.Close() <del> var wg sync.WaitGroup // client -> server wg.Add(1) go func() { defer wg.Done() // copy from stream into a buffer received := new(bytes.Buffer) io.Copy(received, stream) // store the received content pf.lock.Lock() pf.received[port] = received.String() pf.lock.Unlock() }() // server -> client wg.Add(1) go func() { defer wg.Done() </del> <ins> // read from the client received := make([]byte, len(pf.expected[port])) n, err := stream.Read(received) if err != nil { return fmt.Errorf("error reading from client for port %d: %v", port, err) } if n != len(pf.expected[port]) { return fmt.Errorf("unexpected length read from client for port %d: got %d, expected %d. data=%q", port, n, len(pf.expected[port]), string(received)) } </ins> <del> // send the hardcoded data to the stream io.Copy(stream, strings.NewReader(pf.send[port])) }() </del> <ins> // store the received content pf.lock.Lock() pf.received[port] = string(received) pf.lock.Unlock() </ins> <del> wg.Wait() </del> <ins> // send the hardcoded data to the client io.Copy(stream, strings.NewReader(pf.send[port])) </ins> return nil }

func fakePortForwardServer(t *testing.T, testName string, serverSends, expectedFromClient map[uint16]string) http.HandlerFunc { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { pf := &fakePortForwarder{ <ins> expected: expectedFromClient, </ins> received: make(map[uint16]string), send:     serverSends, }
Change:
Loading returns Looking at the code is registered in the same way as which works fine. So not sure why is this broken.

Discussion:
<ins> { "swaggerVersion": "1.2", "apiVersion": "", "basePath": "https://10.10.10.10:6443", "resourcePath": "/apis", "apis": [ { "path": "/apis", "description": "get available API versions", "operations": [ { "type": "void", "method": "GET", "summary": "get available API versions", "nickname": "getAPIVersions", "parameters": [], "produces": [ "application/json" ], "consumes": [ "application/json" ] } ] } ], "models": {} } </ins>  No newline at end of file

<ins> { "swaggerVersion": "1.2", "apiVersion": "", "basePath": "https://10.10.10.10:6443", "resourcePath": "/apis/extensions", "apis": [ { "path": "/apis/extensions", "description": "get information of a group", "operations": [ { "type": "void", "method": "GET", "summary": "get information of a group", "nickname": "getAPIGroup", "parameters": [], "produces": [ "application/json" ], "consumes": [ "application/json" ] } ] } ], "models": {} } </ins>  No newline at end of file

"description": "API at /apis/extensions/v1beta1" }, { <del> "path": "/apis/extensions/", </del> <ins> "path": "/apis/extensions", </ins> "description": "get information of a group" }, {

curl -fs ${SWAGGER_API_PATH}version > ${SWAGGER_ROOT_DIR}/version.json curl -fs ${SWAGGER_API_PATH}api > ${SWAGGER_ROOT_DIR}/api.json curl -fs ${SWAGGER_API_PATH}api/v1 > ${SWAGGER_ROOT_DIR}/v1.json <ins> curl -fs ${SWAGGER_API_PATH}apis > ${SWAGGER_ROOT_DIR}/apis.json curl -fs ${SWAGGER_API_PATH}apis/extensions > ${SWAGGER_ROOT_DIR}/extensions.json </ins> curl -fs ${SWAGGER_API_PATH}apis/extensions/v1beta1 > ${SWAGGER_ROOT_DIR}/v1beta1.json kube::log::status "SUCCESS"

Versions:         expAPIVersions, PreferredVersion: unversioned.GroupVersion{GroupVersion: storageVersion, Version: apiutil.GetVersion(storageVersion)}, } <del> apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group+"/", group) </del> <ins> apiserver.AddGroupWebService(m.handlerContainer, c.APIGroupPrefix+"/"+latest.GroupOrDie("extensions").Group, group) </ins> allGroups = append(allGroups, group) apiserver.InstallServiceErrorHandler(m.handlerContainer, m.newRequestInfoResolver(), []string{expVersion.Version}) }
Change:
It appears in a recent commit (probably ) this log message was : It's printed as type and is logged every second, which is cluttering up the logs quite a bit. Is this necessary?
Sorry for the spam. I also saw this in the log and wanted to fix it. PR uploaded.
That PR works! Thanks :)

Discussion:
podsToSync = append(podsToSync, pod) } } <del> glog.V(2).Infof("SyncLoop (SYNC): %d pods", kubeletutil.FormatPodNames(podsToSync)) </del> <ins> if len(podsToSync) == 0 { break } glog.V(4).Infof("SyncLoop (SYNC): %d pods; %s", len(podsToSync), kubeletutil.FormatPodNames(podsToSync)) </ins> kl.HandlePodSyncs(podsToSync) case update := <-kl.livenessManager.Updates(): // We only care about failures (signalling container death) here.
Change:
IIUC, is expected to wait 10s before it fails when is not up (Ref ). Yet it doesn't. k8s version
/cc
Should the warning about this issue be removed from ?
Nope, it is fixed in v1.1.2(also from HEAD), still suffers in v1.1.1 to my best knowledge
v1.1.2 is the latest, right? If the problem is fixed in HEAD, then the warning about it can be removed from the doc in HEAD, right?
Oh, I see your point. The warning is specifically about version 1.1.1, and the problem remains in that version. If that is accurate then the warning should remain (although an remark that the problem is fixed in 1.1.2 would not hurt).
I had a commit for that in , yet was missing by mistake:-/ I'll add it back then.
Agreed that docs on HEAD should reflect the state on HEAD. If someone wants to look at 1.1 docs, they should do so at
oh I see now that the warning says that the issue is only in 1.1.1 and is fixed in 1.1.2. That LGTM. Thx! I guess we can close this issue now?
this issue was already closed. I generated some confusion under another issue, number , because I read the web instead of HEAD. I have closed that issue too.

Discussion:
// important when we start apiserver and controller manager at the same time. var versionStrings []string err = wait.PollImmediate(time.Second, 10*time.Second, func() (bool, error) { <del> versionStrings, err = client.ServerAPIVersions(kubeconfig) return err == nil, err </del> <ins> if versionStrings, err = client.ServerAPIVersions(kubeconfig); err == nil { return true, nil } glog.Errorf("Failed to get api versions from server: %v", err) return false, nil </ins> }) if err != nil { glog.Fatalf("Failed to get api versions from server: %v", err)