diff options
author | Sebastiaan van Stijn <github@gone.nl> | 2022-10-19 15:29:16 +0200 |
---|---|---|
committer | Sebastiaan van Stijn <github@gone.nl> | 2022-11-28 20:29:19 +0100 |
commit | 5cdd6ab7cd4af97da2150cd649acfdb19ea8d700 (patch) | |
tree | 7e06a1e13ef8ac32676ac2b1a0c0bf199d3ec039 /daemon/daemon.go | |
parent | 1981706196164984ea6b75f0c8b7318c7fd6ca5a (diff) | |
download | docker-5cdd6ab7cd4af97da2150cd649acfdb19ea8d700.tar.gz |
daemon/config: remove TrustKeyPath, and local utilities
Turned out that the loadOrCreateTrustKey() utility was doing exactly the
same as libtrust.LoadOrCreateTrustKey(), so making it a thin wrapped. I kept
the tests to verify the behavior, but we could remove them as we only need this
for our integration tests.
The storage location for the generated key was changed (again as we only need
this for some integration tests), so we can remove the TrustKeyPath from the
config.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'daemon/daemon.go')
-rw-r--r-- | daemon/daemon.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/daemon/daemon.go b/daemon/daemon.go index 5aeb8ac2f2..eb2377eea5 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -1062,13 +1062,13 @@ func NewDaemon(ctx context.Context, config *config.Config, pluginStore *plugin.S // manifest v2 schema 1 images to test-registries used for testing *pulling* // these images. if os.Getenv("DOCKER_ALLOW_SCHEMA1_PUSH_DONOTUSE") != "" { - imgSvcConfig.TrustKey, err = loadOrCreateTrustKey(config.TrustKeyPath) + // Previously, this was stored in the daemon's config-directory, but + // as pushing V1 is deprecated, and we only need this file during + // our integration tests, just store it within the "trust" directory. + imgSvcConfig.TrustKey, err = loadOrCreateTrustKey(filepath.Join(config.Root, "trust", "key.json")) if err != nil { return nil, err } - if err = os.Mkdir(filepath.Join(config.Root, "trust"), 0o700); err != nil && !errors.Is(err, os.ErrExist) { - return nil, err - } } // containerd is not currently supported with Windows. |