refactor: simplify and speed up plan output formatting by removing name resolver dependency

This commit is contained in:
Pasha Sviderski
2026-03-19 13:14:09 +10:00
parent 95f80a7fda
commit e4cb71b878
13 changed files with 96 additions and 150 deletions
+2 -2
View File
@@ -13,7 +13,7 @@ import (
type CreateVolumeOperation struct {
VolumeSpec api.VolumeSpec
MachineID string
// MachineName is used for formatting the operation output only.
// MachineName is used for formatting the operation as part of the deployment plan.
MachineName string
}
@@ -40,7 +40,7 @@ func (o *CreateVolumeOperation) Execute(ctx context.Context, cli Client) error {
return nil
}
func (o *CreateVolumeOperation) Format(_ NameResolver) string {
func (o *CreateVolumeOperation) Format() string {
return fmt.Sprintf("%s create volume %s %s %s",
tui.BoldGreen.Render("+"),
tui.NameStyle.Render(o.VolumeSpec.DockerVolumeName()),