mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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>
(cherry picked from commit 5cdd6ab7cd)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
104 lines
2.4 KiB
Go
104 lines
2.4 KiB
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
"time"
|
|
|
|
"github.com/docker/docker/daemon/config"
|
|
"github.com/docker/docker/libcontainerd/supervisor"
|
|
"github.com/docker/docker/pkg/system"
|
|
"github.com/sirupsen/logrus"
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func getDefaultDaemonConfigFile() (string, error) {
|
|
return "", nil
|
|
}
|
|
|
|
// setDefaultUmask doesn't do anything on windows
|
|
func setDefaultUmask() error {
|
|
return nil
|
|
}
|
|
|
|
func getDaemonConfDir(root string) (string, error) {
|
|
return filepath.Join(root, "config"), nil
|
|
}
|
|
|
|
// preNotifyReady sends a message to the host when the API is active, but before the daemon is
|
|
func preNotifyReady() {
|
|
// start the service now to prevent timeouts waiting for daemon to start
|
|
// but still (eventually) complete all requests that are sent after this
|
|
if service != nil {
|
|
err := service.started()
|
|
if err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
}
|
|
}
|
|
|
|
// notifyReady sends a message to the host when the server is ready to be used
|
|
func notifyReady() {
|
|
}
|
|
|
|
// notifyStopping sends a message to the host when the server is shutting down
|
|
func notifyStopping() {
|
|
}
|
|
|
|
// notifyShutdown is called after the daemon shuts down but before the process exits.
|
|
func notifyShutdown(err error) {
|
|
if service != nil {
|
|
if err != nil {
|
|
logrus.Fatal(err)
|
|
}
|
|
service.stopped(err)
|
|
}
|
|
}
|
|
|
|
func (cli *DaemonCli) getPlatformContainerdDaemonOpts() ([]supervisor.DaemonOpt, error) {
|
|
return nil, nil
|
|
}
|
|
|
|
// setupConfigReloadTrap configures a Win32 event to reload the configuration.
|
|
func (cli *DaemonCli) setupConfigReloadTrap() {
|
|
go func() {
|
|
sa := windows.SecurityAttributes{
|
|
Length: 0,
|
|
}
|
|
event := "Global\\docker-daemon-config-" + fmt.Sprint(os.Getpid())
|
|
ev, _ := windows.UTF16PtrFromString(event)
|
|
if h, _ := windows.CreateEvent(&sa, 0, 0, ev); h != 0 {
|
|
logrus.Debugf("Config reload - waiting signal at %s", event)
|
|
for {
|
|
windows.WaitForSingleObject(h, windows.INFINITE)
|
|
cli.reloadConfig()
|
|
}
|
|
}
|
|
}()
|
|
}
|
|
|
|
// getSwarmRunRoot gets the root directory for swarm to store runtime state
|
|
// For example, the control socket
|
|
func (cli *DaemonCli) getSwarmRunRoot() string {
|
|
return ""
|
|
}
|
|
|
|
func allocateDaemonPort(addr string) error {
|
|
return nil
|
|
}
|
|
|
|
func newCgroupParent(config *config.Config) string {
|
|
return ""
|
|
}
|
|
|
|
func (cli *DaemonCli) initContainerD(_ context.Context) (func(time.Duration) error, error) {
|
|
system.InitContainerdRuntime(cli.Config.ContainerdAddr)
|
|
return nil, nil
|
|
}
|
|
|
|
func validateCPURealtimeOptions(_ *config.Config) error {
|
|
return nil
|
|
}
|