Skip to content

separate kube and openshift apiservers - #15564

Merged
openshift-merge-robot merged 8 commits into
openshift:masterfrom
deads2k:server-12-aggregate-properly
Aug 2, 2017
Merged

openshift-merge-robot merged 8 commits into
openshift:masterfrom
deads2k:server-12-aggregate-properly

Conversation

@deads2k

@deads2k deads2k commented Jul 31, 2017

Copy link
Copy Markdown
Contributor

fixes #15260

Splits the openshift and kube apiservers cleanly and aggregates them back together.

@openshift-merge-robot openshift-merge-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 31, 2017
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

No associated issue. Update pull-request body to add a reference to an issue, or get approval with /approve no-issue

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 31, 2017
@mfojtik

mfojtik commented Jul 31, 2017

Copy link
Copy Markdown
Contributor

/subscribe

@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from 50c282b to bbe0a19 Compare July 31, 2017 18:15
@openshift-merge-robot openshift-merge-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 31, 2017
Comment thread test/cmd/basicresources.sh Outdated
os::cmd::expect_success_and_text 'oc explain deploymentconfig' 'a desired deployment state'
os::cmd::expect_success_and_text 'oc explain deploymentconfig.spec' 'ensures that this deployment config will have zero replicas'
# TODO figure out how to delegate the swagger API calls somehow
# os::cmd::expect_success_and_text 'oc explain deploymentconfig --api-version=apps.openshift.io/v1' 'a desired deployment state'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@liggitt interesting side effect. Confirm that you're ok to drop it for a while in 3.7. It must be an upstream problem too.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with a release-blocking issue tracking re-enablement, I suppose

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

with a release-blocking issue tracking re-enablement, I suppose

Opened #15577. Turns out if you remove the openapi aggregator, it no longer aggregates openapi.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I'm looking correctly this should be addressed in 3aef22f, which is dropping the openapi disablement, isn't it?

@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from bbe0a19 to 52853d6 Compare August 1, 2017 13:02

@soltysh soltysh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One question, otherwise looks good to me.

Comment thread test/cmd/basicresources.sh Outdated
os::cmd::expect_success_and_text 'oc explain deploymentconfig' 'a desired deployment state'
os::cmd::expect_success_and_text 'oc explain deploymentconfig.spec' 'ensures that this deployment config will have zero replicas'
# TODO figure out how to delegate the swagger API calls somehow
# os::cmd::expect_success_and_text 'oc explain deploymentconfig --api-version=apps.openshift.io/v1' 'a desired deployment state'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I'm looking correctly this should be addressed in 3aef22f, which is dropping the openapi disablement, isn't it?

@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from 52853d6 to acb0f32 Compare August 1, 2017 13:55
@openshift-merge-robot openshift-merge-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 1, 2017
@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from acb0f32 to 6e75dc3 Compare August 1, 2017 14:06
@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from 6e75dc3 to baa346c Compare August 1, 2017 14:08
if err != nil {
return err
}
delegateOpenAPISpecCopy, err := openapi.CloneSpec(delegateOpenAPISpec)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MergeSpec promised not to touch delegateOpenAPISpec

@soltysh

soltysh commented Aug 1, 2017

Copy link
Copy Markdown
Contributor

@frobware fyi

openAPIConfig: c.OpenAPIConfig,
swaggerConfig: c.SwaggerConfig,
openAPIConfig: c.OpenAPIConfig,
swaggerAPIContainers: append([]*restful.Container{apiServerHandler.GoRestfulContainer}, delegationTarget.SwaggerAPIContainers()...),

@sttts sttts Aug 1, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do you cache this list in the server? Can't you build up the list when you need it?

Why do we need the list in the first place? Because apiServerHandler.GoRestfulContainer can be nil? Would it be enough to have the first non-nil container?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why do you cache this list in the server? Can't you build up the list when you need it?

Build it up from what? The delegate is "lost" after construction to avoid side-effecty references without planning/structure.

Why do we need the list in the first place? Because apiServerHandler.GoRestfulContainer can be nil? Would it be enough to have the first non-nil container?

No. We have to make a tweak to the upstream swagger generator to allow multiple containers to be unioned to produce the swagger that we're looking for. They are not all unioned in a single gorestful container. They delegate.

func RegisterSwaggerService(config Config, containers []*restful.Container, wsContainer *restful.Container) {
sws := newSwaggerService(config)
for _, container := range containers {
sws.AddWebServices(container.RegisteredWebServices())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

oh right, you have to collect all the services. Forget my previous question why we need all the containers.

swaggerConfig: c.SwaggerConfig,
openAPIConfig: c.OpenAPIConfig,
swaggerAPIContainers: append([]*restful.Container{apiServerHandler.GoRestfulContainer}, delegationTarget.SwaggerAPIContainers()...),
openapiDelegateSpec: delegationTarget.OpenAPISpec,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if you stored the delegationTarget, you would have to store all the delegate methods and containers. Would make it much easier to reason about.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

if you stored the delegationTarget, you would have to store all the delegate methods and containers. Would make it much easier to reason about.

I fear people re-using it indiscriminately. I'd really like to see all the upstream code here die.

return s.Handler.Director
}
func (s *GenericAPIServer) SwaggerAPIContainers() []*restful.Container {
return s.swaggerAPIContainers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do the append with the delegation target's containers here. Would be pretty obvious then and we can get rid of the terrible 5 liner comments above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

do the append with the delegation target's containers here. Would be pretty obvious then and we can get rid of the terrible 5 liner comments above.

ok. It's all ugly. Someone is going to do awful things with that reference. :(

@deads2k
deads2k force-pushed the server-12-aggregate-properly branch from baa346c to 00ddf8b Compare August 1, 2017 15:13
@deads2k

deads2k commented Aug 1, 2017

Copy link
Copy Markdown
Contributor Author

comments addressed.

@deads2k deads2k added the lgtm Indicates that a PR is ready to be merged. label Aug 1, 2017
@deads2k

deads2k commented Aug 1, 2017

Copy link
Copy Markdown
Contributor Author

/test end_to_end

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Automatic merge from submit-queue (batch tested with PRs 15130, 15191, 15575, 15362, 15564)

@openshift-merge-robot
openshift-merge-robot merged commit 13715b8 into openshift:master Aug 2, 2017
@deads2k
deads2k deleted the server-12-aggregate-properly branch August 3, 2017 19:30
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. lgtm Indicates that a PR is ready to be merged. 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.

Remove UPSTREAM: <drop>: drop post 3.7 rebase. allows disabled aggregator

6 participants