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

Register aggregator resources into scheme before starting components #15226

Merged
merged 1 commit into from
Jul 17, 2017
Merged

Register aggregator resources into scheme before starting components #15226

merged 1 commit into from
Jul 17, 2017

Conversation

liggitt
Copy link
Contributor

@liggitt liggitt commented Jul 16, 2017

@liggitt
Copy link
Contributor Author

liggitt commented Jul 16, 2017

[test]

@liggitt liggitt added this to the 3.6.0 milestone Jul 16, 2017
@liggitt
Copy link
Contributor Author

liggitt commented Jul 16, 2017

[severity:blocker]

@liggitt
Copy link
Contributor Author

liggitt commented Jul 16, 2017

@deads2k PTAL

testserver "github.com/openshift/origin/test/util/server"
)

func TestAggregator(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I did this upstream, but unless you create a service running an actual API server behind it, this test never catches the breaks you're interested in. Also, this would be removed as soon as we merge the rebase and make the aggregator non-optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unless you create a service running an actual API server behind it, this test never catches the breaks you're interested in

I was interested in the "can the aggregator start without causing a panic" break

// install our types into the scheme so that "normal" RESTOptionsGetters can work for us.
// done in init() so we don't mutate the scheme after it is being used by clients in other goroutines.
// TODO: move to a scheme-per-process like upstream and register into that instead.
install.Install(kapi.GroupFactoryRegistry, kapi.Registry, kapi.Scheme)
Copy link
Contributor

Choose a reason for hiding this comment

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

We really don't want to do this. If your integration tests requires it, do it there. You shouldn't be relying on a side effect of loading the package and if anyone gets used to it, we'll be chasing problems around as people who transitively depend on this package but never starts a server will accidentally work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this wasn't for the integration test, it was the fix. I can put it in an isolated install package and import it just for our server wiring, but it's safer to do this in an init() in 3.6

@liggitt
Copy link
Contributor Author

liggitt commented Jul 17, 2017

@deads2k moved to Master#Start() instead of init() block, PTAL

// install aggregator types into the scheme so that "normal" RESTOptionsGetters can work for us.
// done in Start() prior to doing any other initialization so we don't mutate the scheme after it is being used by clients in other goroutines.
// TODO: make scheme threadsafe and do this as part of aggregator config building
aggregatorinstall.Install(kapi.GroupFactoryRegistry, kapi.Registry, kapi.Scheme)
Copy link
Contributor

Choose a reason for hiding this comment

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

ought to be able to gate this on the presence of the aggregator proxy client cert, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gated the same way the config building is gated

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to fea9842

@deads2k
Copy link
Contributor

deads2k commented Jul 17, 2017

lgtm [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to fea9842

@openshift-bot
Copy link
Contributor

openshift-bot commented Jul 17, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/1296/) (Base Commit: 6c3acd2) (PR Branch Commit: fea9842) (Extended Tests: blocker) (Image: devenv-rhel7_6448)

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/3208/) (Base Commit: 271fb1c) (PR Branch Commit: fea9842)

@liggitt liggitt changed the title Register aggregator resources into scheme in init() Register aggregator resources into scheme before starting components Jul 17, 2017
@openshift-bot openshift-bot merged commit 9ae8fce into openshift:master Jul 17, 2017
@liggitt liggitt deleted the aggregator-registration branch July 19, 2017 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants