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 <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2021-01-28 12:25:44 +01:00
parent 83da57d7d9
commit 3cdc897236
2 changed files with 2 additions and 2 deletions

View File

@ -537,7 +537,7 @@ func (r *HelmChartReconciler) reconcileFromTarballArtifact(ctx context.Context,
}
// Continue loop if file scheme detected
if strings.HasPrefix(dep.Repository, "file://") {
if dep.Repository == "" || strings.HasPrefix(dep.Repository, "file://") {
dwr = append(dwr, &helm.DependencyWithRepository{
Dependency: dep,
Repository: nil,

View File

@ -156,7 +156,7 @@ func (dm *DependencyManager) secureLocalChartPath(dep *DependencyWithRepository)
if err != nil {
return "", fmt.Errorf("failed to parse alleged local chart reference: %w", err)
}
if localUrl.Scheme != "file" {
if localUrl.Scheme != "" && localUrl.Scheme != "file" {
return "", fmt.Errorf("'%s' is not a local chart reference", dep.Dependency.Repository)
}
return securejoin.SecureJoin(dm.WorkingDir, filepath.Join(dm.ChartPath, localUrl.Host, localUrl.Path))