Skip to content

Commit

Permalink
Check if skippedFiles directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jul 24, 2020
1 parent a5ee157 commit 866834c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion kotsadm/pkg/handlers/download.go
Expand Up @@ -86,8 +86,13 @@ func DownloadApp(w http.ResponseWriter, r *http.Request) {
filepath.Join(archivePath, "upstream"),
filepath.Join(archivePath, "base"),
filepath.Join(archivePath, "overlays"),
filepath.Join(archivePath, "skippedFiles"),
}

skippedFilesPath := filepath.Join(archivePath, "skippedFiles")
if _, err := os.Stat(skippedFilesPath); err == nil {
paths = append(paths, skippedFilesPath)
}

tmpDir, err := ioutil.TempDir("", "kotsadm")
if err != nil {
logger.Error(err)
Expand Down
6 changes: 5 additions & 1 deletion kotsadm/pkg/version/archive.go
Expand Up @@ -32,7 +32,11 @@ func CreateAppVersionArchive(appID string, sequence int64, archivePath string) e
filepath.Join(archivePath, "upstream"),
filepath.Join(archivePath, "base"),
filepath.Join(archivePath, "overlays"),
filepath.Join(archivePath, "skippedFiles"),
}

skippedFilesPath := filepath.Join(archivePath, "skippedFiles")
if _, err := os.Stat(skippedFilesPath); err == nil {
paths = append(paths, skippedFilesPath)
}

tmpDir, err := ioutil.TempDir("", "kotsadm")
Expand Down

0 comments on commit 866834c

Please sign in to comment.