Skip to content

Commit

Permalink
ParseManifestsFromDir: improve filename handling
Browse files Browse the repository at this point in the history
The old code hardcoded a forward slash "/" character which would not
have worked on Windows.
  • Loading branch information
Linus Arver committed Oct 11, 2019
1 parent a86d619 commit cd0825e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/dockerregistry/inventory.go
Expand Up @@ -224,9 +224,10 @@ func ParseManifestsFromDir(
return nil
}

// First try to parse the path as a manifest file. The only requirement
// is that the file must be named "promoter-manifest.yaml".
if !strings.HasSuffix(path, "/promoter-manifest.yaml") {
// First try to parse the path as a manifest file, which must be named
// "promoter-manifest.yaml". This restriction is in place to limit the
// scope of what is read in as a promoter manifest.
if filepath.Base(path) != "promoter-manifest.yaml" {
return nil
}

Expand Down

0 comments on commit cd0825e

Please sign in to comment.