fix(CVE-2025-62725): upgrade github.com/docker/compose/v2 to v2.40.2 BE-12352 (#1345)
This commit is contained in:
@@ -82,7 +82,7 @@ func (c *ComposeDeployer) withComposeService(
|
||||
ctx context.Context,
|
||||
filePaths []string,
|
||||
options libstack.Options,
|
||||
composeFn func(api.Service, *types.Project) error,
|
||||
composeFn func(api.Compose, *types.Project) error,
|
||||
) error {
|
||||
return withCli(ctx, options, func(ctx context.Context, cli *command.DockerCli) error {
|
||||
composeService := c.createComposeServiceFn(cli)
|
||||
@@ -114,7 +114,7 @@ func (c *ComposeDeployer) withComposeService(
|
||||
|
||||
// Deploy creates and starts containers
|
||||
func (c *ComposeDeployer) Deploy(ctx context.Context, filePaths []string, options libstack.DeployOptions) error {
|
||||
return c.withComposeService(ctx, filePaths, options.Options, func(composeService api.Service, project *types.Project) error {
|
||||
return c.withComposeService(ctx, filePaths, options.Options, func(composeService api.Compose, project *types.Project) error {
|
||||
addServiceLabels(project, false, options.EdgeStackID)
|
||||
|
||||
project = project.WithoutUnnecessaryResources()
|
||||
@@ -152,7 +152,7 @@ func (c *ComposeDeployer) Deploy(ctx context.Context, filePaths []string, option
|
||||
|
||||
// Run runs the given service just once, without considering dependencies
|
||||
func (c *ComposeDeployer) Run(ctx context.Context, filePaths []string, serviceName string, options libstack.RunOptions) error {
|
||||
return c.withComposeService(ctx, filePaths, options.Options, func(composeService api.Service, project *types.Project) error {
|
||||
return c.withComposeService(ctx, filePaths, options.Options, func(composeService api.Compose, project *types.Project) error {
|
||||
addServiceLabels(project, true, 0)
|
||||
|
||||
for name, service := range project.Services {
|
||||
@@ -204,7 +204,7 @@ func (c *ComposeDeployer) Remove(ctx context.Context, projectName string, filePa
|
||||
|
||||
// Pull pulls images
|
||||
func (c *ComposeDeployer) Pull(ctx context.Context, filePaths []string, options libstack.Options) error {
|
||||
if err := c.withComposeService(ctx, filePaths, options, func(composeService api.Service, project *types.Project) error {
|
||||
if err := c.withComposeService(ctx, filePaths, options, func(composeService api.Compose, project *types.Project) error {
|
||||
return composeService.Pull(ctx, project, api.PullOptions{})
|
||||
}); err != nil {
|
||||
return fmt.Errorf("compose pull operation failed: %w", err)
|
||||
@@ -217,7 +217,7 @@ func (c *ComposeDeployer) Pull(ctx context.Context, filePaths []string, options
|
||||
|
||||
// Validate validates stack file
|
||||
func (c *ComposeDeployer) Validate(ctx context.Context, filePaths []string, options libstack.Options) error {
|
||||
return c.withComposeService(ctx, filePaths, options, func(composeService api.Service, project *types.Project) error {
|
||||
return c.withComposeService(ctx, filePaths, options, func(composeService api.Compose, project *types.Project) error {
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -226,7 +226,7 @@ func (c *ComposeDeployer) Validate(ctx context.Context, filePaths []string, opti
|
||||
func (c *ComposeDeployer) Config(ctx context.Context, filePaths []string, options libstack.Options) ([]byte, error) {
|
||||
var payload []byte
|
||||
|
||||
if err := c.withComposeService(ctx, filePaths, options, func(composeService api.Service, project *types.Project) error {
|
||||
if err := c.withComposeService(ctx, filePaths, options, func(composeService api.Compose, project *types.Project) error {
|
||||
var err error
|
||||
payload, err = project.MarshalYAML()
|
||||
if err != nil {
|
||||
@@ -244,7 +244,7 @@ func (c *ComposeDeployer) Config(ctx context.Context, filePaths []string, option
|
||||
func (c *ComposeDeployer) GetExistingEdgeStacks(ctx context.Context) ([]libstack.EdgeStack, error) {
|
||||
m := make(map[int]libstack.EdgeStack)
|
||||
|
||||
if err := c.withComposeService(ctx, nil, libstack.Options{}, func(composeService api.Service, project *types.Project) error {
|
||||
if err := c.withComposeService(ctx, nil, libstack.Options{}, func(composeService api.Compose, project *types.Project) error {
|
||||
stacks, err := composeService.List(ctx, api.ListOptions{
|
||||
All: true,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user