Also provision empty route rules for revisions that are not yet Active#785
Also provision empty route rules for revisions that are not yet Active#785google-prow-robot merged 5 commits intoknative:masterfrom
Conversation
|
/retest |
4 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
| @@ -95,12 +96,12 @@ func isRouteReady() func(r *v1alpha1.Route) (bool, error) { | |||
|
|
|||
| func allRouteTrafficAtRevision(routeName string, revisionName string) func(r *v1alpha1.Route) (bool, error) { | |||
There was a problem hiding this comment.
sorry @tcnghia I refactored this, the file you'll need to move this change over to is https://github.com/elafros/elafros/blob/master/test/states.go
There was a problem hiding this comment.
thanks for pointing that out. updated.
|
/lgtm |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adrcunha, mdemirhan, tcnghia The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/lgtm |
|
/hold Waiting on CODEOWNERS review; the hold is to keep this from blocking the Tide merge queue. |
| var err error | ||
| configName := tt.ConfigurationName | ||
| revName := tt.RevisionName | ||
| if tt.ConfigurationName != "" { |
| if revName == "" { | ||
| glog.Errorf("Configuration %s is not ready. Should skip updating route rules", | ||
| tt.ConfigurationName) | ||
| latestReadyRevName := configMap[tt.ConfigurationName].Status.LatestReadyRevisionName |
| } else if _, ok := revMap[rev.Name]; !ok { | ||
| // This is a non-target revision. Adding a dummy rule to make Istio happy, | ||
| // so that if we switch traffic to them later we won't cause Istio to | ||
| // throw spurious 503s. See https://github.com/istio/istio/issues/5204. |
There was a problem hiding this comment.
I find this loop pretty hard to follow.
Since I believe this is a temporary workaround, I think it would be better to have:
- Control loop that materializes the semantics we want (route rule per active revision)
- Control loop that materializes route rules to work around the istio issue
Above 2. we should have a clear comment outlining the Istio issue (and a link to an issue tracking it's resolution), we should also have an Ela tracking issue, which shouldn't close until the second control loop is ripped out.
There was a problem hiding this comment.
Also, I believe this means that the number of routes will monotonically increase and that revisions will remain routable in perpetuity, which certainly shouldn't be the end state. We should be clear about the trade-offs here while we wait on a proper fix from Istio.
This appears to make Istio happy, and if we switch traffic to them later we won't cause Istio to throw spurious 503s. See istio/istio#5204.
| revRoutes := []RevisionRoute{} | ||
| for _, tt := range route.Spec.Traffic { | ||
| configName := tt.ConfigurationName | ||
| if configName != "" { |
There was a problem hiding this comment.
if configName == "" {
continue
}| configName := tt.ConfigurationName | ||
| if configName != "" { | ||
| // Get the configuration's LatestReadyRevisionName | ||
| latestReadyRevName := configMap[tt.ConfigurationName].Status.LatestReadyRevisionName |
| return nil, err | ||
| } | ||
|
|
||
| // TODO: remove this once https://github.com/istio/istio/issues/5204 is fixe. |
| glog.Errorf("Failed to get empty routes for %s : %q", route.Name, err) | ||
| return nil, err | ||
| } | ||
| revisionRoutes = append(revisionRoutes, emptyRoutes...) |
There was a problem hiding this comment.
Thanks, this will be significantly easier to excise later when Istio fixes things!
|
/retest |
|
/lgtm |
|
/retest |
This appears to make Istio happy, that if we switch traffic to them
later we won't cause Istio to throw spurious 503s. See
istio/istio#5204.
Fixes #348
Proposed Changes