Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client-go: default user agent if empty #108772

Merged
merged 2 commits into from
Mar 18, 2022
Merged

Conversation

aojea
Copy link
Member

@aojea aojea commented Mar 17, 2022

/kind bug
/kind regression

Fixes #108726

The kubernetes clientset generates one clientset per group/version.
The defaulting of the user-agent is done per group/version, but since #105490, all clientset share the same transport, so we should default the user-agent on the global contructor.

fixes a 1.23 regression: client-go clientset was not defaulting the user agent, using the default golang agent for all the requests.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/regression Categorizes issue or PR as related to a regression from a prior release. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 17, 2022
@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

/assign @liggitt
/cc @mborsz

/hold
holding to verify that nothing is missing and all the components are using the correct user-agent

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2022
@k8s-ci-robot k8s-ci-robot added area/code-generation sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 17, 2022
@aojea aojea changed the title User agent client-go: default user agent if empty Mar 17, 2022
@leilajal
Copy link
Contributor

/assign @roycaihw
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 17, 2022
@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

/test pull-kubernetes-e2e-kind-ipv6
Kubernetes e2e suite: [sig-node] Pods Extended Pod Container lifecycle should not create extra sandbox if all containers are done expand_less

@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

/hold cancel

rep -oP 'userAgent=".*"' 0.log  | cut -d\" -f2 | sort | uniq -c | sort -nr
   1595 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:namespace-controller
    395 kubelet/v1.24.0 (linux/amd64) kubernetes/df8d5a9
    202 kube-apiserver/v1.24.0 (linux/amd64) kubernetes/df8d5a9
    152 kube-probe/1.24+
    150 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:generic-garbage-collector
    138 local-path-provisioner/v0.0.0 (linux/amd64) kubernetes/$Format
    138 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/leader-election
    136 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9/leader-election
    128 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:resourcequota-controller
     71 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-node] Probing container should *not* be restarted with a tcp:8080 liveness probe [NodeConformance] [Conformance]
     41 kindnetd/v0.0.0 (linux/amd64) kubernetes/$Format
     36 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-node] Probing container should *not* be restarted with a /healthz http liveness probe [NodeConformance] [Conformance]
     32 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/controller-discovery
     28 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/metadata-informers
     20 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-node] Probing container should *not* be restarted with a exec \
     16 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/shared-informers
     14 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:endpoint-controller
     13 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:statefulset-controller
     13 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:endpointslice-controller
     13 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-apps] StatefulSet Basic StatefulSet functionality [StatefulSetBasic] should perform canary updates and phased rolling updates of template modifications [Conformance]
      6 coredns/v0.0.0 (linux/amd64) kubernetes/$Format
      5 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9/scheduler
      4 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:root-ca-cert-publisher
      3 kube-proxy/v1.24.0 (linux/amd64) kubernetes/df8d5a9
      3 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-api-machinery] Watchers should observe add, update, and delete watch notifications on configmaps [Conformance]
      1 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9
      1 e2e.test/v1.24.0 (linux/amd64) kubernetes/df8d5a9 -- [sig-apps] ReplicationController should test the lifecycle of a ReplicationController [Conformance]

no std golang user-agent

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 17, 2022
@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

Kubernetes e2e suite: [sig-api-machinery] Aggregator Should be able to support the 1.17 Sample API Server using the current Aggregator [Conformance] expand_less
/retest

@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

@mborsz from the gce-100 performance job

