Repository navigation
separate kube and openshift apiservers - #15564
openshift-merge-robot merged 8 commits into
Conversation
|
[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 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
/subscribe |
50c282b to
bbe0a19
Compare
| 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' |
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
with a release-blocking issue tracking re-enablement, I suppose
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
If I'm looking correctly this should be addressed in 3aef22f, which is dropping the openapi disablement, isn't it?
bbe0a19 to
52853d6
Compare
soltysh
left a comment
There was a problem hiding this comment.
One question, otherwise looks good to me.
| 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' |
There was a problem hiding this comment.
If I'm looking correctly this should be addressed in 3aef22f, which is dropping the openapi disablement, isn't it?
52853d6 to
acb0f32
Compare
acb0f32 to
6e75dc3
Compare
…ple containers to union for swagger
6e75dc3 to
baa346c
Compare
| if err != nil { | ||
| return err | ||
| } | ||
| delegateOpenAPISpecCopy, err := openapi.CloneSpec(delegateOpenAPISpec) |
There was a problem hiding this comment.
MergeSpec promised not to touch delegateOpenAPISpec
|
@frobware fyi |
| openAPIConfig: c.OpenAPIConfig, | ||
| swaggerConfig: c.SwaggerConfig, | ||
| openAPIConfig: c.OpenAPIConfig, | ||
| swaggerAPIContainers: append([]*restful.Container{apiServerHandler.GoRestfulContainer}, delegationTarget.SwaggerAPIContainers()...), |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
if you stored the delegationTarget, you would have to store all the delegate methods and containers. Would make it much easier to reason about.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :(
…gregation. Should be baster in 1.8
baa346c to
00ddf8b
Compare
|
comments addressed. |
|
/test end_to_end |
|
Automatic merge from submit-queue (batch tested with PRs 15130, 15191, 15575, 15362, 15564) |
fixes #15260
Splits the openshift and kube apiservers cleanly and aggregates them back together.