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

Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy #67688

Merged
merged 4 commits into from
Aug 28, 2018
Merged

Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy #67688

merged 4 commits into from
Aug 28, 2018

Conversation

Lion-Wei
Copy link

What this PR does / why we need it:
This PR implements most of kubernetes/community#2354 for the kube-proxy.
The PR:

  • Moves k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig as-is to k8s.io/kubernetes/pkg/proxy/apis/config as agreed
  • Moves the external types to the new staging repo k8s.io/kube-proxy, in the k8s.io/kube-proxy/config/v1beta1 package.
  • Makes k8s.io/kubernetes/pkg/proxy/apis/config/v1beta1 source the types from k8s.io/kube-proxy/config/v1beta1. The defaulting and conversion code is kept in this package as before.
  • All references to these packages have been updated.

Ref #67233

Special notes for your reviewer:

Release note:

kube-proxy v1beta1 external ComponentConfig types are now available in the `k8s.io/kube-proxy` repo

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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. area/kubeadm sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/network Categorizes an issue or PR as relevant to SIG Network. labels Aug 22, 2018
Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, great work @Lion-Wei 🎉 👏!!

Quick comment on the commit structure I'd like to see:

  • Move pkg/proxy/apis/kubeproxyconfig to pkg/proxy/apis/config. All files should be moved and package names should be updated
  • Rename all references in the rest of the codebase to pkg/proxy/apis/config instead
  • Start referencing ClientConnectionConfiguration from k8s.io/apimachinery/pkg/apis/config instead of duplicating it in the package
  • Add k8s.io/kube-proxy/config, move external types there from pkg/proxy/apis/config/v1alpha1.
  • All autogenerated stuff in the last commit

Alternatively, break out the two first commits in a separate PR (move pkg/proxy/apis/{kubeproxy,}config), and the third commit (move ClientConnectionConfiguration reference) to a separate PR as well. So then we'd get two PRs first that are more scoped and hence easier to merge.

@@ -30,21 +30,13 @@ var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha
var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
Copy link
Member

Choose a reason for hiding this comment

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

remove these comments here

var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
Copy link
Member

Choose a reason for hiding this comment

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

remove these comments, only misleading

Copy link
Member

Choose a reason for hiding this comment

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

ping pls remove

@@ -16,4 +16,4 @@ limitations under the License.

// +k8s:deepcopy-gen=package

package kubeproxyconfig // import "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig"
package config // import "k8s.io/kubernetes/pkg/proxy/apis/config"
Copy link
Member

Choose a reason for hiding this comment

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

this should probably be done already in the first commit, as well as moving OWNERS and BUILD I think

@@ -0,0 +1 @@
../../staging/src/k8s.io/kube-proxy/
Copy link
Member

Choose a reason for hiding this comment

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

do this already in the first commit

@luxas luxas changed the title [wip]Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy WIP: Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy Aug 22, 2018
@@ -1,5 +1,5 @@
/*
Copyright 2015 The Kubernetes Authors.
Copyright 2018 The Kubernetes Authors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Moving and changing the existing files don't necessarily change the year here, IMO. @bgrant0607 WDYT?

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks.


package v1alpha1 // import "k8s.io/kubernetes/pkg/proxy/apis/kubeproxyconfig/v1alpha1"
package v1alpha1 // import "k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1"
Copy link
Contributor

Choose a reason for hiding this comment

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

please add the GroupName tag


// +k8s:deepcopy-gen=package

package v1alpha1 // import "k8s.io/kube-proxy/config/v1alpha1"
Copy link
Contributor

Choose a reason for hiding this comment

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

please add the GroupName tag

@sttts
Copy link
Contributor

sttts commented Aug 23, 2018

Sgtm. Some nit.

@sttts
Copy link
Contributor

sttts commented Aug 23, 2018

If the staging dir is new, don't forget the meta files like COPYRIGHT, OWNER, etc.

@luxas
Copy link
Member

luxas commented Aug 23, 2018

Additionally, the golint ignore list needs to be updated, import-boss files needs to be updated with the new location to whitelist, and a Godeps file needs to be created

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 25, 2018
@Lion-Wei
Copy link
Author

@sttts @luxas Thanks for reviewing.
I reorganized the commit for the sake of reviewing, and all previous comment are addressed. Please take another look, thanks.

@Lion-Wei Lion-Wei changed the title WIP: Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy Move kubeproxy ComponentConfig external types to k8s.io/kube-proxy Aug 25, 2018
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2018
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2018
@Lion-Wei
Copy link
Author

/test pull-kubernetes-e2e-kops-aws

Copy link
Member

@luxas luxas left a comment

Choose a reason for hiding this comment

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

/approve
Thanks a lot @Lion-Wei 👍 !!
This LGTM, except for the networking.k8s.io groupname tag error. Please fix then this is ok by me

// KubeProxyIPTablesConfiguration contains iptables-related configuration
// details for the Kubernetes proxy server.
type KubeProxyIPTablesConfiguration struct {
// masqueradeBit is the bit of the iptables fwmark space to use for SNAT if using
// the pure iptables proxy mode. Values must be within the range [0, 31].
MasqueradeBit *int32 `json:"masqueradeBit"`
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.
// masqueradeAll tells kube-proxy to SNAT everything if using the pure iptables proxy mode.cmd/kubeadm/app/apis/kubeadm/v1alpha3/conversion.go
Copy link
Member

Choose a reason for hiding this comment

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

this seems like a small copy-paste error

// +k8s:defaulter-gen=TypeMeta

// +k8s:defaulter-gen-input=../../../../../vendor/k8s.io/kube-proxy/config/v1alpha1
// +groupName=networking.k8s.io
Copy link
Member

Choose a reason for hiding this comment

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

this is not true I think, should be kubeproxy.config.k8s.io I'm pretty sure

@@ -30,21 +30,13 @@ var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha
var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
Copy link
Member

Choose a reason for hiding this comment

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

this comment can/should be removed

*/

// +k8s:deepcopy-gen=package
// +groupName=networking.k8s.io
Copy link
Member

Choose a reason for hiding this comment

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

should be kubeproxy.config.k8s.io

var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

var (
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
Copy link
Member

Choose a reason for hiding this comment

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

ping pls remove

@Lion-Wei
Copy link
Author

@luxas Thanks. Sorry about all the careless mistake. All fixed. : )
@sttts @thockin @liggitt @deads2k Please take another look, thanks.

@thockin
Copy link
Member

thockin commented Aug 28, 2018

/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 Aug 28, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Lion-Wei, luxas, thockin

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 Aug 28, 2018
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 64597, 67854, 67734, 67917, 67688). If you want to cherry-pick this change to another branch, please follow the instructions here.

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/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants