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

get picks for aggregator status #14513

Merged
merged 18 commits into from
Jun 12, 2017
Merged

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented Jun 7, 2017

xref #14500

Aggregator status usage didn't come until long after the API was added, so this pulls in the most important picks that are precursors to it so that the conflicts aren't crazy. The picks came in relatively clean. I've kept the fitting commits separate for ease.

@liggitt

@deads2k
Copy link
Contributor Author

deads2k commented Jun 7, 2017

[test]

@deads2k
Copy link
Contributor Author

deads2k commented Jun 8, 2017

Alright, the last commit is a change that is needed to wire openshift into a more "normal" aggregated API server shape so that our admission chain works after the aggregator picks we needed from upstream. It is mostly a shuffle, but it is fairly large. Luckily, our integration test flows cover this. More refactoring is necessary, but this is about as small as I could get and have it work.

@soltysh @mfojtik @sttts ptal.
@liggitt @eparis this is a structural change that has almost no shot of making it through the origin queue in a reasonable time due to likely conflict/rebase cycles that push me to the back. I'm requesting a green button on lgtm and green tests.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 8, 2017

@liggitt @eparis this is a structural change that has almost no shot of making it through the origin queue in a reasonable time due to likely conflict/rebase cycles that push me to the back. I'm requesting a green button on lgtm and green tests.

for perspective, the queue is currently 26 deep and working on a pull that was tagged for merge on Monday.

@@ -0,0 +1,336 @@
package origin
Copy link
Contributor

Choose a reason for hiding this comment

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

openshift-apiserver.go ?

Copy link
Contributor

Choose a reason for hiding this comment

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

or originapi-apiserver.go

TemplateNamespaces []string
}

// OpenshiftNonAPIServer is only responsible for serving the APIs for Openshift
Copy link
Contributor

Choose a reason for hiding this comment

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

outdated comment?

// this is installing the openshift APIs into the kubeapiserver
installAPIs(openshiftAPIServerConfig, kubeAPIServer.GenericAPIServer)
// this sets up the openapi endpoints
preparedKubeAPIServer := kubeAPIServer.GenericAPIServer.PrepareRun()
Copy link
Contributor

Choose a reason for hiding this comment

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

don't like that we call PrepareRun() only here and not for the others. Is it the same in kube-apiserver?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

don't like that we call PrepareRun() only here and not for the others. Is it the same in kube-apiserver?

Yeah. openapi is the source of many sins


// TODO all of our groups currently have one version, by the time we get more than one, these should be split up
// into their own api servers
apiGroupInfo.GroupMeta.GroupVersion = gv
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not keep isPreferredGroupVersion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

restored

// into their own api servers
apiGroupInfo.GroupMeta.GroupVersion = gv

glog.Infof("Starting Origin API at %%s%s/%s/%s", api.GroupPrefix, gv.Group, gv.Version)
Copy link
Contributor

Choose a reason for hiding this comment

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

note the %%s. This is substituted somewhere else in the old code.

Copy link
Contributor

Choose a reason for hiding this comment

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

and all the other places with %%s

}

func (c completedOpenshiftNonAPIConfig) New(delegationTarget genericapiserver.DelegationTarget, stopCh <-chan struct{}) (*OpenshiftNonAPIServer, error) {
genericServer, err := c.OpenshiftNonAPIConfig.GenericConfig.SkipComplete().New("openshift-nonapiserver", delegationTarget) // completion is done in Complete, no need for a second time
Copy link
Contributor

Choose a reason for hiding this comment

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

nonapiserver is strange somehow. openshift-non-api-routes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nonapiserver is strange somehow. openshift-non-api-routes?

Not quite as much fun, but sure.

//TODO/REBASE use something other than c.KubeClientsetInternal
nodeConnectionInfoGetter, err := kubeletclient.NewNodeConnectionInfoGetter(c.KubeClientExternal.CoreV1().Nodes(), *c.KubeletClientConfig)
if err != nil {
return nil, fmt.Errorf("Unable to configure the node connection info getter: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: lower case

Copy link
Contributor

Choose a reason for hiding this comment

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

everywhere below as well

}

buildStorage, buildDetailsStorage, err := buildetcd.NewREST(c.GenericConfig.RESTOptionsGetter)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

would write those if-clause in one line, if gofmt accepts that. Func gets very long with 50% error handling.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

would write those if-clause in one line, if gofmt accepts that. Func gets very long with 50% error handling.

I miss java too :)

This function is on the chopping block. I wouldn't get overly caught up in it.

Copy link
Contributor

Choose a reason for hiding this comment

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

True.

}

