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

Allow setting content-type in command #6114

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Conversation

linxiulei
Copy link
Contributor

@linxiulei linxiulei commented Sep 15, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Allow setting content-type in command line, which might be preferable for some users to use protobuf than json

Special notes for your reviewer:

Does this PR introduce a user-facing change

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md

New command line option `--kube-api-content-type`  is added to specify content type to communicate with apiserver. This option also changes default content type from "application/json" to "application/vnd.kubernetes.protobuf"

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 15, 2023
@linxiulei
Copy link
Contributor Author

/assign @x13n

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 15, 2023
@x13n
Copy link
Member

x13n commented Sep 18, 2023

I think it should be possible already to set content type through kubeconfig: https://github.com/kubernetes/client-go/blob/master/rest/config.go#L290 Isn't this sufficient?

@linxiulei
Copy link
Contributor Author

I think it should be possible already to set content type through kubeconfig: https://github.com/kubernetes/client-go/blob/master/rest/config.go#L290 Isn't this sufficient?

unfortunnately, kubeconfig is parsed with this Config type: https://github.com/kubernetes/client-go/blob/master/tools/clientcmd/api/types.go#L31, which has no content type field

@x13n
Copy link
Member

x13n commented Sep 19, 2023

/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 Sep 19, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: linxiulei, x13n

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 Sep 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit f9a7c7f into kubernetes:master Sep 19, 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. area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants