Merge pull request #6339 from thaJeztah/rm_deprecated_formatting
cli/command/*: remove deprecated formatting-related functions and types
This commit is contained in:
@ -10,13 +10,6 @@ const (
|
||||
checkpointNameHeader = "CHECKPOINT NAME"
|
||||
)
|
||||
|
||||
// NewFormat returns a format for use with a checkpoint Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string) formatter.Format {
|
||||
return newFormat(source)
|
||||
}
|
||||
|
||||
// newFormat returns a format for use with a checkpointContext.
|
||||
func newFormat(source string) formatter.Format {
|
||||
if source == formatter.TableFormatKey {
|
||||
@ -25,13 +18,6 @@ func newFormat(source string) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes formatted checkpoints using the Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, checkpoints []checkpoint.Summary) error {
|
||||
return formatWrite(fmtCtx, checkpoints)
|
||||
}
|
||||
|
||||
// formatWrite writes formatted checkpoints using the Context
|
||||
func formatWrite(fmtCtx formatter.Context, checkpoints []checkpoint.Summary) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -29,13 +29,6 @@ Data:
|
||||
{{.Data}}`
|
||||
)
|
||||
|
||||
// NewFormat returns a Format for rendering using a config Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string, quiet bool) formatter.Format {
|
||||
return newFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a configContext.
|
||||
func newFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -50,13 +43,6 @@ func newFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, configs []swarm.Config) error {
|
||||
return formatWrite(fmtCtx, configs)
|
||||
}
|
||||
|
||||
// formatWrite writes the context
|
||||
func formatWrite(fmtCtx formatter.Context, configs []swarm.Config) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
@ -128,13 +114,6 @@ func (c *configContext) Label(name string) string {
|
||||
return c.c.Spec.Annotations.Labels[name]
|
||||
}
|
||||
|
||||
// InspectFormatWrite renders the context for a list of configs
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
return inspectFormatWrite(fmtCtx, refs, getRef)
|
||||
}
|
||||
|
||||
// inspectFormatWrite renders the context for a list of configs
|
||||
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
if fmtCtx.Format != configInspectPrettyTemplate {
|
||||
|
||||
@ -12,13 +12,6 @@ const (
|
||||
pathHeader = "PATH"
|
||||
)
|
||||
|
||||
// NewDiffFormat returns a format for use with a diff Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewDiffFormat(source string) formatter.Format {
|
||||
return newDiffFormat(source)
|
||||
}
|
||||
|
||||
// newDiffFormat returns a format for use with a diff [formatter.Context].
|
||||
func newDiffFormat(source string) formatter.Format {
|
||||
if source == formatter.TableFormatKey {
|
||||
@ -27,13 +20,6 @@ func newDiffFormat(source string) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// DiffFormatWrite writes formatted diff using the Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func DiffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) error {
|
||||
return diffFormatWrite(fmtCtx, changes)
|
||||
}
|
||||
|
||||
// diffFormatWrite writes formatted diff using the [formatter.Context].
|
||||
func diffFormatWrite(fmtCtx formatter.Context, changes []container.FilesystemChange) error {
|
||||
return fmtCtx.Write(newDiffContext(), func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -19,13 +19,6 @@ const (
|
||||
commentHeader = "COMMENT"
|
||||
)
|
||||
|
||||
// NewHistoryFormat returns a format for rendering an HistoryContext
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewHistoryFormat(source string, quiet bool, human bool) formatter.Format {
|
||||
return newHistoryFormat(source, quiet, human)
|
||||
}
|
||||
|
||||
// newHistoryFormat returns a format for rendering a historyContext.
|
||||
func newHistoryFormat(source string, quiet bool, human bool) formatter.Format {
|
||||
if source == formatter.TableFormatKey {
|
||||
@ -42,13 +35,6 @@ func newHistoryFormat(source string, quiet bool, human bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// HistoryWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func HistoryWrite(fmtCtx formatter.Context, human bool, histories []image.HistoryResponseItem) error {
|
||||
return historyWrite(fmtCtx, human, histories)
|
||||
}
|
||||
|
||||
// historyWrite writes the context
|
||||
func historyWrite(fmtCtx formatter.Context, human bool, histories []image.HistoryResponseItem) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -17,13 +17,6 @@ const (
|
||||
internalHeader = "INTERNAL"
|
||||
)
|
||||
|
||||
// NewFormat returns a Format for rendering using a network Context.
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string, quiet bool) formatter.Format {
|
||||
return newFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newFormat returns a [formatter.Format] for rendering a networkContext.
|
||||
func newFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -41,13 +34,6 @@ func newFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, networks []network.Summary) error {
|
||||
return formatWrite(fmtCtx, networks)
|
||||
}
|
||||
|
||||
// formatWrite writes the context.
|
||||
func formatWrite(fmtCtx formatter.Context, networks []network.Summary) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -79,13 +79,6 @@ TLS Info:
|
||||
tlsStatusHeader = "TLS STATUS"
|
||||
)
|
||||
|
||||
// NewFormat returns a Format for rendering using a node Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string, quiet bool) formatter.Format {
|
||||
return newFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a nodeContext.
|
||||
func newFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -105,13 +98,6 @@ func newFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, nodes []swarm.Node, info system.Info) error {
|
||||
return formatWrite(fmtCtx, nodes, info)
|
||||
}
|
||||
|
||||
// formatWrite writes the context.
|
||||
func formatWrite(fmtCtx formatter.Context, nodes []swarm.Node, info system.Info) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
@ -193,13 +179,6 @@ func (c *nodeContext) EngineVersion() string {
|
||||
return c.n.Description.Engine.EngineVersion
|
||||
}
|
||||
|
||||
// InspectFormatWrite renders the context for a list of nodes
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
return inspectFormatWrite(fmtCtx, refs, getRef)
|
||||
}
|
||||
|
||||
// inspectFormatWrite renders the context for a list of nodes.
|
||||
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
if fmtCtx.Format != nodeInspectPrettyTemplate {
|
||||
|
||||
@ -20,13 +20,6 @@ enabled: {{.Enabled}}
|
||||
`
|
||||
)
|
||||
|
||||
// NewFormat returns a Format for rendering using a plugin Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string, quiet bool) formatter.Format {
|
||||
return newFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a pluginContext.
|
||||
func newFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -44,13 +37,6 @@ func newFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, plugins []*plugin.Plugin) error {
|
||||
return formatWrite(fmtCtx, plugins)
|
||||
}
|
||||
|
||||
// formatWrite writes the context
|
||||
func formatWrite(fmtCtx formatter.Context, plugins []*plugin.Plugin) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -16,13 +16,6 @@ const (
|
||||
automatedHeader = "AUTOMATED"
|
||||
)
|
||||
|
||||
// NewSearchFormat returns a Format for rendering using a search Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewSearchFormat(source string) formatter.Format {
|
||||
return newFormat(source)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a searchContext.
|
||||
func newFormat(source string) formatter.Format {
|
||||
switch source {
|
||||
@ -32,13 +25,6 @@ func newFormat(source string) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// SearchWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func SearchWrite(fmtCtx formatter.Context, results []registrytypes.SearchResult) error {
|
||||
return formatWrite(fmtCtx, results)
|
||||
}
|
||||
|
||||
// formatWrite writes the context.
|
||||
func formatWrite(fmtCtx formatter.Context, results []registrytypes.SearchResult) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -28,13 +28,6 @@ Created at: {{.CreatedAt}}
|
||||
Updated at: {{.UpdatedAt}}`
|
||||
)
|
||||
|
||||
// NewFormat returns a Format for rendering using a secret Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string, quiet bool) formatter.Format {
|
||||
return newFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a secretContext.
|
||||
func newFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -49,13 +42,6 @@ func newFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, secrets []swarm.Secret) error {
|
||||
return formatWrite(fmtCtx, secrets)
|
||||
}
|
||||
|
||||
// formatWrite writes the context
|
||||
func formatWrite(fmtCtx formatter.Context, secrets []swarm.Secret) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
@ -135,13 +121,6 @@ func (c *secretContext) Label(name string) string {
|
||||
return c.s.Spec.Annotations.Labels[name]
|
||||
}
|
||||
|
||||
// InspectFormatWrite renders the context for a list of secrets
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
return inspectFormatWrite(fmtCtx, refs, getRef)
|
||||
}
|
||||
|
||||
// inspectFormatWrite renders the context for a list of secrets.
|
||||
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef inspect.GetRefFunc) error {
|
||||
if fmtCtx.Format != secretInspectPrettyTemplate {
|
||||
|
||||
@ -195,13 +195,6 @@ Ports:
|
||||
{{- end }}
|
||||
`
|
||||
|
||||
// NewFormat returns a Format for rendering using a Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewFormat(source string) formatter.Format {
|
||||
return newFormat(source)
|
||||
}
|
||||
|
||||
// newFormat returns a Format for rendering using a Context.
|
||||
func newFormat(source string) formatter.Format {
|
||||
switch source {
|
||||
@ -224,13 +217,6 @@ func resolveNetworks(service swarm.Service, getNetwork inspect.GetRefFunc) map[s
|
||||
return networkNames
|
||||
}
|
||||
|
||||
// InspectFormatWrite renders the context for a list of services
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func InspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error {
|
||||
return inspectFormatWrite(fmtCtx, refs, getRef, getNetwork)
|
||||
}
|
||||
|
||||
// inspectFormatWrite renders the context for a list of services
|
||||
func inspectFormatWrite(fmtCtx formatter.Context, refs []string, getRef, getNetwork inspect.GetRefFunc) error {
|
||||
if fmtCtx.Format != serviceInspectPrettyTemplate {
|
||||
|
||||
@ -22,13 +22,6 @@ const (
|
||||
maxErrLength = 30
|
||||
)
|
||||
|
||||
// NewTaskFormat returns a Format for rendering using a task Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewTaskFormat(source string, quiet bool) formatter.Format {
|
||||
return newTaskFormat(source, quiet)
|
||||
}
|
||||
|
||||
// newTaskFormat returns a Format for rendering using a taskContext.
|
||||
func newTaskFormat(source string, quiet bool) formatter.Format {
|
||||
switch source {
|
||||
@ -46,13 +39,6 @@ func newTaskFormat(source string, quiet bool) formatter.Format {
|
||||
return formatter.Format(source)
|
||||
}
|
||||
|
||||
// FormatWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func FormatWrite(fmtCtx formatter.Context, tasks []swarm.Task, names map[string]string, nodes map[string]string) error {
|
||||
return formatWrite(fmtCtx, tasks, names, nodes)
|
||||
}
|
||||
|
||||
// formatWrite writes the context.
|
||||
func formatWrite(fmtCtx formatter.Context, tasks []swarm.Task, names map[string]string, nodes map[string]string) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
@ -17,14 +17,6 @@ const (
|
||||
keysHeader = "KEYS"
|
||||
)
|
||||
|
||||
// SignedTagInfo represents all formatted information needed to describe a signed tag:
|
||||
// Name: name of the signed tag
|
||||
// Digest: hex encoded digest of the contents
|
||||
// Signers: list of entities who signed the tag
|
||||
//
|
||||
// Deprecated: this type was only used internally and will be removed in the next release.
|
||||
type SignedTagInfo = signedTagInfo
|
||||
|
||||
// signedTagInfo represents all formatted information needed to describe a signed tag:
|
||||
// Name: name of the signed tag
|
||||
// Digest: hex encoded digest of the contents
|
||||
@ -35,13 +27,6 @@ type signedTagInfo struct {
|
||||
Signers []string
|
||||
}
|
||||
|
||||
// SignerInfo represents all formatted information needed to describe a signer:
|
||||
// Name: name of the signer role
|
||||
// Keys: the keys associated with the signer
|
||||
//
|
||||
// Deprecated: this type was only used internally and will be removed in the next release.
|
||||
type SignerInfo = signerInfo
|
||||
|
||||
// signerInfo represents all formatted information needed to describe a signer:
|
||||
// Name: name of the signer role
|
||||
// Keys: the keys associated with the signer
|
||||
@ -50,27 +35,6 @@ type signerInfo struct {
|
||||
Keys []string
|
||||
}
|
||||
|
||||
// NewTrustTagFormat returns a Format for rendering using a trusted tag Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewTrustTagFormat() formatter.Format {
|
||||
return defaultTrustTagTableFormat
|
||||
}
|
||||
|
||||
// NewSignerInfoFormat returns a Format for rendering a signer role info Context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func NewSignerInfoFormat() formatter.Format {
|
||||
return defaultSignerInfoTableFormat
|
||||
}
|
||||
|
||||
// TagWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func TagWrite(fmtCtx formatter.Context, signedTagInfoList []signedTagInfo) error {
|
||||
return tagWrite(fmtCtx, signedTagInfoList)
|
||||
}
|
||||
|
||||
// tagWrite writes the context
|
||||
func tagWrite(fmtCtx formatter.Context, signedTagInfoList []signedTagInfo) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
@ -111,13 +75,6 @@ func (c *trustTagContext) Signers() string {
|
||||
return strings.Join(c.s.Signers, ", ")
|
||||
}
|
||||
|
||||
// SignerInfoWrite writes the context
|
||||
//
|
||||
// Deprecated: this function was only used internally and will be removed in the next release.
|
||||
func SignerInfoWrite(fmtCtx formatter.Context, signerInfoList []signerInfo) error {
|
||||
return signerInfoWrite(fmtCtx, signerInfoList)
|
||||
}
|
||||
|
||||
// signerInfoWrite writes the context.
|
||||
func signerInfoWrite(fmtCtx formatter.Context, signerInfoList []signerInfo) error {
|
||||
render := func(format func(subContext formatter.SubContext) error) error {
|
||||
|
||||
Reference in New Issue
Block a user