Thanks to visit codestin.com
Credit goes to github.com

Skip to content

WIP:kubelet: support multi-headers when getting pod from HTTP source #38089

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

Conversation

chentao1596
Copy link

@chentao1596 chentao1596 commented Dec 5, 2016

What this PR does / why we need it:
Only support one header parameter when getting pod from HTTP source, it's not work very well when server need multi header parameters.
1,Add one run parameter for kubelet: "manifest-url-headers" - to be used to supporting more than one HTTP header
2,Commit some auto-generated codes

Release note:

kubelet: `--manifest-url-header` can now be specified multiple times, to set multiple custom headers when getting pods from an HTTP source

@k8s-ci-robot
Copy link
Contributor

Can a kubernetes member verify that this patch is reasonable to test? If so, please reply with "@k8s-bot ok to test" on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands will still work. Regular contributors should join the org to skip this step.

If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 5, 2016
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Dec 5, 2016
@chentao1596 chentao1596 changed the title add --manifest-url-headers kubelet: support multi-headers when getting pod from HTTP source Dec 5, 2016
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from 5b0d858 to 31b8ba9 Compare December 5, 2016 08:05
@@ -98,6 +98,8 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) {
fs.DurationVar(&s.HTTPCheckFrequency.Duration, "http-check-frequency", s.HTTPCheckFrequency.Duration, "Duration between checking http for new data")
fs.StringVar(&s.ManifestURL, "manifest-url", s.ManifestURL, "URL for accessing the container manifest")
fs.StringVar(&s.ManifestURLHeader, "manifest-url-header", s.ManifestURLHeader, "HTTP header to use when accessing the manifest URL, with the key separated from the value with a ':', as in 'key:value'")
fs.MarkDeprecated("manifest-url-header", "Use --manifest-url-headers instead. Will be removed in a future version.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use string array var and specify multiple times. We don't want to use stringslicevar with data that could contain commas

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, you can make the existing arg a string array var, repeat it if needed and avoid depreciation altogether

@vishh
Copy link
Contributor

vishh commented Dec 5, 2016

Why is this change necessary?

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

Once you've signed, please reply here (e.g. "I signed it!") and we'll verify. Thanks.


If you have questions or suggestions related to this bot's behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. and removed cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 6, 2016
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from 2967273 to 7778777 Compare December 6, 2016 06:24
@chentao1596
Copy link
Author

@liggitt I changed the type of "--manifest-url-header" to "stringArray", i think you are right: using exist param is better, rather than adding the other one. PTAL, thx!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Dec 6, 2016
@chentao1596
Copy link
Author

@vishh hi, my HTTP server need multi headers when getting pods from it, but kubelet just support one until now. In this case, i must change implemention of HTTP server to get used to it, it's not very convenient, so i think it's better if support multi headers, thx!

@yujuhong
Copy link
Contributor

yujuhong commented Dec 6, 2016

Please remove the k8s release note that's not relevant to this PR in #38089 (comment)

@@ -254,7 +254,7 @@ func autoConvert_v1alpha1_KubeletConfiguration_To_componentconfig_KubeletConfigu
out.FileCheckFrequency = in.FileCheckFrequency
out.HTTPCheckFrequency = in.HTTPCheckFrequency
out.ManifestURL = in.ManifestURL
out.ManifestURLHeader = in.ManifestURLHeader
out.ManifestURLHeader = *(*[]string)(unsafe.Pointer(&in.ManifestURLHeader))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this cast necessary?

@@ -169,7 +169,13 @@ func DeepCopy_v1alpha1_KubeletConfiguration(in interface{}, out interface{}, c *
out.FileCheckFrequency = in.FileCheckFrequency
out.HTTPCheckFrequency = in.HTTPCheckFrequency
out.ManifestURL = in.ManifestURL
out.ManifestURLHeader = in.ManifestURLHeader
if in.ManifestURLHeader != nil {
in, out := &in.ManifestURLHeader, &out.ManifestURLHeader

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to use pointers here

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2016
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from 7778777 to 658a3ac Compare December 7, 2016 03:50
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 7, 2016
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from 9495484 to a7fd07e Compare December 7, 2016 04:21
@chentao1596
Copy link
Author

@timstclair This code was generated by the script "hack/update-codecgen.sh", i should not to edit them, whether my understanding is right?thank you!

@chentao1596
Copy link
Author

@yujuhong I removed it, thank you!

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 21, 2017
@k8s-github-robot k8s-github-robot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Sep 21, 2017
@k8s-ci-robot k8s-ci-robot removed the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 21, 2017
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://github.com/kubernetes/kubernetes/wiki/CLA-FAQ to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please email the CNCF helpdesk: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Sep 21, 2017
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from f453b5a to 4623204 Compare September 21, 2017 10:21
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Sep 21, 2017
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from bdc3aaa to d268f5a Compare September 21, 2017 10:24
@chentao1596
Copy link
Author

@liggitt
I am sorry for this delay.
Files has been generated, and my code has been rebased to the latest version, thank you!

@liggitt
Copy link
Member

liggitt commented Sep 25, 2017

/ok-to-test

LGTM, cc @kubernetes/sig-node-api-reviews @mtaufen for kubelet config change

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Sep 25, 2017
@chentao1596 chentao1596 force-pushed the support-multi-manifest-url-headers branch from 2677190 to 9ad425b Compare September 28, 2017 03:08
@k8s-ci-robot
Copy link
Contributor

@chentao1596: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
Jenkins CRI GCE Node e2e a8e883cace7c08342db820a8d75e9fc4dd828158 link @k8s-bot cri node e2e test this
Jenkins GKE smoke e2e 8155ab4bd3aee719eef0d9d437a3f8c9e451fd75 link @k8s-bot cvm gke e2e test this
Jenkins GCI GKE smoke e2e 8155ab4bd3aee719eef0d9d437a3f8c9e451fd75 link @k8s-bot gci gke e2e test this
pull-kubernetes-unit 9ad425b link /test pull-kubernetes-unit
pull-kubernetes-e2e-gce-bazel 9ad425b link /test pull-kubernetes-e2e-gce-bazel
pull-kubernetes-bazel-test 9ad425b link /test pull-kubernetes-bazel-test
pull-kubernetes-e2e-gce-etcd3 9ad425b link /test pull-kubernetes-e2e-gce-etcd3

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@chentao1596 chentao1596 changed the title kubelet: support multi-headers when getting pod from HTTP source WIP:kubelet: support multi-headers when getting pod from HTTP source Oct 14, 2017
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2017
@k8s-github-robot
Copy link

@chentao1596 PR needs rebase

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 3, 2017
@k8s-github-robot
Copy link

This PR hasn't been active in 60 days. It will be closed in 29 days (Dec 27, 2017).

cc @chentao1596 @dchen1107 @liggitt @vishh

You can add 'keep-open' label to prevent this from happening, or add a comment to keep it open another 90 days

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 25, 2018
@mtaufen
Copy link
Contributor

mtaufen commented Feb 26, 2018

closing this, as equivalent work was completed in #54643 and #55254

@mtaufen mtaufen closed this Feb 26, 2018
@chentao1596 chentao1596 deleted the support-multi-manifest-url-headers branch March 13, 2018 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.