Merge pull request #811 from dagger/fix-no-cache

cmd/common: restored no-cache behavior
This commit is contained in:
Sam Alba 2021-07-12 14:38:20 +02:00 committed by GitHub
commit b770b01a3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 11 deletions

View File

@ -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")
}

View File

@ -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)

View File

@ -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]))
},
}

View File

@ -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"),

View File

@ -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))
},
}

View File

@ -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])),
)

View File

@ -44,7 +44,7 @@ var secretCmd = &cobra.Command{
updateEnvironmentInput(
ctx,
common.NewClient(ctx),
common.NewClient(ctx, false),
args[0],
state.SecretInput(secret),
)

View File

@ -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])),
)

View File

@ -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])),
)

View File

@ -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)