-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Conversation
a394e93
to
654779a
Compare
[test] |
45fa238
to
85d12ed
Compare
[test] |
@deads2k ready for the round 3 ? |
@soltysh for the image controllers |
@smarterclayton for the image trigger controller |
85d12ed
to
2c55a39
Compare
return true, nil | ||
} | ||
|
||
// TODO: remove when generated informers exist |
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
2c55a39
to
25d773b
Compare
Resync: time.Duration(c.ScheduledImageImportMinimumIntervalSeconds) * time.Second, | ||
|
||
Enabled: !c.DisableScheduledImport, | ||
DefaultBucketSize: 4, // TODO: Make this configurable? |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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? |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 ;-)
25d773b
to
de25c2e
Compare
pkg/cmd/server/origin/controller.go
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openshift.io/*
pkg/cmd/server/origin/controller.go
Outdated
DisableScheduledImport: c.Options.ImagePolicyConfig.DisableScheduledImport, | ||
ScheduledImageImportMinimumIntervalSeconds: c.Options.ImagePolicyConfig.ScheduledImageImportMinimumIntervalSeconds, | ||
} | ||
ret["image-import"] = imageImport.RunController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openshift.io/*
pkg/cmd/server/origin/controller.go
Outdated
CertFile: c.Options.ControllerConfig.ServiceServingCert.Signer.CertFile, | ||
KeyFile: c.Options.ControllerConfig.ServiceServingCert.Signer.KeyFile, | ||
} | ||
ret["service-serving-cert"] = serviceServingCert.RunController |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
openshift.io/*
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"}, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return true, fmt.Errorf...
23b7b5a
to
3c6406a
Compare
@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 |
[merge][severity: blocker] |
@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. |
8c3189f
to
bfb13e6
Compare
@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. |
[severity:blocker] |
@enj ❤️ |
broken by #14289 ... |
bfb13e6
to
45b7d86
Compare
Agree |
45b7d86
to
016d4b9
Compare
016d4b9
to
97efc6c
Compare
Evaluated for origin test up to 97efc6c |
Compile error |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2267/) (Base Commit: c323526) |
Follow up for #14293 with more controllers.
This time: