jiebi/CodeConvo huggingface dataset:
Change:
GCP uses IP addresses, which is shown on an extra line. AWS does not give an IP address. We should show it. GCP: AWS: I'd like to try to do this work.
cc
AWS uses hostnames for load balancers which is why they aren't showing up. The hostname is also pretty long, and I know we've had problems with the width of the kubectl output before. That said, I seem to recall a "--wide" option, and I think you can maybe choose which columns appear? I think it is a useful suggestion, and I think your biggest battle will be to keep the number of columns such that it doesn't normally wrap. Just so you know, I normally do to see the AWS ELB hostname.
Duping this into , we also have an lgtm'd pr out

Discussion:
The IP address in the `EXTERNAL_IP` column is the one that is available on the public internet.  The `CLUSTER_IP` is only available inside your cluster/private cloud network. <ins> Note that on AWS, type `LoadBalancer` creates an ELB, which uses a (long) hostname, not an IP.  It's too long to fit in the standard `kubectl get svc` output, in fact, so you'll need to do `kubectl describe service nginxsvc` to see it.  You'll see something like this: ``` > kubectl describe service nginxsvc ... LoadBalancer Ingress:   a320587ffd19711e5a37606cf4a74574-1142138393.us-east-1.elb.amazonaws.com ... ``` </ins> ## What's next? [Learn about more Kubernetes features that will help you run containers reliably in production.](production-pods.md)

In order to access your nginx landing page, you also have to make sure that traffic from external IPs is allowed. Do this by opening a [firewall to allow traffic on port 80](services-firewalls.md). <ins> If you're running on AWS, Kubernetes creates an ELB for you.  ELBs use host names, not IPs, so you will have to do `kubectl describe svc my-nginx` and look for the `LoadBalancer Ingress` host name.  Traffic from external IPs is allowed automatically. </ins> ## Killing the application To kill the application and delete its containers and public IP address, do:
Change:
We sorta fixed this-- now it's a real status error, but we left the status code 500, so it still produces stack traces and potentially confuses clients. we should figure out the correct status code.
I think there is a lot more going on related to this in . Clients are re-listing after the error but not rewatching.
/sub
It turned out this was not causing job e2e flakes. Just sending 500s that were confusing. So lowering priority.
How about a NewBadRequest error?
that certainly sounds like an improvement.

Discussion:
"strconv" "sync" <ins> "k8s.io/kubernetes/pkg/api/errors" </ins> "k8s.io/kubernetes/pkg/api/meta" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/runtime"

return result, nil } if resourceVersion < oldest { <del> return nil, fmt.Errorf("too old resource version: %d (%d)", resourceVersion, oldest) </del> <ins> return nil, errors.NewInternalError(fmt.Errorf("too old resource version: %d (%d)", resourceVersion, oldest)) </ins> } // Binary seatch the smallest index at which resourceVersion is not smaller than

"testing" "k8s.io/kubernetes/pkg/api" <ins> "k8s.io/kubernetes/pkg/api/errors" </ins> "k8s.io/kubernetes/pkg/api/unversioned" "k8s.io/kubernetes/pkg/client/cache" "k8s.io/kubernetes/pkg/runtime"

if err == nil { t.Errorf("expected error too old") } <ins> if _, ok := err.(*errors.StatusError); !ok { t.Errorf("expected error to be of type StatusError") } </ins> } { result, err := store.GetAllEventsSince(2)
Change:
We sorta fixed this-- now it's a real status error, but we left the status code 500, so it still produces stack traces and potentially confuses clients. we should figure out the correct status code.
I think there is a lot more going on related to this in . Clients are re-listing after the error but not rewatching.
/sub
It turned out this was not causing job e2e flakes. Just sending 500s that were confusing. So lowering priority.
How about a NewBadRequest error?
that certainly sounds like an improvement.

Discussion:
* * If updating an existing resource: * See `Conflict` from the `status` response section below on how to retrieve more information about the nature of the conflict. * GET and compare the fields in the pre-existing object, merge changes (if still valid according to preconditions), and retry with the updated request (including `ResourceVersion`). <ins> * `410 StatusGone` * Indicates that the item is no longer available at the server and no forwarding address is known. * Suggested client recovery behavior * Do not retry. Fix the request. </ins> * `422 StatusUnprocessableEntity` * Indicates that the requested create or update operation cannot be completed due to invalid data provided as part of the request. * Suggested client recovery behavior

}} } <ins> // NewGone returns an error indicating the item no longer available at the server and no forwarding address is known. func NewGone(message string) error { return &StatusError{unversioned.Status{ Status:  unversioned.StatusFailure, Code:    http.StatusGone, Reason:  unversioned.StatusReasonGone, Message: message, }} } </ins> // NewInvalid returns an error indicating the item is invalid and cannot be processed. func NewInvalid(kind, name string, errs fielderrors.ValidationErrorList) error { causes := make([]unversioned.StatusCause, 0, len(errs))

