-
Notifications
You must be signed in to change notification settings - Fork 40.7k
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
WIP:kubelet: support multi-headers when getting pod from HTTP source #38089
Conversation
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.
|
5b0d858
to
31b8ba9
Compare
cmd/kubelet/app/options/options.go
Outdated
@@ -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.") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Why is this change necessary? |
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.
|
2967273
to
7778777
Compare
@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! |
@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! |
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)) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
7778777
to
658a3ac
Compare
9495484
to
a7fd07e
Compare
@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! |
@yujuhong I removed it, thank you! |
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.
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. |
f453b5a
to
4623204
Compare
bdc3aaa
to
d268f5a
Compare
@liggitt |
/ok-to-test LGTM, cc @kubernetes/sig-node-api-reviews @mtaufen for kubelet config change |
2677190
to
9ad425b
Compare
@chentao1596: The following tests failed, say
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 PR needs rebase |
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 |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
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: