Merge pull request #811 from dagger/fix-no-cache
cmd/common: restored no-cache behavior
This commit is contained in:
commit
b770b01a3e
@ -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")
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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]))
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
|
@ -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))
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -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])),
|
||||
)
|
||||
|
@ -44,7 +44,7 @@ var secretCmd = &cobra.Command{
|
||||
|
||||
updateEnvironmentInput(
|
||||
ctx,
|
||||
common.NewClient(ctx),
|
||||
common.NewClient(ctx, false),
|
||||
args[0],
|
||||
state.SecretInput(secret),
|
||||
)
|
||||
|
@ -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])),
|
||||
)
|
||||
|
@ -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])),
|
||||
)
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user