Skip to content

Commit

Permalink
Bug 2055494: Distinguish between route conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhadvig committed Jul 8, 2022
1 parent 11aad7e commit 504a34e
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)

fmt.Printf("\n ==> %#v \n", routeConfig)

// 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(fmt.Sprintf("%sCustomRouteSync", strings.Title(c.routeName)), customRouteErrReason, customRouteErr))
statusHandler.AddCondition(status.HandleUpgradable(fmt.Sprintf("%sCustomRouteSync", strings.Title(c.routeName)), customRouteErrReason, customRouteErr))
if customRouteErr != nil {
return statusHandler.FlushAndReturn(customRouteErr)
}

_, 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(fmt.Sprintf("%sDefaultRouteSync", strings.Title(c.routeName)), defaultRouteErrReason, defaultRouteErr))
statusHandler.AddCondition(status.HandleUpgradable(fmt.Sprintf("%sDefaultRouteSync", strings.Title(c.routeName)), 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 504a34e

Please sign in to comment.