registry: deprecate SetCertsDir, HostCertsDir#49612
Merged
thaJeztah merged 4 commits intomoby:masterfrom Mar 10, 2025
Merged
Conversation
ed3c952 to
5483826
Compare
This function had to be called both in the daemon startup, as well as the CLI startup. Which, in case of the cli, meant that the registry package became a required dependency for all CLI-plugins. Make the package itself aware of situations where it's running with rootlessKit enabled. Altogether we should get rid of this package-level variable, and instead store this in our configuration, and pass through where it's used. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
[homedir.GetConfigHome] only returns an error if the value is empty, so we can check for a non-empty value instead of an error, which also means that this value would never be empty. [homedir.GetConfigHome]: https://github.com/moby/moby/blob/b4bdf12daec84caaf809a639f923f7370d4926ad/pkg/homedir/homedir_linux.go#L86-L95 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function was only used internally, but it still has at least one external consumer, so adding a "deprecated" comment. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function needs more cleaning up, because hitting either a ".cert" or a ".key" file means that we're doing an extra loop over all files to see if the corresponding file is also present, but let's start with only processing each file once by using a switch; https://github.com/moby/moby/blob/b4bdf12daec84caaf809a639f923f7370d4926ad/registry/registry.go#L81 https://github.com/moby/moby/blob/b4bdf12daec84caaf809a639f923f7370d4926ad/registry/registry.go#L94 https://github.com/moby/moby/blob/b4bdf12daec84caaf809a639f923f7370d4926ad/registry/registry.go#L43-L50 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
5483826 to
0f11ee1
Compare
dmcgowan
approved these changes
Mar 10, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
registry: deprecate SetCertsDir
This function had to be called both in the daemon startup, as well as
the CLI startup. Which, in case of the cli, meant that the registry
package became a required dependency for all CLI-plugins.
Make the package itself aware of situations where it's running with
rootlessKit enabled. Altogether we should get rid of this package-level
variable, and instead store this in our configuration, and pass through
where it's used.
registry: always set a non-empty CertDir
homedir.GetConfigHome only returns an error if the value is empty,
so we can check for a non-empty value instead of an error, which also
means that this value would never be empty.
registry: remove uses of exported HostCertsDir
This function was only used internally, but it still has at least one
external consumer.
registry: ReadCertsDirectory: don't process same file multiple times
This function needs more cleaning up, because hitting either a ".cert" or
a ".key" file means that we're doing an extra loop over all files to see
if the corresponding file is also present, but let's start with only
processing each file once by using a switch;
moby/registry/registry.go
Line 81 in b4bdf12
moby/registry/registry.go
Line 94 in b4bdf12
moby/registry/registry.go
Lines 43 to 50 in b4bdf12
- Human readable description for the release notes
- A picture of a cute animal (not mandatory but encouraged)