From 30774ed1f261493fa94bbdebc448807d4fdd70b6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 28 Aug 2025 10:13:45 +0200 Subject: [PATCH] deprecate cli/command/stack/formatter Functions and types in this package were exported as part of the "compose on kubernetes" feature, which was deprecated and removed. These functions are meant for internal use, and will be removed in the next release. Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 8 ++++++++ cli/command/stack/formatter/formatter.go | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index bf093a63c..1365f9fa3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -222,6 +222,14 @@ linters: linters: - staticcheck + # Ignore deprecation linting for cli/command/stack/*. + # + # FIXME(thaJeztah): remove exception once these functions are un-exported or internal; see https://github.com/docker/cli/pull/6389 + - text: '^(SA1019): ' + path: "cli/command/stack" + linters: + - staticcheck + # Log a warning if an exclusion rule is unused. # Default: false warn-unused: true diff --git a/cli/command/stack/formatter/formatter.go b/cli/command/stack/formatter/formatter.go index 07b322f06..7cfe8a89a 100644 --- a/cli/command/stack/formatter/formatter.go +++ b/cli/command/stack/formatter/formatter.go @@ -8,21 +8,31 @@ import ( const ( // SwarmStackTableFormat is the default Swarm stack format + // + // Deprecated: this type was for internal use and will be removed in the next release. SwarmStackTableFormat formatter.Format = "table {{.Name}}\t{{.Services}}" stackServicesHeader = "SERVICES" // TableFormatKey is an alias for formatter.TableFormatKey + // + // Deprecated: this type was for internal use and will be removed in the next release. TableFormatKey = formatter.TableFormatKey ) // Context is an alias for formatter.Context +// +// Deprecated: this type was for internal use and will be removed in the next release. type Context = formatter.Context // Format is an alias for formatter.Format +// +// Deprecated: this type was for internal use and will be removed in the next release. type Format = formatter.Format // Stack contains deployed stack information. +// +// Deprecated: this type was for internal use and will be removed in the next release. type Stack struct { // Name is the name of the stack Name string @@ -31,6 +41,8 @@ type Stack struct { } // StackWrite writes formatted stacks using the Context +// +// Deprecated: this function was for internal use and will be removed in the next release. func StackWrite(ctx formatter.Context, stacks []*Stack) error { render := func(format func(subContext formatter.SubContext) error) error { for _, stack := range stacks {