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

Route controller #395

Merged
merged 2 commits into from
Mar 18, 2020
Merged

Conversation

jhadvig
Copy link
Member

@jhadvig jhadvig commented Mar 17, 2020

@benjaminapetersen I've finalised your work from #350

Tested the change manually and the controller is stomping the route on edit and recreating on delete.
Although when a label or annotation is edited on the route the controller wont stomp the route, not sure if thats desirable.

/assign @benjaminapetersen


return ctrl

// configNameFilter := operator.FilterByNames(api.ConfigResourceName)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we eliminate the commented code?

}

func (c *RouteSyncController) sync() error {
// startTime := time.Now()
Copy link
Contributor

Choose a reason for hiding this comment

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

Uncomment? Our main Operator.Sync has, potentially useful for debuggin?

// TODO: do we need the "toUpdate" bool?
status.HandleProgressingOrDegraded(updatedOperatorConfig, "RouteSync", errReason, err)
status.SyncStatus(c.operatorConfigClient, updatedOperatorConfig)

Copy link
Contributor

Choose a reason for hiding this comment

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

Just comparing to refresh myself, I think we forgot SyncStatus() on the CLIDownloadsController.


updatedOperatorConfig := operatorConfig.DeepCopy()

// TODO: is this all we need when syncing the route?
Copy link
Contributor

Choose a reason for hiding this comment

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

We can probably remove these comments.

// default host name set by the server, or any other values. The ApplyRoute()
// logic will have to be sound.
// - update to ApplyRoute() once the logic is settled
func (co *RouteSyncController) SyncRoute(operatorConfig *operatorsv1.Console) (consoleRoute *routev1.Route, isNew bool, reason string, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

func (co *RouteSy...
func (c *RouteSy...

Slight inconsistency with co from the rest of the methods.

@@ -243,8 +243,10 @@ func (c *consoleOperator) removeConsole() error {
klog.V(2).Info("deleting console resources")
defer klog.V(2).Info("finished deleting console resources")
var errs []error
// route
errs = append(errs, c.routeClient.Routes(api.TargetNamespace).Delete(route.Stub().Name, &metav1.DeleteOptions{}))
// // route
Copy link
Contributor

Choose a reason for hiding this comment

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

Can delete this, looks like you got the delete on the route for ManagementState:Removed on the correct controller.

@@ -6,6 +6,8 @@ import (
"os"
"time"

"github.com/openshift/console-operator/pkg/console/controllers/route"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ordering deps

Copy link
Contributor

@benjaminapetersen benjaminapetersen left a comment

Choose a reason for hiding this comment

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

/approve

Just a couple little tweaks and we can lgtm, thx!

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

jhadvig commented Mar 17, 2020

@benjaminapetersen comments addressed. Thanks for those !

Copy link
Contributor

@benjaminapetersen benjaminapetersen left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2020
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2020
Copy link
Contributor

@benjaminapetersen benjaminapetersen left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benjaminapetersen, jhadvig

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-bot
Copy link
Contributor

/retest

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

2 similar comments
@openshift-bot
Copy link
Contributor

/retest

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

@openshift-bot
Copy link
Contributor

/retest

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

@openshift-merge-robot openshift-merge-robot merged commit 7a9c899 into openshift:master Mar 18, 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.

5 participants