Skip to content

Commit 3cdc897

Browse files
committed
Assume local dependency without Helm repository
This commit fixes a bug where local chart dependencies would not be detected correctly due to the absence of a repository URL. Signed-off-by: Hidde Beydals <[email protected]>
1 parent 83da57d commit 3cdc897

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

controllers/helmchart_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ func (r *HelmChartReconciler) reconcileFromTarballArtifact(ctx context.Context,
537537
}
538538

539539
// Continue loop if file scheme detected
540-
if strings.HasPrefix(dep.Repository, "file://") {
540+
if dep.Repository == "" || strings.HasPrefix(dep.Repository, "file://") {
541541
dwr = append(dwr, &helm.DependencyWithRepository{
542542
Dependency: dep,
543543
Repository: nil,

internal/helm/dependency_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func (dm *DependencyManager) secureLocalChartPath(dep *DependencyWithRepository)
156156
if err != nil {
157157
return "", fmt.Errorf("failed to parse alleged local chart reference: %w", err)
158158
}
159-
if localUrl.Scheme != "file" {
159+
if localUrl.Scheme != "" && localUrl.Scheme != "file" {
160160
return "", fmt.Errorf("'%s' is not a local chart reference", dep.Dependency.Repository)
161161
}
162162
return securejoin.SecureJoin(dm.WorkingDir, filepath.Join(dm.ChartPath, localUrl.Host, localUrl.Path))

0 commit comments

Comments
 (0)