// Status code 409 StatusReasonConflict StatusReason = "Conflict" <ins> // StatusReasonGone means the item is no longer available at the server and no // forwarding address is known. // Status code 410 StatusReasonGone StatusReason = "Gone" </ins> // StatusReasonInvalid means the requested create or update operation cannot be // completed due to invalid data provided as part of the request. The client may // need to alter the request. When set, the client may use the StatusDetails

return result, nil } if resourceVersion < oldest { <del> return nil, errors.NewInternalError(fmt.Errorf("too old resource version: %d (%d)", resourceVersion, oldest)) </del> <ins> return nil, errors.NewGone(fmt.Sprintf("too old resource version: %d (%d)", resourceVersion, oldest)) </ins> } // Binary seatch the smallest index at which resourceVersion is not smaller than
Change:
cc
Has this test failed more than once, or did the two-minute timeout just happen to occur in the middle of it?
I think 2 minutes is not sufficient for the integration tests. See comment at

Discussion:
# KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1,experimental/v1alpha1"} <ins> # Give integration tests longer to run KUBE_TIMEOUT=${KUBE_TIMEOUT:--timeout 240s} </ins> KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"} LOG_LEVEL=${LOG_LEVEL:-2}

# KUBE_RACE="-race" KUBE_GOFLAGS="-tags 'integration no-docker' "  KUBE_RACE=""  <ins> KUBE_TIMEOUT="${KUBE_TIMEOUT}"  </ins> KUBE_TEST_API_VERSIONS="$1"  KUBE_API_VERSIONS="v1,experimental/v1alpha1"  "${KUBE_ROOT}/hack/test-go.sh" test/integration
Change:
I follow to create a nginx example. And I got stuck at the beginning.
I'll send a fix which will supersede .
that would be great! thanks, I just got lost handling other 1.1 stuff and forgot about that pr
Sent , PTAL. Thank you.

Discussion:
### Generate certificates <del> First generate a self signed rsa key and certificate that the server can use for TLS. </del> <ins> First generate a self signed rsa key and certificate that the server can use for TLS. This step invokes the make_secret.go script in the same directory, which uses the kubernetes api to generate a secret json config in /tmp/secret.json. </ins> ```sh $ make keys secret KEY=/tmp/nginx.key CERT=/tmp/nginx.crt SECRET=/tmp/secret.json

"k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/latest" "k8s.io/kubernetes/pkg/runtime" <ins> // This installs the legacy v1 API _ "k8s.io/kubernetes/pkg/api/install" </ins> ) // TODO:
Change:
Can we get this fixed ASAP? Thanks!
yep, thanks for reporting , Brendan Burns wrote:
how reproduceable is this? I have some changes that I think will resolve it but I couldn't reproduce locally even when all my cpu's were pretty tied up and using a high GOMAXPROCS.
flakey label process?
the labelling is due to me failing @ github's label interface. Bulk editing labels removes them if any of the selected things have the label sigh Thanks for the quick fix.

