-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Also provision empty route rules for revisions that are not yet Active #785
Conversation
/retest |
4 similar comments
/retest |
/retest |
/retest |
/retest |
test/conformance/route_test.go
Outdated
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Needs 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. |
pkg/controller/route/route.go
Outdated
var err error | ||
configName := tt.ConfigurationName | ||
revName := tt.RevisionName | ||
if tt.ConfigurationName != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configName
pkg/controller/route/route.go
Outdated
if revName == "" { | ||
glog.Errorf("Configuration %s is not ready. Should skip updating route rules", | ||
tt.ConfigurationName) | ||
latestReadyRevName := configMap[tt.ConfigurationName].Status.LatestReadyRevisionName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[configName]
pkg/controller/route/route.go
Outdated
} 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple nits, thanks!
revRoutes := []RevisionRoute{} | ||
for _, tt := range route.Spec.Traffic { | ||
configName := tt.ConfigurationName | ||
if configName != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if configName == "" {
continue
}
pkg/controller/route/route.go
Outdated
configName := tt.ConfigurationName | ||
if configName != "" { | ||
// Get the configuration's LatestReadyRevisionName | ||
latestReadyRevName := configMap[tt.ConfigurationName].Status.LatestReadyRevisionName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configMap[configName]
pkg/controller/route/route.go
Outdated
@@ -789,7 +831,13 @@ func (c *Controller) createOrUpdateRouteRules(route *v1alpha1.Route, configMap m | |||
glog.Errorf("Failed to check if should direct traffic to activator: %s", err) | |||
return nil, err | |||
} | |||
|
|||
// TODO: remove this once https://github.com/istio/istio/issues/5204 is fixe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: fixed
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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