Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚀 Update variables reconciliation logic to reduce number of API calls #390

Merged
merged 3 commits into from
Apr 23, 2024

Conversation

arybolovlev
Copy link
Contributor

@arybolovlev arybolovlev commented Apr 18, 2024

Description

This PR introduces changes to variables reconciliation in the workspace controller

  • Extend status with variables status:
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

  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

@arybolovlev arybolovlev marked this pull request as ready for review April 19, 2024 08:30
@arybolovlev arybolovlev requested a review from a team as a code owner April 19, 2024 08:30
Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work, love it!

@arybolovlev arybolovlev merged commit fe8d4a5 into main Apr 23, 2024
7 checks passed
@arybolovlev arybolovlev deleted the update-variables-reconciliation branch April 23, 2024 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants