Skip to content

Commit 2966159

Browse files
authored
Merge pull request #6339 from thaJeztah/rm_deprecated_formatting
cli/command/*: remove deprecated formatting-related functions and types
2 parents 65e7ece + 5bb8ab4 commit 2966159

File tree

12 files changed

+0
-218
lines changed

12 files changed

+0
-218
lines changed

cli/command/checkpoint/formatter.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ const (
1010
checkpointNameHeader = "CHECKPOINT NAME"
1111
)
1212

13-
// NewFormat returns a format for use with a checkpoint Context
14-
//
15-
// Deprecated: this function was only used internally and will be removed in the next release.
16-
func NewFormat(source string) formatter.Format {
17-
return newFormat(source)
18-
}
19-
2013
// newFormat returns a format for use with a checkpointContext.
2114
func newFormat(source string) formatter.Format {
2215
if source == formatter.TableFormatKey {
@@ -25,13 +18,6 @@ func newFormat(source string) formatter.Format {
2518
return formatter.Format(source)
2619
}
2720

28-
// FormatWrite writes formatted checkpoints using the Context
29-
//
30-
// Deprecated: this function was only used internally and will be removed in the next release.
31-
func FormatWrite(fmtCtx formatter.Context, checkpoints []checkpoint.Summary) error {
32-
return formatWrite(fmtCtx, checkpoints)
33-
}
34-
3521
// formatWrite writes formatted checkpoints using the Context
3622
func formatWrite(fmtCtx formatter.Context, checkpoints []checkpoint.Summary) error {
3723
render := func(format func(subContext formatter.SubContext) error) error {

cli/command/config/formatter.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ Data:
2929
{{.Data}}`
3030
)
3131

32-
// NewFormat returns a Format for rendering using a config Context
33-
//
34-
// Deprecated: this function was only used internally and will be removed in the next release.
35-
func NewFormat(source string, quiet bool) formatter.Format {
36-
return newFormat(source, quiet)
37-
}
38-
3932
// newFormat returns a Format for rendering using a configContext.
4033
func newFormat(source string, quiet bool) formatter.Format {
4134
switch source {
@@ -50,13 +43,6 @@ func newFormat(source string, quiet bool) formatter.Format {
5043
return formatter.Format(source)
5144
}
5245

53-
// FormatWrite writes the context
54-
//
55-
// Deprecated: this function was only used internally and will be removed in the next release.
56-
func FormatWrite(fmtCtx formatter.Context, configs []swarm.Config) error {
57-
return formatWrite(fmtCtx, configs)
58-
}
59-
6046
// formatWrite writes the context
6147
func formatWrite(fmtCtx formatter.Context, configs []swarm.Config) error {
6248
render := func(format func(subContext formatter.SubContext) error) error {
@@ -128,13 +114,6 @@ func (c *configContext) Label(name string) string {
128114
return c.c.Spec.Annotations.Labels[name]
129115
}
130116

131-
// InspectFormatWrite renders the context for a list of configs
132-
//
133-
// Deprecated: this function was only used internally and will be removed in the next release.
134-
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
135-
return inspectFormatWrite(fmtCtx, refs, getRef)
136-
}
137-
138117
// inspectFormatWrite renders the context for a list of configs
139118
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
140119
if fmtCtx.Format != configInspectPrettyTemplate {

cli/command/container/formatter_diff.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ const (
1212
pathHeader = "PATH"
1313
)
1414

15-
// NewDiffFormat returns a format for use with a diff Context
16-
//
17-
// Deprecated: this function was only used internally and will be removed in the next release.
18-
func NewDiffFormat(source string) formatter.Format {
19-
return newDiffFormat(source)
20-
}
21-
2215
// newDiffFormat returns a format for use with a diff [formatter.Context].
2316
func newDiffFormat(source string) formatter.Format {
2417
if source == formatter.TableFormatKey {
@@ -27,13 +20,6 @@ func newDiffFormat(source string) formatter.Format {
2720
return formatter.Format(source)
2821
}
2922

30-
// DiffFormatWrite writes formatted diff using the Context
31-
//
32-
// Deprecated: this function was only used internally and will be removed in the next release.
33-
func DiffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) error {
34-
return diffFormatWrite(fmtCtx, changes)
35-
}
36-
3723
// diffFormatWrite writes formatted diff using the [formatter.Context].
3824
func diffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) error {
3925
return fmtCtx.Write(newDiffContext(), func(format func(subContext formatter.SubContext) error) error {

cli/command/image/formatter_history.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ const (
1919
commentHeader = "COMMENT"
2020
)
2121

22-
// NewHistoryFormat returns a format for rendering an HistoryContext
23-
//
24-
// Deprecated: this function was only used internally and will be removed in the next release.
25-
func NewHistoryFormat(source string, quiet bool, human bool) formatter.Format {
26-
return newHistoryFormat(source, quiet, human)
27-
}
28-
2922
// newHistoryFormat returns a format for rendering a historyContext.
3023
func newHistoryFormat(source string, quiet bool, human bool) formatter.Format {
3124
if source == formatter.TableFormatKey {
@@ -42,13 +35,6 @@ func newHistoryFormat(source string, quiet bool, human bool) formatter.Format {
4235
return formatter.Format(source)
4336
}
4437

45-
// HistoryWrite writes the context
46-
//
47-
// Deprecated: this function was only used internally and will be removed in the next release.
48-
func HistoryWrite(fmtCtx formatter.Context, human bool, histories []image.HistoryResponseItem) error {
49-
return historyWrite(fmtCtx, human, histories)
50-
}
51-
5238
// historyWrite writes the context
5339
func historyWrite(fmtCtx formatter.Context, human bool, histories []image.HistoryResponseItem) error {
5440
render := func(format func(subContext formatter.SubContext) error) error {

cli/command/network/formatter.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,6 @@ const (
1717
internalHeader = "INTERNAL"
1818
)
1919

20-
// NewFormat returns a Format for rendering using a network Context.
21-
//
22-
// Deprecated: this function was only used internally and will be removed in the next release.
23-
func NewFormat(source string, quiet bool) formatter.Format {
24-
return newFormat(source, quiet)
25-
}
26-
2720
// newFormat returns a [formatter.Format] for rendering a networkContext.
2821
func newFormat(source string, quiet bool) formatter.Format {
2922
switch source {
@@ -41,13 +34,6 @@ func newFormat(source string, quiet bool) formatter.Format {
4134
return formatter.Format(source)
4235
}
4336

44-
// FormatWrite writes the context
45-
//
46-
// Deprecated: this function was only used internally and will be removed in the next release.
47-
func FormatWrite(fmtCtx formatter.Context, networks []network.Summary) error {
48-
return formatWrite(fmtCtx, networks)
49-
}
50-
5137
// formatWrite writes the context.
5238
func formatWrite(fmtCtx formatter.Context, networks []network.Summary) error {
5339
render := func(format func(subContext formatter.SubContext) error) error {

cli/command/node/formatter.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,6 @@ TLS Info:
7979
tlsStatusHeader = "TLS STATUS"
8080
)
8181

82-
// NewFormat returns a Format for rendering using a node Context
83-
//
84-
// Deprecated: this function was only used internally and will be removed in the next release.
85-
func NewFormat(source string, quiet bool) formatter.Format {
86-
return newFormat(source, quiet)
87-
}
88-
8982
// newFormat returns a Format for rendering using a nodeContext.
9083
func newFormat(source string, quiet bool) formatter.Format {
9184
switch source {
@@ -105,13 +98,6 @@ func newFormat(source string, quiet bool) formatter.Format {
10598
return formatter.Format(source)
10699
}
107100

108-
// FormatWrite writes the context
109-
//
110-
// Deprecated: this function was only used internally and will be removed in the next release.
111-
func FormatWrite(fmtCtx formatter.Context, nodes []swarm.Node, info system.Info) error {
112-
return formatWrite(fmtCtx, nodes, info)
113-
}
114-
115101
// formatWrite writes the context.
116102
func formatWrite(fmtCtx formatter.Context, nodes []swarm.Node, info system.Info) error {
117103
render := func(format func(subContext formatter.SubContext) error) error {
@@ -193,13 +179,6 @@ func (c *nodeContext) EngineVersion() string {
193179
return c.n.Description.Engine.EngineVersion
194180
}
195181

196-
// InspectFormatWrite renders the context for a list of nodes
197-
//
198-
// Deprecated: this function was only used internally and will be removed in the next release.
199-
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
200-
return inspectFormatWrite(fmtCtx, refs, getRef)
201-
}
202-
203182
// inspectFormatWrite renders the context for a list of nodes.
204183
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
205184
if fmtCtx.Format != nodeInspectPrettyTemplate {

cli/command/plugin/formatter.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ enabled: {{.Enabled}}
2020
`
2121
)
2222

23-
// NewFormat returns a Format for rendering using a plugin Context
24-
//
25-
// Deprecated: this function was only used internally and will be removed in the next release.
26-
func NewFormat(source string, quiet bool) formatter.Format {
27-
return newFormat(source, quiet)
28-
}
29-
3023
// newFormat returns a Format for rendering using a pluginContext.
3124
func newFormat(source string, quiet bool) formatter.Format {
3225
switch source {
@@ -44,13 +37,6 @@ func newFormat(source string, quiet bool) formatter.Format {
4437
return formatter.Format(source)
4538
}
4639

47-
// FormatWrite writes the context
48-
//
49-
// Deprecated: this function was only used internally and will be removed in the next release.
50-
func FormatWrite(fmtCtx formatter.Context, plugins []*plugin.Plugin) error {
51-
return formatWrite(fmtCtx, plugins)
52-
}
53-
5440
// formatWrite writes the context
5541
func formatWrite(fmtCtx formatter.Context, plugins []*plugin.Plugin) error {
5642
render := func(format func(subContext formatter.SubContext) error) error {

cli/command/registry/formatter_search.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ const (
1616
automatedHeader = "AUTOMATED"
1717
)
1818

19-
// NewSearchFormat returns a Format for rendering using a search Context
20-
//
21-
// Deprecated: this function was only used internally and will be removed in the next release.
22-
func NewSearchFormat(source string) formatter.Format {
23-
return newFormat(source)
24-
}
25-
2619
// newFormat returns a Format for rendering using a searchContext.
2720
func newFormat(source string) formatter.Format {
2821
switch source {
@@ -32,13 +25,6 @@ func newFormat(source string) formatter.Format {
3225
return formatter.Format(source)
3326
}
3427

35-
// SearchWrite writes the context
36-
//
37-
// Deprecated: this function was only used internally and will be removed in the next release.
38-
func SearchWrite(fmtCtx formatter.Context, results []registrytypes.SearchResult) error {
39-
return formatWrite(fmtCtx, results)
40-
}
41-
4228
// formatWrite writes the context.
4329
func formatWrite(fmtCtx formatter.Context, results []registrytypes.SearchResult) error {
4430
render := func(format func(subContext formatter.SubContext) error) error {

cli/command/secret/formatter.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ Created at: {{.CreatedAt}}
2828
Updated at: {{.UpdatedAt}}`
2929
)
3030

31-
// NewFormat returns a Format for rendering using a secret Context
32-
//
33-
// Deprecated: this function was only used internally and will be removed in the next release.
34-
func NewFormat(source string, quiet bool) formatter.Format {
35-
return newFormat(source, quiet)
36-
}
37-
3831
// newFormat returns a Format for rendering using a secretContext.
3932
func newFormat(source string, quiet bool) formatter.Format {
4033
switch source {
@@ -49,13 +42,6 @@ func newFormat(source string, quiet bool) formatter.Format {
4942
return formatter.Format(source)
5043
}
5144

52-
// FormatWrite writes the context
53-
//
54-
// Deprecated: this function was only used internally and will be removed in the next release.
55-
func FormatWrite(fmtCtx formatter.Context, secrets []swarm.Secret) error {
56-
return formatWrite(fmtCtx, secrets)
57-
}
58-
5945
// formatWrite writes the context
6046
func formatWrite(fmtCtx formatter.Context, secrets []swarm.Secret) error {
6147
render := func(format func(subContext formatter.SubContext) error) error {
@@ -135,13 +121,6 @@ func (c *secretContext) Label(name string) string {
135121
return c.s.Spec.Annotations.Labels[name]
136122
}
137123

138-
// InspectFormatWrite renders the context for a list of secrets
139-
//
140-
// Deprecated: this function was only used internally and will be removed in the next release.
141-
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
142-
return inspectFormatWrite(fmtCtx, refs, getRef)
143-
}
144-
145124
// inspectFormatWrite renders the context for a list of secrets.
146125
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
147126
if fmtCtx.Format != secretInspectPrettyTemplate {

cli/command/service/formatter.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,6 @@ Ports:
195195
{{- end }}
196196
`
197197

198-
// NewFormat returns a Format for rendering using a Context
199-
//
200-
// Deprecated: this function was only used internally and will be removed in the next release.
201-
func NewFormat(source string) formatter.Format {
202-
return newFormat(source)
203-
}
204-
205198
// newFormat returns a Format for rendering using a Context.
206199
func newFormat(source string) formatter.Format {
207200
switch source {
@@ -224,13 +217,6 @@ func resolveNetworks(service swarm.Service, getNetwork inspect.GetRefFunc) map[s
224217
return networkNames
225218
}
226219

227-
// InspectFormatWrite renders the context for a list of services
228-
//
229-
// Deprecated: this function was only used internally and will be removed in the next release.
230-
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error {
231-
return inspectFormatWrite(fmtCtx, refs, getRef, getNetwork)
232-
}
233-
234220
// inspectFormatWrite renders the context for a list of services
235221
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error {
236222
if fmtCtx.Format != serviceInspectPrettyTemplate {

0 commit comments

Comments
 (0)