diff --git a/cmd/dagger/cmd/common/common.go b/cmd/dagger/cmd/common/common.go index 271b82ce..8285573f 100644 --- a/cmd/dagger/cmd/common/common.go +++ b/cmd/dagger/cmd/common/common.go @@ -161,10 +161,10 @@ func ValueDocOneLine(val *compiler.Value) string { } // NewClient creates a new client -func NewClient(ctx context.Context) *client.Client { +func NewClient(ctx context.Context, noCache bool) *client.Client { lg := log.Ctx(ctx) - cl, err := client.New(ctx, "", false) + cl, err := client.New(ctx, "", noCache) if err != nil { lg.Fatal().Err(err).Msg("unable to create client") } diff --git a/cmd/dagger/cmd/edit.go b/cmd/dagger/cmd/edit.go index cb8e0fc2..f4eae42b 100644 --- a/cmd/dagger/cmd/edit.go +++ b/cmd/dagger/cmd/edit.go @@ -70,7 +70,7 @@ var editCmd = &cobra.Command{ st.Plan = newState.Plan st.Inputs = newState.Inputs - cl := common.NewClient(ctx) + cl := common.NewClient(ctx, false) _, err = cl.Do(ctx, st, func(ctx context.Context, env *environment.Environment, s solver.Solver) error { // check for cue errors by scanning all the inputs _, err := env.ScanInputs(ctx, true) diff --git a/cmd/dagger/cmd/input/container.go b/cmd/dagger/cmd/input/container.go index 527d8fc9..d9b9eb4c 100644 --- a/cmd/dagger/cmd/input/container.go +++ b/cmd/dagger/cmd/input/container.go @@ -23,7 +23,7 @@ var containerCmd = &cobra.Command{ lg := logger.New() ctx := lg.WithContext(cmd.Context()) - updateEnvironmentInput(ctx, common.NewClient(ctx), args[0], state.DockerInput(args[1])) + updateEnvironmentInput(ctx, common.NewClient(ctx, false), args[0], state.DockerInput(args[1])) }, } diff --git a/cmd/dagger/cmd/input/dir.go b/cmd/dagger/cmd/input/dir.go index fb5b998c..1b17b45a 100644 --- a/cmd/dagger/cmd/input/dir.go +++ b/cmd/dagger/cmd/input/dir.go @@ -43,7 +43,7 @@ var dirCmd = &cobra.Command{ p = "./" + p } - updateEnvironmentInput(ctx, common.NewClient(ctx), args[0], + updateEnvironmentInput(ctx, common.NewClient(ctx, false), args[0], state.DirInput( p, viper.GetStringSlice("include"), diff --git a/cmd/dagger/cmd/input/git.go b/cmd/dagger/cmd/input/git.go index 5e6e582d..006293b9 100644 --- a/cmd/dagger/cmd/input/git.go +++ b/cmd/dagger/cmd/input/git.go @@ -33,7 +33,7 @@ var gitCmd = &cobra.Command{ subDir = args[3] } - updateEnvironmentInput(ctx, common.NewClient(ctx), args[0], state.GitInput(args[1], ref, subDir)) + updateEnvironmentInput(ctx, common.NewClient(ctx, false), args[0], state.GitInput(args[1], ref, subDir)) }, } diff --git a/cmd/dagger/cmd/input/json.go b/cmd/dagger/cmd/input/json.go index 7b50513d..34e5fffd 100644 --- a/cmd/dagger/cmd/input/json.go +++ b/cmd/dagger/cmd/input/json.go @@ -25,7 +25,7 @@ var jsonCmd = &cobra.Command{ updateEnvironmentInput( ctx, - common.NewClient(ctx), + common.NewClient(ctx, false), args[0], state.JSONInput(readInput(ctx, args[1])), ) diff --git a/cmd/dagger/cmd/input/secret.go b/cmd/dagger/cmd/input/secret.go index 6eca0935..b1d794f3 100644 --- a/cmd/dagger/cmd/input/secret.go +++ b/cmd/dagger/cmd/input/secret.go @@ -44,7 +44,7 @@ var secretCmd = &cobra.Command{ updateEnvironmentInput( ctx, - common.NewClient(ctx), + common.NewClient(ctx, false), args[0], state.SecretInput(secret), ) diff --git a/cmd/dagger/cmd/input/text.go b/cmd/dagger/cmd/input/text.go index d154a4d1..1bd8daae 100644 --- a/cmd/dagger/cmd/input/text.go +++ b/cmd/dagger/cmd/input/text.go @@ -25,7 +25,7 @@ var textCmd = &cobra.Command{ updateEnvironmentInput( ctx, - common.NewClient(ctx), + common.NewClient(ctx, false), args[0], state.TextInput(readInput(ctx, args[1])), ) diff --git a/cmd/dagger/cmd/input/yaml.go b/cmd/dagger/cmd/input/yaml.go index 78495617..977cd5ba 100644 --- a/cmd/dagger/cmd/input/yaml.go +++ b/cmd/dagger/cmd/input/yaml.go @@ -25,7 +25,7 @@ var yamlCmd = &cobra.Command{ updateEnvironmentInput( ctx, - common.NewClient(ctx), + common.NewClient(ctx, false), args[0], state.YAMLInput(readInput(ctx, args[1])), ) diff --git a/cmd/dagger/cmd/up.go b/cmd/dagger/cmd/up.go index 8f6b474b..361e9e0f 100644 --- a/cmd/dagger/cmd/up.go +++ b/cmd/dagger/cmd/up.go @@ -38,7 +38,7 @@ var upCmd = &cobra.Command{ workspace := common.CurrentWorkspace(ctx) st := common.CurrentEnvironmentState(ctx, workspace) - cl := common.NewClient(ctx) + cl := common.NewClient(ctx, viper.GetBool("no-cache")) // check that all inputs are set checkInputs(ctx, cl, st)