flagger icon indicating copy to clipboard operation
flagger copied to clipboard

FR: Support spec.skipAnalysis attribute value from Deployment annotations

Open canidam opened this issue 3 years ago • 0 comments

Describe the feature

It is obvious that sometimes you need to deploy straight to production. Flagger offers this functionality with spec.skipAnalysis attribute.

In order to enable that, the user needs to patch the Canary resource before or during the deployment of an emergency fix. They also needs to remember enabling it after.

This is a challenge for systems that aren't ready for CD tools, where deployments are triggered by Operators and aren't driven by Git repository.

What if, instead of patching the Canary resource Flagger API would support annotations on deployment resource? something like this would be possible:

helm upgrade -i myapp --set deployment.annotations."flagger\.app/skipAnalysis"=true

This has few advantages:

  1. The user simply patch a specific deployment without modifying the Canary resource
  2. The user don't need to change it back the once the emergency is over
  3. Much easier to integrate with CI systems, as you simply add a checkbox for "skipAnalysis" and append CLI options.
  4. Easier for operators to grasp, if they weren't the ones who set up Flagger

This can be added to today's behavior so it won't change the current behavior and eliminate any drawbacks.

The logic:

  1. Check .spec.skipAnalysis
  2. If false: Check deployment annotations
  3. Rest is the same

canidam avatar Mar 12 '22 21:03 canidam