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

Refactor controller initialization (round #3) #14317

Merged
merged 3 commits into from
Jun 15, 2017

Conversation

mfojtik
Copy link
Contributor

@mfojtik mfojtik commented May 24, 2017

Follow up for #14293 with more controllers.

This time:

  • image trigger controller
  • service serving cert controller
  • image import controller

@mfojtik mfojtik changed the title Refactor controller initialization (part 3) WIP: Refactor controller initialization (part 3) May 24, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented May 24, 2017

@deads2k #14293 is going to have green tests, lets continue refactoring here. i'm going to move image controllers. @soltysh FYI you don't have to do this.

@mfojtik
Copy link
Contributor Author

mfojtik commented May 24, 2017

[test]

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 29, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 5, 2017

[test]

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 5, 2017

@deads2k ready for the round 3 ?

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 5, 2017

@soltysh for the image controllers

@mfojtik mfojtik changed the title WIP: Refactor controller initialization (part 3) Refactor controller initialization (round #3) Jun 5, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 5, 2017

@smarterclayton for the image trigger controller

return true, nil
}

// TODO: remove when generated informers exist
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@deads2k @smarterclayton do they exists now? i saw some image stream generated informers already ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

They exists, but are not wired, yet (or not everywhere) iirc. This should be removed when we entirely switch to the generated informers. The question is do we want to make it happen for 3.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, that is 3.7

Resync: time.Duration(c.ScheduledImageImportMinimumIntervalSeconds) * time.Second,

Enabled: !c.DisableScheduledImport,
DefaultBucketSize: 4, // TODO: Make this configurable?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@soltysh do we have issue for this? do we care?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, you've added that TODO, I don't think we care. Drop the todo.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 5, 2017
Copy link
Contributor

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

A few nits, but LGTM

InfraDeploymentConfigControllerServiceAccountName = "deploymentconfig-controller"
InfraDeploymentTriggerControllerServiceAccountName = "deployment-trigger-controller"
InfraDeployerControllerServiceAccountName = "deployer-controller"
// The controllers below were convered to new controller initialization and use RBAC
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: converted

return true, nil
}

// TODO: remove when generated informers exist
Copy link
Contributor

Choose a reason for hiding this comment

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

They exists, but are not wired, yet (or not everywhere) iirc. This should be removed when we entirely switch to the generated informers. The question is do we want to make it happen for 3.6?

Resync: time.Duration(c.ScheduledImageImportMinimumIntervalSeconds) * time.Second,

Enabled: !c.DisableScheduledImport,
DefaultBucketSize: 4, // TODO: Make this configurable?
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, you've added that TODO, I don't think we care. Drop the todo.

@@ -165,7 +165,10 @@ func setupBuildControllerTest(counts controllerCount, t *testing.T) (*client.Cli
}
}
for i := 0; i < counts.ImageChangeControllers; i++ {
openshiftConfig.RunImageTriggerController()
_, err := openshiftControllerInitializers["imagetrigger"](openshiftControllerContext)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this should be image-trigger since in the 3rd commit you're changing that.

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, good catch... altough i'm not sure how this will not panic ;-)

HasStatefulSetsEnabled: c.Options.DisabledFeatures.Has("triggers.image.openshift.io/statefulsets"),
HasCronJobsEnabled: c.Options.DisabledFeatures.Has("triggers.image.openshift.io/cronjobs"),
}
ret["image-trigger"] = imageTrigger.RunController
Copy link
Contributor

Choose a reason for hiding this comment

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

