Skip to content

Commit

Permalink
Merge pull request #662 from jhadvig/bz2055494
Browse files Browse the repository at this point in the history
Bug 2055494: Distinguish between route conditions
  • Loading branch information
openshift-ci[bot] committed Jul 18, 2022
2 parents dbe81b4 + 8e4d5e9 commit b3f1401
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/console/controllers/route/controller.go
Expand Up @@ -123,19 +123,21 @@ func (c *RouteSyncController) Sync(ctx context.Context, controllerContext factor
}
routeConfig := routesub.NewRouteConfig(updatedOperatorConfig, ingressConfig, c.routeName)

typePrefix := fmt.Sprintf("%sCustomRouteSync", strings.Title(c.routeName))
// try to sync the custom route first. If the sync fails for any reason, error
// out the sync loop and inform about this fact instead of putting default
// route into inaccessible state.
_, customRouteErrReason, customRouteErr := c.SyncCustomRoute(ctx, routeConfig, controllerContext)
statusHandler.AddConditions(status.HandleProgressingOrDegraded("CustomRouteSync", customRouteErrReason, customRouteErr))
statusHandler.AddCondition(status.HandleUpgradable("CustomRouteSync", customRouteErrReason, customRouteErr))
statusHandler.AddConditions(status.HandleProgressingOrDegraded(typePrefix, customRouteErrReason, customRouteErr))
statusHandler.AddCondition(status.HandleUpgradable(typePrefix, customRouteErrReason, customRouteErr))
if customRouteErr != nil {
return statusHandler.FlushAndReturn(customRouteErr)
}

typePrefix = fmt.Sprintf("%sDefaultRouteSync", strings.Title(c.routeName))
_, defaultRouteErrReason, defaultRouteErr := c.SyncDefaultRoute(ctx, routeConfig, controllerContext)
statusHandler.AddConditions(status.HandleProgressingOrDegraded("DefaultRouteSync", defaultRouteErrReason, defaultRouteErr))
statusHandler.AddCondition(status.HandleUpgradable("DefaultRouteSync", defaultRouteErrReason, defaultRouteErr))
statusHandler.AddConditions(status.HandleProgressingOrDegraded(typePrefix, defaultRouteErrReason, defaultRouteErr))
statusHandler.AddCondition(status.HandleUpgradable(typePrefix, defaultRouteErrReason, defaultRouteErr))

// warn if deprecated configuration of custom domain for 'console' route is set on the console-operator config
if (len(operatorConfig.Spec.Route.Hostname) != 0 || len(operatorConfig.Spec.Route.Secret.Name) != 0) && c.routeName == api.OpenShiftConsoleRouteName {
Expand Down

0 comments on commit b3f1401

Please sign in to comment.