$ wget https://storage.googleapis.com/sig-scalability-logs/pull-kubernetes-e2e-gce-100-performance/1504498650846334976/e2e-108772-95a39-master/kube-apiserver.log
$ grep -oP 'userAgent=".*"' kube-apiserver.log  | cut -d\" -f2 | sort | uniq -c | sort -nr
 153463 kubelet/v1.24.0 (linux/amd64) kubernetes/df8d5a9
  22142 kubectl/v1.24.0 (linux/amd64) kubernetes/df8d5a9
  16158 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:generic-garbage-collector
  15790 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:replicaset-controller
  15724 kubectl/v1.20.2 (linux/amd64) kubernetes/faecb19
  13430 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9/scheduler
  10360 clusterloader/v0.0.0 (linux/amd64) kubernetes/$Format
   9897 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:deployment-controller
   6781 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:endpointslice-controller
   3295 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:endpoint-controller
   2371 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:resourcequota-controller
   1947 kube-probe/1.24+
   1843 kube-apiserver/v1.24.0 (linux/amd64) kubernetes/df8d5a9
   1760 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9/leader-election
   1752 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/leader-election
   1716 glbc/v0.0.0 (linux/amd64) kubernetes/$Format/leader-election
   1665 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:daemon-set-controller
   1303 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/controller-discovery
   1300 node-problem-detector/v0.8.9
   1292 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:node-controller
   1280 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:namespace-controller
   1270 glbc/v0.0.0 (linux/amd64) kubernetes/$Format
   1250 kube-proxy/v1.24.0 (linux/amd64) kubernetes/df8d5a9
    988 csi-attacher/v0.0.0 (linux/amd64) kubernetes/$Format
    879 csi-provisioner/v0.0.0 (linux/amd64) kubernetes/$Format
    821 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:job-controller
    631 csi-snapshotter/v0.0.0 (linux/amd64) kubernetes/$Format
    631 csi-resizer/v0.0.0 (linux/amd64) kubernetes/$Format
    622 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:persistent-volume-binder
    349 cluster-proportional-autoscaler/v0.0.0 (linux/amd64) kubernetes/$Format
    341 Prometheus/2.25.0
    301 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:attachdetach-controller
    300 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:certificate-controller
    229 metrics-server/v0.5.2 (linux/amd64) kubernetes/93b9ddc
    213 operator/v0.0.0 (linux/amd64) kubernetes/$Format
    208 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:statefulset-controller
    201 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:ttl-controller
    200 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/shared-informers
    151 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/kube-controller-manager
    117 kubectl/v1.23.4 (linux/amd64) kubernetes/e6c093d
    113 pod_nanny/1.8.14
    112 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9
    103 coredns/v0.0.0 (linux/amd64) kubernetes/$Format
    102 kube-scheduler/v1.24.0 (linux/amd64) kubernetes/df8d5a9
    100 proxy-server/v0.0.0 (linux/amd64) kubernetes/$Format
    100 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:pvc-protection-controller
    100 Go-http-client/2.0
     62 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/metadata-informers
     58 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:pv-protection-controller
     50 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:expand-controller
     27 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:root-ca-cert-publisher
     21 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:service-account-controller
     18 snapshot-controller/v0.0.0 (linux/amd64) kubernetes/$Format
      6 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:clusterrole-aggregation-controller
      6 curl/7.69.1
      4 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:cloud-provider
      2 kube-controller-manager/v1.24.0 (linux/amd64) kubernetes/df8d5a9/system:serviceaccount:kube-system:endpointslicemirroring-controller
      1 Go-http-client/1.1
      1 curl/7.64.0

so this fixes #108726

@liggitt
Copy link
Member

liggitt commented Mar 17, 2022

    100 Go-http-client/2.0
      1 Go-http-client/1.1

I guess we do make some requests with just stock http clients

@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

    100 Go-http-client/2.0
      1 Go-http-client/1.1

I guess we do make some requests with just stock http clients

those can come from the perf-tests framework, they don't show up in kind

#108772 (comment)

and there is a strong correlation against to the ones reported in the bug

#108726 (comment)

@liggitt
Copy link
Member

liggitt commented Mar 17, 2022

/lgtm
/approve
/retest

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 17, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 17, 2022
@aojea
Copy link
Member Author

aojea commented Mar 17, 2022

🤔
Kubernetes e2e suite: [sig-node] Pods Extended Pod Container lifecycle should not create extra sandbox if all containers are done expand_less

/retest

@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit b0c435c into kubernetes:master Mar 18, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.24 milestone Mar 18, 2022
@aojea aojea mentioned this pull request Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/code-generation cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/regression Categorizes issue or PR as related to a regression from a prior release. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubelet's requests are reported as 'Go-http-client/2.0'
6 participants