astronomer / astro-cli

CLI that makes it easy to create, test and deploy Airflow DAGs to Astronomer
https://www.astronomer.io
Other
350 stars 70 forks source link

Secret Env Vars overwritten to blank strings when updating via deployment file #1593

Closed seanmuth closed 5 months ago

seanmuth commented 7 months ago

Describe the bug

Updating the deployment with a deployment file, which contains secrets:

deployment:
    environment_variables:
        - is_secret: false
          key: AIRFLOW__CORE__PARALLELISM
          value: "12"
        - is_secret: true
          key: DATADOG_API_KEY
          value: ""
...

Actually overwrites the DATADOG_API_KEY with a blank string, rather than not updating the secret.

❯ astro deployment update cltg6k76r01iu01mwzcs76vb0 --deployment-file sean-secrets-test-deploymentfile.yaml
deployment:
    environment_variables:
        - is_secret: false
          key: AIRFLOW__CORE__PARALLELISM
          updated_at: "2024-03-08T15:19:42.297868972Z"
          value: "12"
        - is_secret: true
          key: DATADOG_API_KEY
          updated_at: "2024-03-08T15:19:42.297935973Z"
          value: ""

What CLI Version did you experience this bug?

1.24.1

This CLI bug is related to which Astronomer Platform?

What Operating System is the above CLI installed on?

macOS 13.4

🪜 Steps To Reproduce

  1. Make a secret var in a deployment
  2. Create deploymentfile, update other vars, leaving the secret as-is
  3. Update deployment using deploymentfile
  4. Secret will have it's value changed to blank string