mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
registry: ParseRepositoryInfo: remove some intermediate vars
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -417,7 +417,6 @@ func newRepositoryInfo(config *serviceConfig, name reference.Named) *RepositoryI
|
||||
func ParseRepositoryInfo(reposName reference.Named) (*RepositoryInfo, error) {
|
||||
indexName := normalizeIndexName(reference.Domain(reposName))
|
||||
if indexName == IndexName {
|
||||
officialRepo := !strings.ContainsRune(reference.FamiliarName(reposName), '/')
|
||||
return &RepositoryInfo{
|
||||
Name: reference.TrimNamed(reposName),
|
||||
Index: ®istry.IndexInfo{
|
||||
@@ -426,21 +425,16 @@ func ParseRepositoryInfo(reposName reference.Named) (*RepositoryInfo, error) {
|
||||
Secure: true,
|
||||
Official: true,
|
||||
},
|
||||
Official: officialRepo,
|
||||
Official: !strings.ContainsRune(reference.FamiliarName(reposName), '/'),
|
||||
}, nil
|
||||
}
|
||||
|
||||
insecure := false
|
||||
if isInsecure(indexName) {
|
||||
insecure = true
|
||||
}
|
||||
|
||||
return &RepositoryInfo{
|
||||
Name: reference.TrimNamed(reposName),
|
||||
Index: ®istry.IndexInfo{
|
||||
Name: indexName,
|
||||
Mirrors: []string{},
|
||||
Secure: !insecure,
|
||||
Secure: !isInsecure(indexName),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user