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

kube-aggregator: split openapi spec aggregator from controller code #73953

Merged
merged 4 commits into from Feb 13, 2019

Conversation

@sttts
Copy link
Contributor

sttts commented Feb 12, 2019

Untangle the actual merge logic and the aggregator openapi spec state from the controller logic. Simplifies the code.

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 12, 2019

@sttts: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

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.

@sttts sttts force-pushed the sttts:sttts-simplify-kube-aggregator-openapi branch from 5d288ea to f132254 Feb 12, 2019

var _ SpecAggregator = &specAggregator{}

// This function is not thread safe as it only being called on startup.
func (s *specAggregator) addLocalSpec(spec *spec.Swagger, localHandler http.Handler, name, etag string) {

This comment has been minimized.

@mfojtik

mfojtik Feb 12, 2019

Contributor

can we add s. addLocalSpecCalled = true and then panic when this function is called again?

This comment has been minimized.

@mfojtik

mfojtik Feb 12, 2019

Contributor

or rename this to addLocalSpecOnce ?

This comment has been minimized.

@sttts

sttts Feb 12, 2019

Author Contributor

Why?

It's only called from the speAggregator constructor BuildAndRegisterAggregator. What are you fearing here?

This comment has been minimized.

@mfojtik

mfojtik Feb 12, 2019

Contributor

@sttts fearing every function that has "should be only called once on startup" :-)

This comment has been minimized.

@mbohlool

mbohlool Feb 12, 2019

Member

I will point out that the function is private and restricted to be used in this file. For that I won't add a once to be called logic. Also it may run more than once for local specs on startup.

@sttts sttts force-pushed the sttts:sttts-simplify-kube-aggregator-openapi branch from f132254 to a48c9f2 Feb 12, 2019

@sttts

This comment has been minimized.

Copy link
Contributor Author

sttts commented Feb 12, 2019

@mbohlool

This comment has been minimized.

Copy link
Member

mbohlool commented Feb 12, 2019

I only see refactoring and moving codes around. The new structure make sense to me. Thanks for doing this.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Feb 12, 2019

@deads2k

This comment has been minimized.

Copy link
Contributor

deads2k commented Feb 13, 2019

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Feb 13, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, sttts

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 7944fed into kubernetes:master Feb 13, 2019

17 checks passed

cla/linuxfoundation sttts authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Skipped
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-godeps Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped
pull-kubernetes-local-e2e-containerized Skipped
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped
tide In merge pool.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment