Skip to content

Commit

Permalink
Merge pull request #1414 from tcnghia/key-name-no-url
Browse files Browse the repository at this point in the history
wolfictl: strip urls from key names when calling `apk.GetRepositoryIndexes`
  • Loading branch information
tcnghia authored Jan 23, 2025
2 parents 264460c + 8340320 commit 575630c
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 575630c

Please sign in to comment.