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

Fix terminationhandler sync #648

Merged

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Jul 17, 2020

This #535 introduced support to manage a damonSet which runs termination handler for spot intances.
As an event handler is not passed to the damonSet informer changes to the resource won't trigger a reconcile.
This PR fixes that by passing the event handler to the daemonSet namespaced informer.
This will be e2e tested by openshift/cluster-api-actuator-pkg#177

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 17, 2020
@enxebre
Copy link
Member Author

enxebre commented Jul 17, 2020

/hold
to add some tests. Aside seems the informer is not reacting to daemonSet updates.

…tion handler

This openshift#535 introduced support to manage a damonSet which runs termination handler for spot intances.
As an event handler is not passed to the damonSet informer changes to the resource won't trigger a reconcile.
This PR fix that by passing the event handler to the daemonSet namespaced informer.
This will be e2e tested by openshift/cluster-api-actuator-pkg#177
@enxebre enxebre force-pushed the fix-terminationhandler-sync branch from 383ae08 to f9a7478 Compare July 20, 2020 11:37
enxebre added a commit to enxebre/cluster-api-actuator-pkg that referenced this pull request Jul 20, 2020
This openshift/machine-api-operator#535 introduced support to manage a damonSet which runs termination handler for spot intances.
As an event handler is not passed to the damonSet informer changes to the resource won't trigger a reconcile.
This PR openshift/machine-api-operator#648 fixes that by passing the event handler to the daemonSet namespaced informer.
This PR cover this e2e.
enxebre added a commit to enxebre/cluster-api-actuator-pkg that referenced this pull request Jul 20, 2020
This openshift/machine-api-operator#535 introduced support to manage a damonSet which runs termination handler for spot intances.
As an event handler is not passed to the damonSet informer changes to the resource won't trigger a reconcile.
This PR openshift/machine-api-operator#648 fixes that by passing the event handler to the daemonSet namespaced informer.
This PR cover this e2e.
@@ -112,6 +112,7 @@ func New(
}

deployInformer.Informer().AddEventHandler(optr.eventHandlerDeployments())
daemonsetInformer.Informer().AddEventHandler(optr.eventHandler())
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use eventHandlerDeployments() instead so that we only reconcile when the DaemonSet is owned by the operator?

Copy link
Member Author

@enxebre enxebre Jul 20, 2020

Choose a reason for hiding this comment

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

The initial rationale behind that was to mitigate mao extra reconciling loops we were seeing and make sure the mao didn't watch itself and so racing with the CVO.
I think It's fine to keep this simple and let it watch any daemonSet on the namespace rather than perpetuate the eventHandlerDeployments pattern.

Then in the medium term we can consider to polish the mao logic, drop that custom eventHandler and if we need more granularity we can pass any SharedInformerOption with WithTweakListOptions to the NewSharedInformerFactoryWithOptions

kubeNamespacedSharedInformer := informers.NewSharedInformerFactoryWithOptions(kubeClient, resyncPeriod()(), informers.WithNamespace(targetNamespace))

@enxebre
Copy link
Member Author

enxebre commented Jul 20, 2020

/hold cancel
/retest
tested and run against openshift/cluster-api-actuator-pkg#177 on my cluster.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 20, 2020
@elmiko
Copy link
Contributor

elmiko commented Jul 20, 2020

/lgtm

1 similar comment
@Danil-Grigorev
Copy link
Contributor

/lgtm

enxebre added a commit to enxebre/cluster-api-actuator-pkg that referenced this pull request Jul 20, 2020
This openshift/machine-api-operator#535 introduced support to manage a damonSet which runs termination handler for spot intances.
As an event handler is not passed to the damonSet informer changes to the resource won't trigger a reconcile.
This PR openshift/machine-api-operator#648 fixes that by passing the event handler to the daemonSet namespaced informer.
This PR cover this e2e.
@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 20, 2020
@Danil-Grigorev
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Danil-Grigorev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 21, 2020
@enxebre
Copy link
Member Author

enxebre commented Jul 21, 2020

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jul 21, 2020

@enxebre: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-azure-operator f9a7478 link /test e2e-azure-operator

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@JoelSpeed
Copy link
Contributor

/retest

@openshift-merge-robot openshift-merge-robot merged commit d234cce into openshift:master Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants