From c0b86dd0685e6c1b68fc40a22af1be56883f56de Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 20 Oct 2024 14:04:07 +0200 Subject: [PATCH 1/2] daemon: remove configsSupported utility This utility was originally added in 9e9fc7b57c1764c008e568ed52bcd1aade7eb40c at which time it was not yet implemented for Windows, so this utility was used to print a warning when trying to use it on that platform. Windows support was added in e0d533b1e8a8dd62ed6dff2dfda3c3220e0474b9, which kept the utility, but adjusted it to support for both Windows and Linux, and excluding any other platform. Let's remove this utility, given that we currently only support Windows and Linux (there's been some partial support for other platforms, but they are very likely broken in many ways). Signed-off-by: Sebastiaan van Stijn --- daemon/configs.go | 8 -------- daemon/configs_linux.go | 5 ----- daemon/configs_unsupported.go | 7 ------- daemon/configs_windows.go | 5 ----- 4 files changed, 25 deletions(-) delete mode 100644 daemon/configs_linux.go delete mode 100644 daemon/configs_unsupported.go delete mode 100644 daemon/configs_windows.go diff --git a/daemon/configs.go b/daemon/configs.go index 57b646b8cc854..97b01ad4c59ae 100644 --- a/daemon/configs.go +++ b/daemon/configs.go @@ -1,19 +1,11 @@ package daemon // import "github.com/docker/docker/daemon" import ( - "context" - - "github.com/containerd/log" swarmtypes "github.com/docker/docker/api/types/swarm" ) // SetContainerConfigReferences sets the container config references needed func (daemon *Daemon) SetContainerConfigReferences(name string, refs []*swarmtypes.ConfigReference) error { - if !configsSupported() && len(refs) > 0 { - log.G(context.TODO()).Warn("configs are not supported on this platform") - return nil - } - c, err := daemon.GetContainer(name) if err != nil { return err diff --git a/daemon/configs_linux.go b/daemon/configs_linux.go deleted file mode 100644 index ceb666337c13c..0000000000000 --- a/daemon/configs_linux.go +++ /dev/null @@ -1,5 +0,0 @@ -package daemon // import "github.com/docker/docker/daemon" - -func configsSupported() bool { - return true -} diff --git a/daemon/configs_unsupported.go b/daemon/configs_unsupported.go deleted file mode 100644 index cb6c59ac29553..0000000000000 --- a/daemon/configs_unsupported.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !linux && !windows - -package daemon // import "github.com/docker/docker/daemon" - -func configsSupported() bool { - return false -} diff --git a/daemon/configs_windows.go b/daemon/configs_windows.go deleted file mode 100644 index ceb666337c13c..0000000000000 --- a/daemon/configs_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package daemon // import "github.com/docker/docker/daemon" - -func configsSupported() bool { - return true -} From 77f97926ad17e4f8de2d877d80d37e1d4b6f7dc2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Sun, 20 Oct 2024 14:10:17 +0200 Subject: [PATCH 2/2] daemon: remove secretsSupported utility This utility was originally added in 3716ec25b423d8ff7dfa231a7b3cf0154726ed37 at which time it was not yet implemented for Windows, so this utility was used to print a warning when trying to use it on that platform. Windows support was added in bd4e8aa64e5e7dedb60ca6670d7ddb32d5af0db9, which kept the utility, but adjusted it to support for both Windows and Linux, and excluding any other platform. Let's remove this utility, given that we currently only support Windows and Linux (there's been some partial support for other platforms, but they are very likely broken in many ways). Signed-off-by: Sebastiaan van Stijn --- daemon/secrets.go | 10 ---------- daemon/secrets_linux.go | 5 ----- daemon/secrets_unsupported.go | 7 ------- daemon/secrets_windows.go | 5 ----- 4 files changed, 27 deletions(-) delete mode 100644 daemon/secrets_linux.go delete mode 100644 daemon/secrets_unsupported.go delete mode 100644 daemon/secrets_windows.go diff --git a/daemon/secrets.go b/daemon/secrets.go index 06c03687b0a53..70d3a5462e506 100644 --- a/daemon/secrets.go +++ b/daemon/secrets.go @@ -1,25 +1,15 @@ package daemon // import "github.com/docker/docker/daemon" import ( - "context" - - "github.com/containerd/log" swarmtypes "github.com/docker/docker/api/types/swarm" ) // SetContainerSecretReferences sets the container secret references needed func (daemon *Daemon) SetContainerSecretReferences(name string, refs []*swarmtypes.SecretReference) error { - if !secretsSupported() && len(refs) > 0 { - log.G(context.TODO()).Warn("secrets are not supported on this platform") - return nil - } - c, err := daemon.GetContainer(name) if err != nil { return err } - c.SecretReferences = refs - return nil } diff --git a/daemon/secrets_linux.go b/daemon/secrets_linux.go deleted file mode 100644 index 2be70be31c17b..0000000000000 --- a/daemon/secrets_linux.go +++ /dev/null @@ -1,5 +0,0 @@ -package daemon // import "github.com/docker/docker/daemon" - -func secretsSupported() bool { - return true -} diff --git a/daemon/secrets_unsupported.go b/daemon/secrets_unsupported.go deleted file mode 100644 index d3bb1becad662..0000000000000 --- a/daemon/secrets_unsupported.go +++ /dev/null @@ -1,7 +0,0 @@ -//go:build !linux && !windows - -package daemon // import "github.com/docker/docker/daemon" - -func secretsSupported() bool { - return false -} diff --git a/daemon/secrets_windows.go b/daemon/secrets_windows.go deleted file mode 100644 index 2be70be31c17b..0000000000000 --- a/daemon/secrets_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package daemon // import "github.com/docker/docker/daemon" - -func secretsSupported() bool { - return true -}