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

Bug 1717494: Refactor client and cache handling #244

Merged
merged 6 commits into from
Jun 6, 2019

Conversation

ironcladlou
Copy link
Contributor

@ironcladlou ironcladlou commented Jun 4, 2019

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2019
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jun 4, 2019
@ironcladlou
Copy link
Contributor Author

/retest

@ironcladlou ironcladlou changed the title WIP: Cache refactor Bug 1711373: Refactor client and cache handling Jun 4, 2019
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 4, 2019
@ironcladlou ironcladlou changed the title Bug 1711373: Refactor client and cache handling Refactor client and cache handling Jun 4, 2019
@ironcladlou
Copy link
Contributor Author

@Miciah @danehans this is ready for review... tomorrow I need to repro https://bugzilla.redhat.com/show_bug.cgi?id=1711373 with the ingress operator and make a new bug to link to this PR. I can do a similar change in dns-operator to fix the existing bug.

@ironcladlou
Copy link
Contributor Author

/retest

@ironcladlou ironcladlou changed the title Refactor client and cache handling Bug 1717494: Refactor client and cache handling Jun 5, 2019
@@ -55,9 +55,10 @@ func main() {
// Collect operator configuration.
operatorNamespace := os.Getenv("WATCH_NAMESPACE")
if len(operatorNamespace) == 0 {
log.Error(fmt.Errorf("missing environment variable"), "'WATCH_NAMESPACE' environment variable must be set")
os.Exit(1)
operatorNamespace = "openshift-ingress-operator"
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a leftover from development that should be reverted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was certainly useful — why not keep it?

Copy link
Contributor

Choose a reason for hiding this comment

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

Acceptable.

NewCache: cache.MultiNamespacedCacheBuilder([]string{
config.Namespace,
"openshift-ingress",
"openshift-config-managed",
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use a named constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

if !o.manager.GetCache().WaitForCacheSync(stop) {
log.Error(nil, "failed to sync cache before ensuring default ingresscontroller")
return
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is ensureDefaultIngressController actually using the cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not right now, but generally it seemed like a good idea to wait until things were up and running

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the wait.Until uses a 1-minute period, does this mean that the operator will probably take an extra minute to create the default ingress controller on a new cluster?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I guess in the normal case, WaitForCacheSync will block and succeed and delay the creation exactly as long as it takes to sync the cache.

@Miciah
Copy link
Contributor

Miciah commented Jun 6, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 6, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah

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

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants