hashicorp / terraform-provider-helm

Terraform Helm provider
https://www.terraform.io/docs/providers/helm/
Mozilla Public License 2.0
1.01k stars 371 forks source link

Refactor `ModifyPlan` function in `helm_release.go` (1/2) #1471

Closed BBBmau closed 2 months ago

BBBmau commented 2 months ago

Description

Refactors ModifyPlan() method:

  1. Removes repetitive log outputs of null values
  2. moves logic that checks for metadata fields into it's own recomputeMetadata. Uses plan.Chart.Equal(state.Chart) instead of relying on GetAttribute since metadata fields are in the root.
  3. Refactor of GetAttribute witihin chartVersion condition
  4. refactor valuesKnown in ModifyPlan to also do comparisons of values with plan.Values instead of GetAttribute