Skip to content

Commit 6a8b588

Browse files
committed
controllers: absolute local path for cached chart
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent 5701b79 commit 6a8b588

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

controllers/helmchart_controller.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,17 @@ func (r *HelmChartReconciler) fromHelmRepository(ctx context.Context, repo sourc
327327
}
328328
}
329329

330-
var cachedChart string
331-
if artifact := c.GetArtifact(); artifact != nil {
332-
cachedChart = artifact.Path
333-
}
334-
335330
// Build the chart
336331
cb := chart.NewRemoteBuilder(chartRepo)
337332
ref := chart.RemoteReference{Name: c.Spec.Chart, Version: c.Spec.Version}
338333
opts := chart.BuildOptions{
339334
ValuesFiles: c.GetValuesFiles(),
340-
CachedChart: cachedChart,
341335
Force: force,
342336
}
337+
if artifact := c.GetArtifact(); artifact != nil {
338+
opts.CachedChart = r.Storage.LocalPath(*artifact)
339+
}
340+
343341
// Set the VersionMetadata to the object's Generation if ValuesFiles is defined
344342
// This ensures changes can be noticed by the Artifact consumer
345343
if len(opts.GetValuesFiles()) > 0 {
@@ -355,7 +353,7 @@ func (r *HelmChartReconciler) fromHelmRepository(ctx context.Context, repo sourc
355353

356354
// If the path of the returned build equals the cache path,
357355
// there are no changes to the chart
358-
if b.Path == cachedChart {
356+
if b.Path == opts.CachedChart {
359357
// Ensure hostname is updated
360358
if c.GetArtifact().URL != newArtifact.URL {
361359
r.Storage.SetArtifactURL(c.GetArtifact())

0 commit comments

Comments
 (0)