From bb56c4d7e78a77e9abb2a0fb01315041f3549801 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 11 Nov 2025 09:05:41 +0100 Subject: [PATCH] daemon: remove some deprecated and unused code Signed-off-by: Sebastiaan van Stijn --- daemon/container.go | 7 ------- daemon/internal/layer/layer.go | 8 -------- daemon/libnetwork/discoverapi/discoverapi.go | 10 ---------- daemon/pkg/oci/oci.go | 15 --------------- 4 files changed, 40 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index a0f512daac..dd7f82dae1 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -86,13 +86,6 @@ func (daemon *Daemon) load(id string) (*container.Container, error) { return ctr, nil } -// Register makes a container object usable by the daemon as -// -// Deprecated: this function is unused and will be removed in the next release. -func (daemon *Daemon) Register(c *container.Container) error { - return daemon.register(context.TODO(), c) -} - // register makes a container object usable by the daemon as [container.Container.ID]. func (daemon *Daemon) register(ctx context.Context, c *container.Container) error { // Attach to stdout and stderr diff --git a/daemon/internal/layer/layer.go b/daemon/internal/layer/layer.go index b044b24b16..0c7c32207f 100644 --- a/daemon/internal/layer/layer.go +++ b/daemon/internal/layer/layer.go @@ -18,7 +18,6 @@ import ( "github.com/docker/distribution" "github.com/moby/go-archive" "github.com/opencontainers/go-digest" - "github.com/opencontainers/image-spec/identity" ) var ( @@ -180,13 +179,6 @@ type DescribableStore interface { RegisterWithDescriptor(io.Reader, ChainID, distribution.Descriptor) (Layer, error) } -// CreateChainID returns ID for a layerDigest slice. -// -// Deprecated: use [identity.ChainID]. -func CreateChainID(dgsts []DiffID) ChainID { - return identity.ChainID(dgsts) -} - // ReleaseAndLog releases the provided layer from the given layer // store, logging any error and release metadata func ReleaseAndLog(ls Store, l Layer) { diff --git a/daemon/libnetwork/discoverapi/discoverapi.go b/daemon/libnetwork/discoverapi/discoverapi.go index 565a5c35af..f57cb43b2e 100644 --- a/daemon/libnetwork/discoverapi/discoverapi.go +++ b/daemon/libnetwork/discoverapi/discoverapi.go @@ -29,16 +29,6 @@ type NodeDiscoveryData struct { Self bool } -// DatastoreConfigData is the data for the datastore update event message -// -// Deprecated: no longer used. -type DatastoreConfigData struct { - Scope string - Provider string - Address string - Config any -} - // DriverEncryptionConfig contains the initial datapath encryption key(s) // Key in first position is the primary key, the one to be used in tx. // Original key and tag types are []byte and uint64 diff --git a/daemon/pkg/oci/oci.go b/daemon/pkg/oci/oci.go index 22f0be4950..75b209c9d7 100644 --- a/daemon/pkg/oci/oci.go +++ b/daemon/pkg/oci/oci.go @@ -17,21 +17,6 @@ import ( // early for "a" (all); https://github.com/torvalds/linux/blob/v5.10/security/device_cgroup.c#L614-L642 var deviceCgroupRuleRegex = lazyregexp.New("^([acb]) ([0-9]+|\\*):([0-9]+|\\*) ([rwm]{1,3})$") -// SetCapabilities sets the provided capabilities on the spec. -// -// Deprecated: this function is no longer used and will be removed in the next release. -func SetCapabilities(s *specs.Spec, caplist []string) error { - if s.Process == nil { - s.Process = &specs.Process{} - } - s.Process.Capabilities = &specs.LinuxCapabilities{ - Effective: caplist, - Bounding: caplist, - Permitted: caplist, - } - return nil -} - // AppendDevicePermissionsFromCgroupRules takes rules for the devices cgroup to append to the default set func AppendDevicePermissionsFromCgroupRules(devPermissions []specs.LinuxDeviceCgroup, rules []string) ([]specs.LinuxDeviceCgroup, error) { for _, deviceCgroupRule := range rules {