-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cli/trust: remove special handling for "plugin" Class #4114
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
cli/trust: remove special handling for "plugin" Class #4114
Conversation
cli/trust/trust.go
Outdated
| Repository: repoInfo.Name.Name(), | ||
| Actions: actions, | ||
| Class: repoInfo.Class, | ||
| Class: repoInfo.Class, // TODO(thaJeztah): if Class is no longer needed for plugins, does that mean we can remove it as a whole? |
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.
... and now I'm wondering if this Class is needed at all anymore (of there's only "image" or "").
I do see some handling in "distribution"; https://github.com/distribution/distribution/blob/e5d5810851d1f17a5070e9b6f940d8af98ea3c29/registry/client/auth/session.go#L154-L164
// String returns the string representation of the repository
// using the scope grammar
func (rs RepositoryScope) String() string {
repoType := "repository"
// Keep existing format for image class to maintain backwards compatibility
// with authorization servers which do not support the expanded grammar.
if rs.Class != "" && rs.Class != "image" {
repoType = fmt.Sprintf("%s(%s)", repoType, rs.Class)
}
return fmt.Sprintf("%s:%s:%s", repoType, rs.Repository, strings.Join(rs.Actions, ","))
}And that looks to be "only if it's NOT "" or "image"
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #4114 +/- ##
==========================================
+ Coverage 59.14% 59.16% +0.01%
==========================================
Files 287 287
Lines 24741 24717 -24
==========================================
- Hits 14634 14623 -11
+ Misses 9221 9210 -11
+ Partials 886 884 -2 |
2dc9fb9 to
46095c6
Compare
This code depended on the registry Service interface, which has been removed, so needed to be refactored. Digging further into the reason this code existed, it looked like the Class=plugin was previously required on Docker Hub to handle plugins, but this requirement is no longer there, so we can remove this special handling. This patch removes the special handling to both remove the use of the registry.Service interface, as well as removing complexity that is no longer needed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
46095c6 to
0ba820e
Compare
This code depended on the registry Service interface, which has been removed,
so needed to be refactored. Digging further into the reason this code existed,
it looked like the Class=plugin was previously required on Docker Hub to handle
plugins, but this requirement is no longer there, so we can remove this special
handling.
This patch removes the special handling to both remove the use of the registry.Service
interface, as well as removing complexity that is no longer needed.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)