Discussion:
} func (b *errorOnce) Send(errIn <-chan error) ErrorOnce { <del> go b.forward(errIn) </del> <ins> if errIn == nil { // don't execute this in a goroutine; save resources AND the caller // likely wants this executed ASAP because some of some operation // ordering semantics. forward() will not block here on a nil input // so this is safe to do. b.forward(nil) } else { go b.forward(errIn) } </ins> return b } func (b *errorOnce) forward(errIn <-chan error) { if errIn == nil { <ins> // important: nil never blocks; Report(nil) is guaranteed to be a // non-blocking operation. </ins> b.Report(nil) return }

defer called.Done() log.Infof("deferred action invoked") if next != idx { <del> t.Fatalf("expected index %d instead of %d", idx, next) </del> <ins> t.Errorf("expected index %d instead of %d", idx, next) </ins> } next++ })

err := decorated.Do(func() { defer close(executed) if !delegated { <del> t.Fatalf("expected delegated execution") </del> <ins> t.Errorf("expected delegated execution") </ins> } }) if err == nil {

err := decorated2.Do(func() { defer close(executed) if !delegated { <del> t.Fatalf("expected delegated execution") </del> <ins> t.Errorf("expected delegated execution") </ins> } }) if err == nil {

errCh := decorated2.Do(func() { defer close(executed) if !delegated { <del> t.Fatalf("expected delegated execution") </del> <ins> t.Errorf("expected delegated execution") </ins> } errOnce.Report(expectedErr) })

<-executed t.Logf("runDelegationTest received executed signal at " + time.Now().String()) <ins> wg.Wait() t.Logf("runDelegationTest nested decorators finished at " + time.Now().String()) </ins> } func TestProc_doWithNestedX(t *testing.T) {

go func() { err, _ := <-errOnce.Err() if err != nil { <del> t.Fatalf("delegate %d: unexpected error: %v", i, err) </del> <ins> t.Errorf("delegate %d: unexpected error: %v", i, err) </ins> } }() }
Change:
When polling a k8s master with the response is an HTTP 500. But even if this selector is invalid, it should return a 4xx code instead.
Do you get 500 without the label selector? cc
No, and not with a value like "environment%3Dfoobar". But if I remove "foobar" or replace it with an url-encoded space, i.e. "environment%3D%20" or "environment%3D+" I get a 500. I suspect that the value (after the colon) is stripped of whitespace, and if the result is the empty string, this error happens.
Bumping priority to P1 since this is definitely a bug and we should fix it.
you had five days, I'm kicking you off of this & giving to Chao. :)

Discussion:
// parseExactValue parses the only value for exact match style func (p *Parser) parseExactValue() (sets.String, error) { s := sets.NewString() <del> tok, lit := p.consume(Values) </del> <ins> tok, lit := p.lookahead(Values) if tok == EndOfStringToken || tok == CommaToken { s.Insert("") return s, nil } tok, lit = p.consume(Values) </ins> if tok == IdentifierToken { s.Insert(lit) return s, nil

"x=a,y=b,z=c", "", "x!=a,y=b", <ins> "x=", "x= ", "x=,z= ", "x= ,z= ", </ins> } testBadStrings := []string{ "x=a||y=b",

if err != nil { t.Errorf("%v: error %v (%#v)n", test, err, err) } <del> if test != lq.String() { </del> <ins> if strings.Replace(test, " ", "", -1) != lq.String() { </ins> t.Errorf("%v restring gave: %vn", test, lq.String()) } }
Change:
fwiw, the time outs are way to short (100ms) please use util.ForeverTestTimeout instead.
Yes - it seems to be cause by too short timeouts. Sent out for review.

Discussion:
} return result == resourceVersion, nil } <del> return wait.Poll(10*time.Millisecond, 100*time.Millisecond, ready) </del> <ins> return wait.Poll(10*time.Millisecond, util.ForeverTestTimeout, ready) </ins> } func TestListFromMemory(t *testing.T) {

if obj := event.Object.(*api.Pod); event.Type != watch.Added || obj.ResourceVersion != "4" { t.Errorf("unexpected event: %v", event) } <del> case <-time.After(time.Millisecond * 100): </del> <ins> case <-time.After(util.ForeverTestTimeout): </ins> t.Errorf("timed out waiting for an event") } // Emit a new event and check if it is observed by the watcher.
Change:
Given a request with a Content-Type header set to , the server will respond with an error because it does not exactly match the existing strings. Some browsers (Firefox, see: ) will automatically add to a Content-Type header when making an XHR request.

