forked from distribution/distribution
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add RC1 Support #12
Merged
Merged
Add RC1 Support #12
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5ed20d3
update artifact spec; first attempt at referrer filter and sort
akashsinghal cf3aebc
add protoype filter/sort; add registry wide discover api; update disc…
akashsinghal 6fd6f87
fix discover for registry wide scope; change referrers response name
akashsinghal 47807a5
removing todo comment; adding route optimization
akashsinghal 9f18901
implement pagination
akashsinghal 8d01fd9
address comments; add multi digest nextToken support
akashsinghal b2a52bc
adding artifact manifest tests
akashsinghal c584a34
adding api test for referrers
akashsinghal 04d5f71
address comments
akashsinghal aca7490
fix tests breaking with make command
akashsinghal d4c3462
addressing more comments
akashsinghal 461316a
remove annotations from referrers response
akashsinghal 29cddca
update max referrer page size to 100
akashsinghal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
package extension | ||
|
||
import ( | ||
"context" | ||
c "context" | ||
"fmt" | ||
"net/http" | ||
|
@@ -72,27 +71,31 @@ type EnumerateExtension struct { | |
var extensions map[string]InitExtensionNamespace | ||
var extensionsNamespaces map[string]Namespace | ||
|
||
func EnumerateRegistered(ctx context.Context) (enumeratedExtensions []EnumerateExtension) { | ||
func EnumerateRegistered(ctx Context) (enumeratedExtensions []EnumerateExtension) { | ||
for _, namespace := range extensionsNamespaces { | ||
enumerateExtension := EnumerateExtension{ | ||
Name: namespace.GetNamespaceName(), | ||
Url: namespace.GetNamespaceUrl(), | ||
Description: namespace.GetNamespaceDescription(), | ||
Endpoints: []string{}, | ||
} | ||
|
||
registryScoped := namespace.GetRegistryRoutes() | ||
for _, regScoped := range registryScoped { | ||
path := fmt.Sprintf("_%s/%s/%s", regScoped.Namespace, regScoped.Extension, regScoped.Component) | ||
enumerateExtension.Endpoints = append(enumerateExtension.Endpoints, path) | ||
scopedRoutes := namespace.GetRepositoryRoutes() | ||
|
||
// if the repository is not set in the context, scope is registry wide | ||
if ctx.Repository == nil { | ||
scopedRoutes = namespace.GetRegistryRoutes() | ||
} | ||
|
||
repositoryScoped := namespace.GetRepositoryRoutes() | ||
for _, repScoped := range repositoryScoped { | ||
path := fmt.Sprintf("_%s/%s/%s", repScoped.Namespace, repScoped.Extension, repScoped.Component) | ||
for _, route := range scopedRoutes { | ||
path := fmt.Sprintf("_%s/%s/%s", route.Namespace, route.Extension, route.Component) | ||
enumerateExtension.Endpoints = append(enumerateExtension.Endpoints, path) | ||
} | ||
|
||
enumeratedExtensions = append(enumeratedExtensions, enumerateExtension) | ||
// add extension to list if endpoints exist | ||
if len(enumerateExtension.Endpoints) > 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just looking for some context on the changes to this file.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
enumeratedExtensions = append(enumeratedExtensions, enumerateExtension) | ||
} | ||
} | ||
|
||
return enumeratedExtensions | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been giving this some thought myself, but we may want to introduce some way to register errors from the extension API itself.