@@ -196,7 +196,12 @@ func (r *HelmChartReconciler) reconcileFromHelmRepository(ctx context.Context,
196196 }
197197
198198 // return early on unchanged chart version
199+ artifact := r .Storage .NewArtifactFor (chart .Kind , chart .GetObjectMeta (), cv .Version , fmt .Sprintf ("%s-%s.tgz" , cv .Name , cv .Version ))
199200 if repository .GetArtifact () != nil && repository .GetArtifact ().Revision == cv .Version {
201+ if artifact .URL != repository .GetArtifact ().URL {
202+ r .Storage .SetArtifactURL (repository .GetArtifact ())
203+ repository .Status .URL = r .Storage .SetHostname (repository .Status .URL )
204+ }
200205 return chart , nil
201206 }
202207
@@ -260,8 +265,6 @@ func (r *HelmChartReconciler) reconcileFromHelmRepository(ctx context.Context,
260265 return sourcev1 .HelmChartNotReady (chart , sourcev1 .ChartPullFailedReason , err .Error ()), err
261266 }
262267
263- artifact := r .Storage .NewArtifactFor (chart .Kind , chart .GetObjectMeta (), cv .Version , fmt .Sprintf ("%s-%s.tgz" , cv .Name , cv .Version ))
264-
265268 // create artifact dir
266269 err = r .Storage .MkdirAll (artifact )
267270 if err != nil {
@@ -359,12 +362,15 @@ func (r *HelmChartReconciler) reconcileFromGitRepository(ctx context.Context,
359362 }
360363
361364 // return early on unchanged chart version
365+ artifact := r .Storage .NewArtifactFor (chart .Kind , chart .ObjectMeta .GetObjectMeta (), chartMetadata .Version , fmt .Sprintf ("%s-%s.tgz" , chartMetadata .Name , chartMetadata .Version ))
362366 if chart .GetArtifact () != nil && chart .GetArtifact ().Revision == chartMetadata .Version {
367+ if artifact .URL != repository .GetArtifact ().URL {
368+ r .Storage .SetArtifactURL (repository .GetArtifact ())
369+ repository .Status .URL = r .Storage .SetHostname (repository .Status .URL )
370+ }
363371 return chart , nil
364372 }
365373
366- artifact := r .Storage .NewArtifactFor (chart .Kind , chart .ObjectMeta .GetObjectMeta (), chartMetadata .Version , fmt .Sprintf ("%s-%s.tgz" , chartMetadata .Name , chartMetadata .Version ))
367-
368374 // create artifact dir
369375 err = r .Storage .MkdirAll (artifact )
370376 if err != nil {
0 commit comments