Skip to content

Conversation

@lepichon
Copy link

Description

This PR updates the convertProjectEnvironmentModelToEnvironmentRequest function to correctly handle environment secrets when creating or updating a project environment. Previously, secrets were either ignored or incorrectly converted, causing issues when applying Terraform plans.

Changes

  • Iterates over env.Secrets and creates EnvironmentSecretRequest objects.
  • Properly sets the Operation field for create, update, and delete.
  • Ensures that only changed secrets are marked for update, unchanged secrets are left intact.
  • Deletes secrets present in the previous state but missing in the current plan.

Testing

  • Verified creating a new environment with secrets creates correct EnvironmentSecretRequest objects.
  • Verified updating secrets triggers the update operation only for changed secrets.
  • Verified deleting secrets triggers the delete operation.
  • Terraform state remains consistent after apply.

@lepichon lepichon closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant