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

Fixes bug when extra params added to discovery content-type #117571

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

seans3
Copy link
Contributor

@seans3 seans3 commented Apr 25, 2023

  • Makes returned content-type discovery version checks resilient to extra content-type parameters.
  • Adds unit test for new functions. Current unit test coverage for k8s.io/client-go/discovery package: 86.9%
  • Fixes issue where discovery content-type is not recognized by client when proxies add extra parameters to the returned content-type. In the following example, a proxy adds the charset=utf-8 content-type parameter to discovery v1 response.
Content-Type: application/json; charset=utf-8

/kind bug

Fixes #117562

Fixes a 1.26 regression in client-go discovery causing a spurious "Unknown discovery response content-type" error in client-go discovery requests

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. 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 Apr 25, 2023
@seans3
Copy link
Contributor Author

seans3 commented Apr 25, 2023

/sig api-machinery
/priority important-soon

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 25, 2023
@seans3
Copy link
Contributor Author

seans3 commented Apr 25, 2023

/assign @apelisse

@seans3 seans3 force-pushed the agg-discovery-fix branch 3 times, most recently from f5ce8bb to 4728b6f Compare April 25, 2023 19:52
@seans3
Copy link
Contributor Author

seans3 commented Apr 25, 2023

/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 Apr 25, 2023
@seans3 seans3 changed the title Refactors discovery content-type and helper functions Fixes bug when extra params added to discovery content-type Apr 25, 2023
@apelisse
Copy link
Member

Great comments from Jordan, looks good to me now.
/lgtm
/approve

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

LGTM label has been added.

Git tree hash: 987e76a80a30f5b30d2cd668077077107a0ff2ff

@liggitt
Copy link
Member

liggitt commented Apr 26, 2023

/approve
/hold for one suggested clarification, @apelisse can lgtm and unhold once that's pushed

once merged, open a cherry-pick to release branches (at least 1.27, maybe 1.26... not sure when this merged initially)

@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 Apr 26, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: apelisse, liggitt, seans3

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Apr 26, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 26, 2023
@apelisse
Copy link
Member

/lgtm

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

LGTM label has been added.

Git tree hash: da549b73175fec4c72fe71b098c76e32ac523cd1

@liggitt
Copy link
Member

liggitt commented Apr 26, 2023

/hold cancel

@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 Apr 26, 2023
@k8s-ci-robot k8s-ci-robot merged commit c5c2806 into kubernetes:master Apr 26, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Apr 26, 2023
k8s-ci-robot added a commit that referenced this pull request Apr 27, 2023
…71-origin-release-1.26

Automated cherry pick of #117571: Refactors discovery content-type and helper functions
k8s-ci-robot added a commit that referenced this pull request Apr 27, 2023
…71-origin-release-1.27

Automated cherry pick of #117571: Refactors discovery content-type and helper functions
@liggitt liggitt added the kind/regression Categorizes issue or PR as related to a regression from a prior release. label Sep 10, 2023
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. 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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. 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. 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.

client-go/kubectl rejects discovery API responses with charset encoding info
4 participants