Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion controllers/helmchart_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"time"

Expand Down Expand Up @@ -383,7 +384,7 @@ func (r *HelmChartReconciler) reconcileFromGitRepository(ctx context.Context,

// package chart
pkg := action.NewPackage()
pkg.Destination = artifact.Path
pkg.Destination = filepath.Dir(artifact.Path)
_, err = pkg.Run(chartPath, nil)
if err != nil {
err = fmt.Errorf("chart package error: %w", err)
Expand Down
8 changes: 5 additions & 3 deletions controllers/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ func (s *Storage) RemoveAllButCurrent(artifact sourcev1.Artifact) error {
return nil
}

// ArtifactExist returns a boolean indicating whether the artifact file exists in storage
// ArtifactExist returns a boolean indicating whether the artifact exists in storage and is a
// regular file.
func (s *Storage) ArtifactExist(artifact sourcev1.Artifact) bool {
if _, err := os.Stat(artifact.Path); os.IsNotExist(err) {
fi, err := os.Lstat(artifact.Path)
if err != nil {
return false
}
return true
return fi.Mode().IsRegular()
}

// Archive creates a tar.gz to the artifact path from the given dir excluding any VCS specific
Expand Down