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 componentconfig ClientConnectionConfiguration to k8s.io/apimachinery/pkg/apis/config #66058

Merged
merged 4 commits into from Aug 5, 2018

Conversation

hanxiaoshuai
Copy link
Contributor

@hanxiaoshuai hanxiaoshuai commented Jul 11, 2018

What this PR does / why we need it:
ref #2354
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:
ClientConnectionConfiguration now is used by KubeSchedulerConfiguration in pkg/apis/componentconfig, when KubeSchedulerConfiguration is moved to staging, ClientConnectionConfiguration should be cleaned up in pkg/apis/componentconfig.
Release note:

NONE

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-none Denotes a PR that doesn't merit a release note. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 11, 2018
@k8s-ci-robot k8s-ci-robot requested review from gmarek and ncdc July 11, 2018 08:16
@nikhita
Copy link
Member

nikhita commented Jul 11, 2018

/cc @luxas @sttts

@k8s-ci-robot k8s-ci-robot requested review from luxas and sttts July 11, 2018 08:21
@hanxiaoshuai hanxiaoshuai force-pushed the machcfg branch 4 times, most recently from 004c55c to 3bb8f03 Compare July 11, 2018 10:57
@hanxiaoshuai
Copy link
Contributor Author

/hold

@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 Jul 11, 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!
Some notes: I'd expect some defaulting funcs for v1alpha1. Also, an OWNERS file should be created as in the KEP.

@luxas
Copy link
Member

luxas commented Jul 11, 2018

@rosti FYI

@hanxiaoshuai hanxiaoshuai force-pushed the machcfg branch 2 times, most recently from 7eb0a18 to ccca459 Compare July 12, 2018 08:17
@hanxiaoshuai
Copy link
Contributor Author

/test pull-kubernetes-bazel-test

@hanxiaoshuai
Copy link
Contributor Author

@luxas Done, Thanks for your review
/assign @sttts @luxas

@hanxiaoshuai
Copy link
Contributor Author

/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 Jul 12, 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.

LGTM after api-approvers / reviewers are added to the OWNERS file, the KEP is merged and e.g. @thockin and @sttts have also LGTM'd this

@luxas
Copy link
Member

luxas commented Jul 12, 2018

/assign @thockin

@@ -473,6 +473,7 @@ staging/src/k8s.io/apimachinery/pkg/api/testing/fuzzer
staging/src/k8s.io/apimachinery/pkg/api/testing/roundtrip
staging/src/k8s.io/apimachinery/pkg/api/validation
staging/src/k8s.io/apimachinery/pkg/api/validation/path
staging/src/k8s.io/apimachinery/pkg/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.

what does it take to fix golint for that package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because of the file register.go in the package

@sttts
Copy link
Contributor

sttts commented Jul 27, 2018

For a move it has surprisingly few removed lines of code.

@sttts
Copy link
Contributor

sttts commented Jul 27, 2018

Same here: let's create the follow-up PR which uses this. Then we see whether the approach works. Duplicating code before the cleanup at the horizon is not a good idea.

/hold

@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 Jul 27, 2018
@luxas
Copy link
Member

luxas commented Jul 30, 2018

@sttts The PR that cleans this up/moves the usage is here: #66722.
I prefer having clean PRs like this so that one PR adds the net-new code and one PR cleans stuff up later if that is ok by you.
/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 Jul 30, 2018
limitations under the License.
*/

package config
Copy link
Member

Choose a reason for hiding this comment

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

Is this the best possible name for this package? Should it be client or clientconfig or something? "config" is REALLY nondescript.

Copy link
Member

Choose a reason for hiding this comment

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

The package is generic and may hold any generic componentconfig type. I think config is the best we can do here. We may always rename later before going beta with the package structure

@luxas
Copy link
Member

luxas commented Aug 4, 2018

Can we please get a top-level approval of this to get the ball rolling so we can then cleanup the types (PR #66722) ASAP, and unblock the components' types moving (e.g. #66916).

We can always change the structure later if we feel we need to, before going beta with this, but if this is gonna be stuck forever we have no chance improving anything.

@luxas
Copy link
Member

luxas commented Aug 4, 2018

/retest

@jbeda
Copy link
Contributor

jbeda commented Aug 5, 2018

This looks like a reasonable first step so approving to get it moving.

/approve

@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 5, 2018
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel comment for consistent failures.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 5, 2018
Copy link
Contributor

@stewart-yu stewart-yu left a comment

Choose a reason for hiding this comment

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

some nil may be need to fix
and rebase auto-generated commit log. other than LGTM to me

// ClientConnectionConfiguration contains details for constructing a client.
type ClientConnectionConfiguration struct {
// kubeConfigFile is the path to a kubeconfig file.
KubeConfigFile string `json:"kubeconfig"`
Copy link
Contributor

Choose a reason for hiding this comment

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

should be Capital ???
The same in others place

Copy link
Member

Choose a reason for hiding this comment

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

this maybe should be kubeConfigFile, but let's leave this as-is for now.


// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config
// +k8s:defaulter-gen=TypeMeta
Copy link
Contributor

Choose a reason for hiding this comment

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

should remove defaulter-gen?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe, but this is ok for now, follows the pattern for everything else

@stewart-yu
Copy link
Contributor

image
can not agree more

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.

/lgtm

Thanks @hanxiaoshuai and @jbeda!

kruntime "k8s.io/apimachinery/pkg/runtime"
)

func addDefaultingFuncs(scheme *kruntime.Scheme) error {
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 something we will discuss if we're actually gonna do, but for now this is ok


func SetDefaults_ClientConnectionConfiguration(obj *ClientConnectionConfiguration) {
if len(obj.ContentType) == 0 {
obj.ContentType = "application/vnd.kubernetes.protobuf"
Copy link
Member

Choose a reason for hiding this comment

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

We might wanna expose these values as constants in the future.


// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config
// +k8s:defaulter-gen=TypeMeta
Copy link
Member

Choose a reason for hiding this comment

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

Maybe, but this is ok for now, follows the pattern for everything else

// ClientConnectionConfiguration contains details for constructing a client.
type ClientConnectionConfiguration struct {
// kubeConfigFile is the path to a kubeconfig file.
KubeConfigFile string `json:"kubeconfig"`
Copy link
Member

Choose a reason for hiding this comment

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

this maybe should be kubeConfigFile, but let's leave this as-is for now.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hanxiaoshuai, jbeda, luxas

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-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 774fe16 into kubernetes:master Aug 5, 2018
k8s-github-robot pushed a commit that referenced this pull request Aug 15, 2018
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove references to the structs that have moved to their own packages

**What this PR does / why we need it**:
Follows-up #66058 and  #66059 to remove the structs that now aren't needed in `pkg/apis/componentconfig`

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref kubernetes/community#2354

**Special notes for your reviewer**:

This PR depends on:
 - [x] #67090
 - [x] #67149
 - [x] #67159
 - [x] #67207

**Only review commit 'Remove references to the structs that have moved to their own packages' please**

**Release note**:

```release-note
NONE
```
/kind cleanup
/assign @sttts @thockin @jbeda @liggitt
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants