Skip to content

Commit

Permalink
wolfictl: strip urls from key names
Browse files Browse the repository at this point in the history
This makes it consistent with how apko and melange are using keys. We
will follow up with a PR in apko to reject key with '/' in the name.

Signed-off-by: Nghia Tran <[email protected]>
  • Loading branch information
tcnghia committed Jan 23, 2025
1 parent 264460c commit 8340320
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pkg/dag/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net/http"
"net/url"
"os"
"path"
"reflect"
"sort"
"strings"
Expand Down Expand Up @@ -196,9 +197,6 @@ func (g *Graph) addResolverForRepos(ctx context.Context, arch string, localRepo
var (
repos []string
lookupRepos = []apk.NamedIndex{}
// validKeys contains list of keys valid for this package; as opposed to
// keys, which is the master list of all keys we have encountered
validKeys = map[string][]byte{}
)
for _, repo := range addRepos {
key := apk.IndexURL(repo, arch)
Expand All @@ -210,8 +208,8 @@ func (g *Graph) addResolverForRepos(ctx context.Context, arch string, localRepo
}
// ensure any keys listed in this package are in the master map of keys
for _, key := range addKeys {
if _, ok := allKeys[key]; ok {
validKeys[key] = allKeys[key]
keyname := path.Base(key)
if _, ok := allKeys[keyname]; ok {
continue
}
b, err := getKeyMaterial(key)
Expand All @@ -220,8 +218,7 @@ func (g *Graph) addResolverForRepos(ctx context.Context, arch string, localRepo
}
// we can have no error, but still no bytes, as we ignore missing files
if b != nil {
allKeys[key] = b
validKeys[key] = b
allKeys[keyname] = b
}
}
if len(repos) > 0 {
Expand Down

0 comments on commit 8340320

Please sign in to comment.