-
Notifications
You must be signed in to change notification settings - Fork 782
update canary status before eventing #1780
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -318,6 +318,19 @@ func (c *Controller) advanceCanary(name string, namespace string) { | |
|
|
||
| // check if canary revision changed during analysis | ||
| if restart := c.hasCanaryRevisionChanged(cd, canaryController); restart { | ||
| // update canary status to ensure checksum is up to date in all webhooks | ||
| if err := canaryController.SyncStatus(cd, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing}); err != nil { | ||
| c.logger.With("canary", fmt.Sprintf("%s.%s", cd.Name, cd.Namespace)).Errorf("%v", err) | ||
| return | ||
| } | ||
|
|
||
| // Get updated version of canary | ||
| cd, err = c.flaggerClient.FlaggerV1beta1().Canaries(cd.Namespace).Get(context.TODO(), cd.Name, metav1.GetOptions{}) | ||
| if err != nil { | ||
| c.logger.With("canary", fmt.Sprintf("%s.%s", cd.Name, cd.Namespace)).Errorf("%v", err) | ||
| return | ||
| } | ||
|
|
||
| c.recordEventInfof(cd, "New revision detected! Restarting analysis for %s.%s", | ||
| cd.Spec.TargetRef.Name, cd.Namespace) | ||
|
|
||
|
|
@@ -738,7 +751,7 @@ func (c *Controller) runAnalysis(canary *flaggerv1.Canary) bool { | |
| if webhook.Type == "" || webhook.Type == flaggerv1.RolloutHook { | ||
| err := CallWebhook(*canary, flaggerv1.CanaryPhaseProgressing, webhook) | ||
| if err != nil { | ||
| c.recordEventWarningf(canary, "Halt %s.%s advancement external check %s failed %v", | ||
| c.recordEventWarningf(canary, "Halt %s.%s advancement external check %s failed: %v", | ||
| canary.Name, canary.Namespace, webhook.Name, err) | ||
| return false | ||
| } | ||
|
|
@@ -866,6 +879,12 @@ func (c *Controller) checkCanaryStatus(canary *flaggerv1.Canary, canaryControlle | |
| } | ||
|
|
||
| var err error | ||
| // update canary status to ensure checksum is up to date in all webhooks | ||
| if err := canaryController.SyncStatus(canary, flaggerv1.CanaryStatus{Phase: flaggerv1.CanaryPhaseProgressing}); err != nil { | ||
|
||
| c.logger.With("canary", fmt.Sprintf("%s.%s", canary.Name, canary.Namespace)).Errorf("%v", err) | ||
| return false | ||
| } | ||
|
|
||
| canary, err = c.flaggerClient.FlaggerV1beta1().Canaries(canary.Namespace).Get(context.TODO(), canary.Name, metav1.GetOptions{}) | ||
| if err != nil { | ||
| c.logger.With("canary", fmt.Sprintf("%s.%s", canary.Name, canary.Namespace)).Errorf("%v", err) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.