openshift.io/*

DisableScheduledImport: c.Options.ImagePolicyConfig.DisableScheduledImport,
ScheduledImageImportMinimumIntervalSeconds: c.Options.ImagePolicyConfig.ScheduledImageImportMinimumIntervalSeconds,
}
ret["image-import"] = imageImport.RunController
Copy link
Contributor

Choose a reason for hiding this comment

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

openshift.io/*

CertFile: c.Options.ControllerConfig.ServiceServingCert.Signer.CertFile,
KeyFile: c.Options.ControllerConfig.ServiceServingCert.Signer.KeyFile,
}
ret["service-serving-cert"] = serviceServingCert.RunController
Copy link
Contributor

Choose a reason for hiding this comment

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

openshift.io/*

@deads2k
Copy link
Contributor

deads2k commented Jun 6, 2017

I'd like to see #14333 merge first. Can you rebase on top of it?

}
if !c.HasDeploymentsEnabled {
sources = append(sources, imagetriggercontroller.TriggerSource{
Resource: schema.GroupResource{Group: "extensions", Resource: "deployments"},
Copy link
Contributor

Choose a reason for hiding this comment

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

open an issue to update this to apps or we're going to have a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

case *kappsv1beta1.StatefulSet:
_, err := u.kclient.Apps().StatefulSets(t.Namespace).Update(t)
return err
case *kapiv1.Pod:
Copy link
Contributor

Choose a reason for hiding this comment

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

we're touching pods for some reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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


go controller.Run(5, ctx.Stop)
if c.DisableScheduledImport {
return true, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

move to the beginning of the function. return false, nil

KeyFile string
}

func (c *ServiceServingCertsControllerOptions) RunController(ctx ControllerContext) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if there's no cert and no key, return false, nil

func (c *ServiceServingCertsControllerOptions) RunController(ctx ControllerContext) (bool, error) {
ca, err := crypto.GetCA(c.CertFile, c.KeyFile, "")
if err != nil {
return false, fmt.Errorf("service serving cert controller: %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.

return true, fmt.Errorf...

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 11, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 12, 2017

@deads2k or @smarterclayton can you please review the start_master and the image controller file? thats where the most conflict were, I hope i fixed them properly and don't miss anything.

@deads2k
Copy link
Contributor

deads2k commented Jun 12, 2017

@deads2k or @smarterclayton can you please review the start_master and the image controller file? thats where the most conflict were, I hope i fixed them properly and don't miss anything.

still lgtm

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2017
@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 12, 2017

@enj

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 13, 2017

[merge][severity: blocker]

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 13, 2017

@deads2k @smarterclayton now that i fixed the build integration test to incorporate the informers and rebased this, i'm back in position 10... i'm trying to merge this for ~8 days now and it is becoming hell to rebase this and get back to the beggining on the queue every morning...

can we green button merge this? i'm willing to rebase this once again after generated auth informers go in, but if we want this in 3.6, it would be better to green button merge it.

@deads2k
Copy link
Contributor

deads2k commented Jun 13, 2017

@deads2k @smarterclayton now that i fixed the build integration test to incorporate the informers and rebased this, i'm back in position 10... i'm trying to merge this for ~8 days now and it is becoming hell to rebase this and get back to the beggining on the queue every morning...

can we green button merge this? i'm willing to rebase this once again after generated auth informers go in, but if we want this in 3.6, it would be better to green button merge it.

@smarterclayton @eparis @pweil- this has happened to multiple pulls over the past two sprints and is symptomatic of our larger queue problems. While the green button provides us with some degree of control, manual queue management like this is unsustainable in the long run and inherently favoritist.

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 13, 2017

@jupierce ^

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 14, 2017

@smarterclayton @eparis @jupierce another rebase, another queue bump: You are in the build queue at position: 18 :-( (to be clear, all I did was rebase and fix 1 conflict which teleports this from position 9 to position 18... not mentioning that this PR was at position 10 yesterday evening?)

That means this won't get into DCUT (by normal merge) and since we really need this for 3.6 i'm going to claim this as a blocker and keep merging this during DCUT.

It also opens a question how much effictive is the DCUT merge close. If a developer working on a feature (big enough to caught multiple conflicts during merge process) is not able to merge his feature during the 1.5w period AND he started merging the feature at day 1 when the sprint begins, I think that is something really concerning and we should back off and reevaluate our merge process.

/me sorry for the rant, but this is really frustrating.

@enj
Copy link
Contributor

enj commented Jun 14, 2017

[severity:blocker]

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 15, 2017

@enj ❤️

@mfojtik
Copy link
Contributor Author

mfojtik commented Jun 15, 2017

broken by #14289 ...

@deads2k
Copy link
Contributor

deads2k commented Jun 15, 2017

[severity:blocker]

Agree

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 97efc6c

@smarterclayton
Copy link
Contributor

Compile error

@openshift-bot
Copy link
Contributor

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

@smarterclayton smarterclayton merged commit 84b8802 into openshift:master Jun 15, 2017
@mfojtik mfojtik deleted the controller-init-3 branch September 5, 2018 21:07
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.

6 participants