argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.78k stars 871 forks source link

AnalysisRun Job is terminated when Rollout resource is scaled #3828

Open davcd opened 2 months ago

davcd commented 2 months ago

Checklist:

Describe the bug

Having a Rollout with an Analysis. If Rollout is scaled during the running of the Analysis, the AnalysisRun Job is terminated. Additionally, the Rollout is promoted even when the Analysis has not finished.

To Reproduce

Having the following Rollout resource:

apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: my-rollout
  ...
spec:
  replicas: 3
  ...
  strategy:
    blueGreen:
      activeService: my-service
      previewService: my-service-preview
      prePromotionAnalysis:
        templates:
          - templateName: some-analysis-maybe-e2e

And scaling manually with the following command:

kubectl scale rollout my-rollout --replicas=6

The bug is replicated when the following events occurs:

Expected behaviour

Running AnalysisRun Jobs are not affected when Rollout resource is scaled.

Version v1.7.2+59e5bd3


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

davcd commented 1 day ago

After further investigation, it is possible to conclude that the issue is not related to KEDA/HPA. Steps to reproduce and bug explanations have been simplified.

davcd commented 1 day ago

IMO this bug is critical as some people can be bypassing their application promotion conditions.

As an example, if you have some e2e or contract testing taking place before your promotion and your Rollout is scaled at the moment those Analysis are running, you will promote your new version even when the tests are not completed successfully.