argoproj-labs / argocd-operator

A Kubernetes operator for managing Argo CD clusters.
https://argocd-operator.readthedocs.io
Apache License 2.0
596 stars 627 forks source link

fix: don't change the default policy to reencrypt if the TLS secret is already present #1401

Closed chetan-rns closed 1 month ago

chetan-rns commented 1 month ago

What type of PR is this?

/kind bug

What does this PR do / why we need it:

https://github.com/argoproj-labs/argocd-operator/pull/1363 changed the default termination policy from passthrough to reencrypt. However, there could be some users who have configured the old passthrough Route with a custom certificate before the upgrade. We don't want to overwrite their configuration once they upgrade the operator.

This PR introduces logic to update the Route to renencrypt only if the "argocd-server-tls` secret is not present.

Have you updated the necessary documentation?

Which issue(s) this PR fixes:

Fixes #?

How to test changes / Special notes to the reviewer:

  1. Install/Run an older version of the operator that still has Passthrough as default.
  2. Verify that the Route is using the Passthrough policy. Configure a custom TLS secret "argocd-server-tls" using OpenSSL.
  3. Run the operator with the changes in this PR
  4. The route shouldn't be updated to reenecrypt.
chetan-rns commented 1 month ago

Story: https://issues.redhat.com/browse/GITOPS-4778