hashicorp / terraform-cloud-operator

Kubernetes Operator allows managing HCP Terraform resources via Kubernetes Custom Resources.
https://developer.hashicorp.com/terraform/cloud-docs
Mozilla Public License 2.0
114 stars 27 forks source link

šŸš€ Update variables reconciliation logic to reduce number of API calls #390

Closed arybolovlev closed 2 months ago

arybolovlev commented 2 months ago

Description

This PR introduces changes to variables reconciliation in the workspace controller

status:
  variables:
    - category: terraform
      id: var-a1hnPzjknedvkoky
      name: username_length
      valueID: 7269bfbb3a64c5a26effe18028e5362f989cf71905038f90da60eefa619b8946
      versionID: 951e711fc7b19146cafedeefb9b092d75c0497420876bef00fa17d57f7b27e20

status.variables.[*].versionID and status.variables.[*].valueID are hashes of a variable on the HCP Terraform and HCP Terraform Operator sides, respectively. Tracking these values allows variables to be updated when they have changed. Previously, sensitive variables were constantly updated during each reconciliation due to their nature, resulting in unnecessary API calls.

Tests

Usage Example

N/A.

References

N/a.

Community Note