Skip to content

Commit

Permalink
Fix manifest diffs for OCI charts (#1326)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmckeen committed Mar 14, 2024
1 parent a892aa7 commit d533734
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/1326.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
`provider`: Fix manifest diff rendering for OCI charts.
```
7 changes: 4 additions & 3 deletions helm/resource_release.go
Original file line number Diff line number Diff line change
Expand Up @@ -856,16 +856,17 @@ func resourceDiff(ctx context.Context, d *schema.ResourceDiff, meta interface{})
}
}

var chartPathOpts action.ChartPathOptions
cpo, chartName, err := chartPathOptions(d, m, &chartPathOpts)
client := action.NewInstall(actionConfig)

cpo, chartName, err := chartPathOptions(d, m, &client.ChartPathOptions)
if err != nil {
return err
}

// Get Chart metadata, if we fail - we're done
chart, path, err := getChart(d, meta.(*Meta), chartName, cpo)
if err != nil {
return nil
return err

This comment has been minimized.

Copy link
@shuliakovsky

shuliakovsky Apr 5, 2024

Working example with version 2.12.1

resource "local_file" "this" {
  count    = length(local.template_files) # Define right template
  filename = "${path.module}/${var.eks_cluster_name}/helm/${var.project}/${local.template_files[count.index]}"
  content  = templatefile("${path.module}/templates/${local.template_files[count.index]}", local.helmChartVariables)
}

resource "time_sleep" "wait_15_seconds" {
  depends_on      = [local_file.this]
  create_duration = "15s"
  triggers = {
    always_run = timestamp() # Always run
  }
}
# Deploy rendered helm-chart
resource "helm_release" "this" {
  name      = var.project
  chart     = "${path.module}/${var.eks_cluster_name}/helm/${var.project}"
  namespace = var.environment
  wait      = true
  timeout   = 600
  depends_on = [
    local_file.this,
    time_sleep.wait_15_seconds,
  ]
}

In case of executing terraform plan with version 2.13.0- error will be happened, so return nil during plan should be used

}
debug("%s Got chart", logID)

Expand Down

0 comments on commit d533734

Please sign in to comment.