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

⚠️ split the webhook builder out as a separate builder. #497

Merged
merged 2 commits into from
Jun 27, 2019

Conversation

mengqiy
Copy link
Member

@mengqiy mengqiy commented Jun 24, 2019

build.go=> controller.go + webhook.go
build_test.go=> controller_test.go + webhook_test.go

TODO: figure out if For method in webhook builder should be variadic?

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 24, 2019
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 24, 2019
@mengqiy mengqiy requested a review from droot June 24, 2019 21:34
@mengqiy mengqiy changed the title [WIP] ⚠️ split the webhook builder out as a separate builder. ⚠️ split the webhook builder out as a separate builder. Jun 25, 2019
@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 Jun 25, 2019
@mengqiy mengqiy added this to the 0.2.0 milestone Jun 25, 2019
pkg/builder/webhook.go Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Show resolved Hide resolved
@DirectXMan12
Copy link
Contributor

Need to split out conversion registration as well (in a separate PR) @droot

Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Looks good. A few minor nits.

pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved
}
}

err = conversion.CheckConvertibility(blder.mgr.GetScheme(), blder.apiType)
Copy link
Contributor

Choose a reason for hiding this comment

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

I will make a separate PR on top of this to enable conversion only when type implements convertible.

pkg/builder/webhook.go Outdated Show resolved Hide resolved
@mengqiy
Copy link
Member Author

mengqiy commented Jun 26, 2019

PTAL

Copy link
Contributor

@droot droot left a comment

Choose a reason for hiding this comment

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

Looks good to me. Minor nits (I am ok with those being done in a follow up PRs as well).

pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved
pkg/builder/webhook.go Outdated Show resolved Hide resolved

// TODO(droot): update the GoDoc for conversion.

// For takes a runtime.Object which should be a CR.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not necessarily this PR, but we should consider adding an example for this that shows in godoc. They are super useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Copy link
Member Author

Choose a reason for hiding this comment

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

@mengqiy
Copy link
Member Author

mengqiy commented Jun 27, 2019

PTAL

Mengqi Yu added 2 commits June 27, 2019 11:48
Controller builder now only build controller; while webhook builder only build webhook.
@droot droot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 27, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: mengqiy

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 merged commit bace658 into kubernetes-sigs:master Jun 27, 2019
@mengqiy mengqiy deleted the newwebhook branch June 27, 2019 20:01
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. 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.

None yet

4 participants