// initMetricsRoute initializes an HTTP endpoint for metrics.
func initMetricsRoute(apiContainer *restful.Container, path string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this was dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes


storage := make(map[string]rest.Storage)
for k, v := range all {
if excludedV1Types.Has(k) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this was empty I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes


// c.Options.OAuthConfig.MasterPublicURL
MasterPublicURL string
// c.Options.OAuthConfig != nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Better comment? These code comments will get outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they were breadcrumbs for me. removing

_ "github.com/openshift/origin/pkg/api/install"
)

// TODO this function needs to be broken apart with each API group owning their own storage, probably with two method
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, please. 300 lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, please. 300 lines.

follow up

Copy link
Contributor

Choose a reason for hiding this comment

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

fine with me.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 9, 2017

Comments addressed and some more tests fixed. So glad we have tests.

@sttts
Copy link
Contributor

sttts commented Jun 9, 2017

Looks good from my side. Having some more eyes on this wouldn't harm though. Quite a bit of code moved and split apart.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 9, 2017

Appears to be clean of conflicts with the next two in the queue. Plan to merge on green.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 9, 2017

@liggitt @sttts Hit a snag with admission. See the last two commits for a "fix" that works until we aggregate in 3.7.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 9, 2017

This breaks the back of the problem, but then we have at least one TODO that needs doing and the generated code problem. I'd like to see this merged to get those a lot smaller.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 9, 2017

Re[test]

@deads2k
Copy link
Contributor Author

deads2k commented Jun 10, 2017

@sttts if you could make peace with the last two commits on Monday :)

// we're going through a "normal" API installation in the wrong server, we need to switch the admission chain
// *only while we're installing these APIs*. There are tests that make sure this works and doesn't drop
// plugins and we'll remove it once we're aggregating
kubeAPIServer.GenericAPIServer.SetAdmission(openshiftAPIServerConfig.GenericConfig.AdmissionControl)
Copy link
Contributor

Choose a reason for hiding this comment

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

ugly, but ok.

Wondering which of these temporary hacks we can move into the if-clause below for the non-aggregating run mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wondering which of these temporary hacks we can move into the if-clause below for the non-aggregating run mode?

Can't. These are always needed to get the admission chain right until we're always aggregating.
:(

@sttts
Copy link
Contributor

sttts commented Jun 12, 2017

@deads2k wouldn't call it peace, but I am ok with those two (temporary) commits.

@deads2k
Copy link
Contributor Author

deads2k commented Jun 12, 2017

[merge]

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 12, 2017

continuous-integration/openshift-jenkins/merge Waiting: You are in the build queue at position: 5

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 78f422e

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 78f422e

@deads2k
Copy link
Contributor Author

deads2k commented Jun 12, 2017

flaked on #14573

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2130/) (Base Commit: c09c601)

@deads2k
Copy link
Contributor Author

deads2k commented Jun 12, 2017

Green except for the flake. Blocks aggregator usage. Merging as planned. Doesn't conflict with top two pulls.

@deads2k deads2k merged commit b57c2fd into openshift:master Jun 12, 2017
@deads2k deads2k deleted the agg-05-status branch August 3, 2017 19:26
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