Skip to content
Permalink
Browse files

ParseManifestsFromDir: improve filename handling

The old code hardcoded a forward slash "/" character which would not
have worked on Windows.
  • Loading branch information
listx committed Oct 11, 2019
1 parent a86d619 commit cd0825edc1d9c21afa6092242f57dd1eb6f12698
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/dockerregistry/inventory.go
@@ -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
}

0 comments on commit cd0825e

Please sign in to comment.
You can’t perform that action at this time.