mirror of
https://github.com/docker/compose.git
synced 2026-08-27 03:45:29 +00:00
Refactor on services
This refactors the interfaces and implementations of services Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
This commit is contained in:
parent
03e418cbbb
commit
ba455916c6
10 changed files with 93 additions and 47 deletions
|
|
@ -28,11 +28,11 @@ func upCommand() *cobra.Command {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.AciService().Up(cmd.Context(), *opts)
|
||||
return c.ComposeService().Up(cmd.Context(), *opts)
|
||||
},
|
||||
}
|
||||
upCmd.Flags().StringVar(&opts.Name, "name", "", "Project name")
|
||||
upCmd.Flags().StringVar(&opts.WorkDir, "workdir", ".", "Work dir")
|
||||
upCmd.Flags().StringVar(&opts.Name, "name", "", "Project name")
|
||||
upCmd.Flags().StringVar(&opts.WorkDir, "workdir", ".", "Work dir")
|
||||
upCmd.Flags().StringArrayVarP(&opts.ConfigPaths, "file", "f", []string{}, "Compose configuration files")
|
||||
upCmd.Flags().StringArrayVarP(&opts.Environment, "environment", "e", []string{}, "Environment variables")
|
||||
|
||||
|
|
@ -48,11 +48,11 @@ func downCommand() *cobra.Command {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return c.AciService().Down(cmd.Context(), *opts)
|
||||
return c.ComposeService().Down(cmd.Context(), *opts)
|
||||
},
|
||||
}
|
||||
downCmd.Flags().StringVar(&opts.Name, "name", "", "Project name")
|
||||
downCmd.Flags().StringVar(&opts.WorkDir, "workdir", ".", "Work dir")
|
||||
downCmd.Flags().StringVar(&opts.Name, "name", "", "Project name")
|
||||
downCmd.Flags().StringVar(&opts.WorkDir, "workdir", ".", "Work dir")
|
||||
|
||||
return downCmd
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,5 +62,5 @@ func runExec(ctx context.Context, opts execOpts, name string, command string) er
|
|||
stdout = con
|
||||
}
|
||||
|
||||
return c.AciService().Exec(ctx, name, command, os.Stdin, stdout)
|
||||
return c.ContainerService().Exec(ctx, name, command, os.Stdin, stdout)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,5 +46,5 @@ func runLogs(ctx context.Context, containerName string, opts logsOpts) error {
|
|||
Writer: os.Stdout,
|
||||
}
|
||||
|
||||
return c.AciService().Logs(ctx, containerName, req)
|
||||
return c.ContainerService().Logs(ctx, containerName, req)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ var PsCommand = cobra.Command{
|
|||
return errors.Wrap(err, "cannot connect to backend")
|
||||
}
|
||||
|
||||
containers, err := c.AciService().List(ctx)
|
||||
containers, err := c.ContainerService().List(ctx)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "fetch containers")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,5 +65,5 @@ func runRun(ctx context.Context, image string, opts runOpts) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return c.AciService().Run(ctx, project)
|
||||
return c.ContainerService().Run(ctx, project)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue