@@ -40,29 +40,29 @@ func (action Restore) Run(ctx context.Context) error {
4040
4141 var f io.ReadCloser
4242 switch {
43- case action .Filename == "-" :
43+ case action .Input == "-" :
4444 f = os .Stdin
45- case storage .IsS3 (action .Filename ):
45+ case storage .IsS3 (action .Input ):
4646 pipe := storage .NewS3DownloadPipe ()
4747 f = pipe
4848 defer func (pipe * storage.S3DownloadPipe ) {
4949 _ = pipe .Close ()
5050 }(pipe )
5151
5252 errGroup .Go (func () error {
53- return storage .DownloadS3 (ctx , pipe , action .Filename )
53+ return storage .DownloadS3 (ctx , pipe , action .Input )
5454 })
55- case storage .IsGCS (action .Filename ):
55+ case storage .IsGCS (action .Input ):
5656 var err error
57- if f , err = storage .DownloadGCS (ctx , action .Filename ); err != nil {
57+ if f , err = storage .DownloadGCS (ctx , action .Input ); err != nil {
5858 return err
5959 }
6060 defer func (f io.ReadCloser ) {
6161 _ = f .Close ()
6262 }(f )
6363 default :
6464 var err error
65- if f , err = os .Open (action .Filename ); err != nil {
65+ if f , err = os .Open (action .Input ); err != nil {
6666 return err
6767 }
6868 defer func (f io.ReadCloser ) {
@@ -71,7 +71,7 @@ func (action Restore) Run(ctx context.Context) error {
7171 }
7272
7373 actionLog := slog .With (
74- "file" , action .Filename ,
74+ "file" , action .Input ,
7575 "namespace" , action .Client .Namespace ,
7676 "pod" , action .DBPod .Name ,
7777 )
@@ -274,9 +274,9 @@ func (action Restore) Table(r *lipgloss.Renderer) *tui.Table {
274274func (action Restore ) Confirm () (bool , error ) {
275275 table := action .Table (nil )
276276 var description string
277- if action .Filename != "-" && ! strings .Contains (action .Filename , action .Namespace ) {
277+ if action .Input != "-" && ! strings .Contains (action .Input , action .Namespace ) {
278278 warnStyle := tui .WarnStyle (nil )
279- table .Row ("File" , warnStyle .Render (tui .InPath (action .Filename , nil )))
279+ table .Row ("File" , warnStyle .Render (tui .InPath (action .Input , nil )))
280280
281281 description = lipgloss .JoinVertical (lipgloss .Left ,
282282 table .Render (),
@@ -285,7 +285,7 @@ func (action Restore) Confirm() (bool, error) {
285285 "Please verify you are restoring to the correct namespace." ,
286286 )
287287 } else {
288- description = table .Row ("File" , tui .InPath (action .Filename , nil )).Render ()
288+ description = table .Row ("File" , tui .InPath (action .Input , nil )).Render ()
289289 }
290290
291291 theme := huh .ThemeCharm ()
@@ -310,7 +310,7 @@ func (action Restore) summary(err error, took time.Duration, written int64, plai
310310 }
311311
312312 t := action .Table (r ).
313- Row ("File" , tui .InPath (action .Filename , r )).
313+ Row ("File" , tui .InPath (action .Input , r )).
314314 Row ("Took" , took .String ())
315315 if err != nil {
316316 t .Row ("Error" , tui .ErrStyle (r ).Render (err .Error ()))
@@ -330,7 +330,7 @@ func (action Restore) summary(err error, took time.Duration, written int64, plai
330330
331331func (action Restore ) printSummary (err error , took time.Duration , written int64 ) {
332332 out := os .Stdout
333- if action .Filename == "-" {
333+ if action .Input == "-" {
334334 out = os .Stderr
335335 }
336336 _ , _ = io .WriteString (out , "\n " + action .summary (err , took , written , false )+ "\n " )
0 commit comments