From 8e02747d1363f8d40730635a94a367f5f585437c Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Thu, 29 Feb 2024 05:40:11 +0000 Subject: [PATCH] fix --- cmd/teachart/lint.go | 1 - pkg/compose/client.go | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/teachart/lint.go b/cmd/teachart/lint.go index ea64de2..bd682b3 100644 --- a/cmd/teachart/lint.go +++ b/cmd/teachart/lint.go @@ -72,7 +72,6 @@ func runLint(ctx context.Context, cmd *cobra.Command, opts lintOptions) error { cli.WithNormalization(!opts.noNormalize), cli.WithConsistency(!opts.noConsistency), cli.WithDiscardEnvFile, - cli.WithContext(ctx), } lintFn := func(chartDir string) ([]byte, error) { diff --git a/pkg/compose/client.go b/pkg/compose/client.go index ef7b782..0681852 100644 --- a/pkg/compose/client.go +++ b/pkg/compose/client.go @@ -43,15 +43,15 @@ func NewClient(services []string, projectOpts *compose_cmd.ProjectOptions) (*Cli }, nil } -func (c *Client) toProject(pofs []cli.ProjectOptionsFn) (*types.Project, error) { - return c.ProjectOptions.ToProject(c.dockerCli, c.services, pofs...) +func (c *Client) toProject(ctx context.Context, pofs []cli.ProjectOptionsFn) (*types.Project, error) { + project, _, err := c.ProjectOptions.ToProject(ctx, c.dockerCli, c.services, pofs...) + return project, err } func (c *Client) Up(ctx context.Context, createOpts api.CreateOptions, startOpts api.StartOptions) error { - project, err := c.toProject([]cli.ProjectOptionsFn{ + project, err := c.toProject(ctx, []cli.ProjectOptionsFn{ cli.WithResolvedPaths(true), cli.WithDiscardEnvFile, - cli.WithContext(ctx), }) if err != nil { return err @@ -73,10 +73,9 @@ func (c *Client) Down(ctx context.Context, downOpts api.DownOptions) error { } func (c *Client) Config(ctx context.Context, pofs []cli.ProjectOptionsFn, configOpts api.ConfigOptions) ([]byte, error) { - project, err := c.toProject([]cli.ProjectOptionsFn{ + project, err := c.toProject(ctx, []cli.ProjectOptionsFn{ cli.WithResolvedPaths(true), cli.WithDiscardEnvFile, - cli.WithContext(ctx), }) if err != nil { return nil, err