Discussion:
client := http.Client{} request, err := http.NewRequest("PATCH", server.URL+"/api/version/namespaces/default/simple/"+ID, bytes.NewReader([]byte(`{"labels":{"foo":"bar"}}`))) <del> request.Header.Set("Content-Type", "application/merge-patch+json") </del> <ins> request.Header.Set("Content-Type", "application/merge-patch+json; charset=UTF-8") </ins> _, err = client.Do(request) if err != nil { t.Errorf("unexpected error: %v", err)

"net/http" "net/url" gpath "path" <ins> "strings" </ins> "time" "k8s.io/kubernetes/pkg/admission"

} func getPatchedJS(contentType string, originalJS, patchJS []byte, obj runtime.Object) ([]byte, error) { <ins> // Remove "; charset=" if included in header. if idx := strings.Index(contentType, ";"); idx > 0 { contentType = contentType[:idx] } </ins> patchType := api.PatchType(contentType) switch patchType { case api.JSONPatchType:
Change:
reports the following failure after syncing with latest code: --- FAIL: TestSetUpAtInternal (0.00s) Error Trace: Error: Not equal: "expected-to-be-set-properly" (expected) != "" (actual) FAIL FAIL 0.067s cc/
CC
Taking a look. What do you mean with failed sometimes? Is it a random failure?
Can you please provide more information. This test seems to be consistently green in our CI runs.
The test is failing on this assertion: but as you can see on the previous line I am checking that there was no error on that call. So the function is returning for the error checking but it's not setting . Only place where it can happen is here: Is the not been clean between runs?
When I said "the only place where it can happen" it was because the other s are being returned after a check. I think that there is no other way to get there.
PS: I run the test suite 100 times and I didn't get any error: (That branch is based on the branch)
can you test to see if the patch in fixes things for you?
See for reproducible test environment and failure logs.
Based on the solution in it sounds like this test creates files the first time through which causes the tests to fail on the second time through.

Discussion:
package flocker import ( <ins> "io/ioutil" "os" </ins> "testing" flockerClient "github.com/ClusterHQ/flocker-go"

const pluginName = "kubernetes.io/flocker" <del> func newInitializedVolumePlugMgr() volume.VolumePluginMgr { </del> <ins> func newInitializedVolumePlugMgr(t *testing.T) (volume.VolumePluginMgr, string) { </ins> plugMgr := volume.VolumePluginMgr{} <del> plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost("/foo/bar", nil, nil)) return plugMgr </del> <ins> dir, err := ioutil.TempDir("", "flocker") assert.NoError(t, err) plugMgr.InitPlugins(ProbeVolumePlugins(), volume.NewFakeVolumeHost(dir, nil, nil)) return plugMgr, dir </ins> } func TestGetByName(t *testing.T) { assert := assert.New(t) <del> plugMgr := newInitializedVolumePlugMgr() </del> <ins> plugMgr, _ := newInitializedVolumePlugMgr(t) </ins> plug, err := plugMgr.FindPluginByName(pluginName) assert.NotNil(plug, "Can't find the plugin by name")

func TestCanSupport(t *testing.T) { assert := assert.New(t) <del> plugMgr := newInitializedVolumePlugMgr() </del> <ins> plugMgr, _ := newInitializedVolumePlugMgr(t) </ins> plug, err := plugMgr.FindPluginByName(pluginName) assert.NoError(err)

func TestNewBuilder(t *testing.T) { assert := assert.New(t) <del> plugMgr := newInitializedVolumePlugMgr() </del> <ins> plugMgr, _ := newInitializedVolumePlugMgr(t) </ins> plug, err := plugMgr.FindPluginByName(pluginName) assert.NoError(err)

assert := assert.New(t) <del> plugMgr := newInitializedVolumePlugMgr() </del> <ins> plugMgr, rootDir := newInitializedVolumePlugMgr(t) if rootDir != "" { defer os.RemoveAll(rootDir) } </ins> plug, err := plugMgr.FindPluginByName(flockerPluginName) assert.NoError(err)
Change:
shippable flake: It seems that this test needs to retry on update failures. cc who fixed some other similar test flakes recently and might want to take a swing at this one.
cc
We discussed about it in Assigning to
Thanks . Removing team/control-plane, as team/CSI seem to have this in hand.
Aha, my PR was also hit by this flake just now. I'll try to fix this tmr.
has the same problem.

Discussion:
echo "For address ${full_address}, got ${status} but wanted ${desired}" return 1 } <ins> # TODO: Remove this function when we do the retry inside the kubectl commands. See #15333. function kubectl-with-retry() { ERROR_FILE="${KUBE_TEMP}/kubectl-error" for count in $(seq 0 3); do kubectl "$@" 2> ${ERROR_FILE} || true if grep -q "the object has been modified" "${ERROR_FILE}"; then kube::log::status "retry $1, error: $(cat ${ERROR_FILE})" rm "${ERROR_FILE}" sleep $((2**count)) else rm "${ERROR_FILE}" break fi done } </ins> kube::util::trap_add cleanup EXIT SIGINT kube::util::ensure-temp-dir

fi fi # Command <del> kubectl label -f "${file}" labeled=true "${kube_flags[@]}" </del> <ins> # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl label" # fails on some, but not all, of the resources, retries will fail because it tries to modify # existing labels. kubectl-with-retry label -f $file labeled=true --overwrite "${kube_flags[@]}" </ins> # Post-condition: mock service and mock rc (and mock2) are labeled if [ "$has_svc" = true ]; then kube::test::get_object_assert 'services mock' "{{${labels_field}.labeled}}" 'true'

fi fi # Command <del> kubectl annotate -f "${file}" annotated=true "${kube_flags[@]}" </del> <ins> # Command # We need to set --overwrite, because otherwise, if the first attempt to run "kubectl annotate" # fails on some, but not all, of the resources, retries will fail because it tries to modify # existing annotations. kubectl-with-retry annotate -f $file annotated=true --overwrite "${kube_flags[@]}" </ins> # Post-condition: mock service (and mock2) and mock rc (and mock2) are annotated if [ "$has_svc" = true ]; then kube::test::get_object_assert 'services mock' "{{${annotations_field}.annotated}}" 'true'
Change:
Forked from pointed out that all package names should be lower case, no under_scores or mixedCaps. The same rule applies to renaming imported packages. () generated a list of mixedCaps package names in our codebase: I will upload a PR later to rename kubeletTypes to kubetypes, and the rest is up for grabs.
sorry i have not saw this issue as i open a similar one(), do you mind i participate in this issue? i would happy to do some work for this. best regards.
of course, fixes are welcome. Thanks for picking up on this! We'll try to expedite the review and merge process of such PRs to avoid a lot of churns, but chances are that some rebases are needed :)
ok, i will send some fix sonner, and tag you for review. thanks again.
Not done:

Discussion:
kclient "k8s.io/kubernetes/pkg/client/unversioned" kclientcmd "k8s.io/kubernetes/pkg/client/unversioned/clientcmd" kframework "k8s.io/kubernetes/pkg/controller/framework" <del> kSelector "k8s.io/kubernetes/pkg/fields" </del> <ins> kselector "k8s.io/kubernetes/pkg/fields" </ins> etcdstorage "k8s.io/kubernetes/pkg/storage/etcd" "k8s.io/kubernetes/pkg/util" "k8s.io/kubernetes/pkg/util/wait"

// Returns a cache.ListWatch that gets all changes to services. func createServiceLW(kubeClient *kclient.Client) *kcache.ListWatch { <del> return kcache.NewListWatchFromClient(kubeClient, "services", kapi.NamespaceAll, kSelector.Everything()) </del> <ins> return kcache.NewListWatchFromClient(kubeClient, "services", kapi.NamespaceAll, kselector.Everything()) </ins> } // Returns a cache.ListWatch that gets all changes to endpoints. func createEndpointsLW(kubeClient *kclient.Client) *kcache.ListWatch { <del> return kcache.NewListWatchFromClient(kubeClient, "endpoints", kapi.NamespaceAll, kSelector.Everything()) </del> <ins> return kcache.NewListWatchFromClient(kubeClient, "endpoints", kapi.NamespaceAll, kselector.Everything()) </ins> } // Returns a cache.ListWatch that gets all changes to pods. func createEndpointsPodLW(kubeClient *kclient.Client) *kcache.ListWatch { <del> return kcache.NewListWatchFromClient(kubeClient, "pods", kapi.NamespaceAll, kSelector.Everything()) </del> <ins> return kcache.NewListWatchFromClient(kubeClient, "pods", kapi.NamespaceAll, kselector.Everything()) </ins> } func (ks *kube2sky) newService(obj interface{}) {
Change:
Forked from pointed out that all package names should be lower case, no under_scores or mixedCaps. The same rule applies to renaming imported packages. () generated a list of mixedCaps package names in our codebase: I will upload a PR later to rename kubeletTypes to kubetypes, and the rest is up for grabs.
sorry i have not saw this issue as i open a similar one(), do you mind i participate in this issue? i would happy to do some work for this. best regards.
of course, fixes are welcome. Thanks for picking up on this! We'll try to expedite the review and merge process of such PRs to avoid a lot of churns, but chances are that some rebases are needed :)
ok, i will send some fix sonner, and tag you for review. thanks again.
Not done:

Discussion:
} versionPath := pkgPath(group, version) <del> generator := pkg_runtime.NewConversionGenerator(api.Scheme.Raw(), versionPath) </del> <ins> generator := kruntime.NewConversionGenerator(api.Scheme.Raw(), versionPath) </ins> apiShort := generator.AddImport(path.Join(pkgBase, "api")) generator.AddImport(path.Join(pkgBase, "api/resource")) // TODO(wojtek-t): Change the overwrites to a flag.

_ "k8s.io/kubernetes/pkg/api/v1" _ "k8s.io/kubernetes/pkg/apis/extensions" _ "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" <del> pkg_runtime "k8s.io/kubernetes/pkg/runtime" </del> <ins> kruntime "k8s.io/kubernetes/pkg/runtime" </ins> "k8s.io/kubernetes/pkg/util/sets" "github.com/golang/glog"

} versionPath := pkgPath(group, version) <del> generator := pkg_runtime.NewDeepCopyGenerator(api.Scheme.Raw(), versionPath, sets.NewString("k8s.io/kubernetes")) </del> <ins> generator := kruntime.NewDeepCopyGenerator(api.Scheme.Raw(), versionPath, sets.NewString("k8s.io/kubernetes")) </ins> generator.AddImport(path.Join(pkgBase, "api")) if len(*overwrites) > 0 {

"os" "runtime" <del> pkg_runtime "k8s.io/kubernetes/pkg/runtime" </del> <ins> kruntime "k8s.io/kubernetes/pkg/runtime" </ins> "github.com/golang/glog" flag "github.com/spf13/pflag"

funcOut = file } <del> docsForTypes := pkg_runtime.ParseDocumentationFrom(*typeSrc) </del> <ins> docsForTypes := kruntime.ParseDocumentationFrom(*typeSrc) </ins> if *verify == true { <del> rc, err := pkg_runtime.VerifySwaggerDocsExist(docsForTypes, funcOut) </del> <ins> rc, err := kruntime.VerifySwaggerDocsExist(docsForTypes, funcOut) </ins> if err != nil { fmt.Fprintf(os.Stderr, "Error in verification process: %sn", err) }

} if docsForTypes != nil && len(docsForTypes) > 0 { <del> if err := pkg_runtime.WriteSwaggerDocFunc(docsForTypes, funcOut); err != nil { </del> <ins> if err := kruntime.WriteSwaggerDocFunc(docsForTypes, funcOut); err != nil { </ins> fmt.Fprintf(os.Stderr, "Error when writing swagger documentation functions: %sn", err) os.Exit(-1) }