From d8b847a973c4daf1ebd9c9ed5d7b86aa5b00e9ec Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Fri, 8 Mar 2019 15:05:44 +0200 Subject: [PATCH] Mention session affinity in docs --- docs/gitbook/how-it-works.md | 1 + pkg/controller/deployer.go | 2 +- pkg/controller/scheduler.go | 7 ------- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/gitbook/how-it-works.md b/docs/gitbook/how-it-works.md index d672e7e8..cdd74b84 100644 --- a/docs/gitbook/how-it-works.md +++ b/docs/gitbook/how-it-works.md @@ -331,6 +331,7 @@ promotes it without analysing it. If an analysis is underway, Flagger cancels it Besides weighted routing, Flagger can be configured to route traffic to the canary based on HTTP match conditions. In an A/B testing scenario, you'll be using HTTP headers or cookies to target a certain segment of your users. +This is particularly useful for frontend applications that require session affinity. Spec: diff --git a/pkg/controller/deployer.go b/pkg/controller/deployer.go index 74f48c68..6b7555b0 100644 --- a/pkg/controller/deployer.go +++ b/pkg/controller/deployer.go @@ -220,7 +220,7 @@ func (c *CanaryDeployer) SetStatusWeight(cd *flaggerv1.Canary, val int) error { return nil } -// SetStatusWeight updates the canary status weight value +// SetStatusIterations updates the canary status iterations value func (c *CanaryDeployer) SetStatusIterations(cd *flaggerv1.Canary, val int) error { cdCopy := cd.DeepCopy() cdCopy.Status.Iterations = val diff --git a/pkg/controller/scheduler.go b/pkg/controller/scheduler.go index f9047b75..fd74f939 100644 --- a/pkg/controller/scheduler.go +++ b/pkg/controller/scheduler.go @@ -471,13 +471,6 @@ func (c *Controller) hasCanaryRevisionChanged(cd *flaggerv1.Canary) bool { return false } -func (c *Controller) hasMaxIterations(cd *flaggerv1.Canary) bool { - if cd.Status.Iterations == cd.Status.Iterations { - return true - } - return false -} - func (c *Controller) analyseCanary(r *flaggerv1.Canary) bool { // run external checks for _, webhook := range r.Spec.CanaryAnalysis.Webhooks {