Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Mar 22, 2024
1 parent 7176fd9 commit 8f65288
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bundle/config/mutator/set_variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func setVariable(ctx context.Context, v *variable.Variable, name string) diag.Di
if val, ok := env.Lookup(ctx, envVarName); ok {
err := v.Set(val)
if err != nil {
return diag.Errorf(`failed to assign value "%s" to variable %s from environment variable %s with error: %w`, val, name, envVarName, err)
return diag.Errorf(`failed to assign value "%s" to variable %s from environment variable %s with error: %v`, val, name, envVarName, err)
}
return nil
}
Expand All @@ -41,7 +41,7 @@ func setVariable(ctx context.Context, v *variable.Variable, name string) diag.Di
if v.HasDefault() {
err := v.Set(*v.Default)
if err != nil {
return diag.Errorf(`failed to assign default value from config "%s" to variable %s with error: %w`, *v.Default, name, err)
return diag.Errorf(`failed to assign default value from config "%s" to variable %s with error: %v`, *v.Default, name, err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion bundle/deploy/state_pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,5 +453,5 @@ func TestStatePullNewerDeploymentStateVersion(t *testing.T) {

diags := bundle.Apply(ctx, b, s)
require.True(t, diags.HasError())
require.Contains(t, diags.Error(), "remote deployment state is incompatible with the current version of the CLI, please upgrade to at least 1.2.3")
require.ErrorContains(t, diags.Error(), "remote deployment state is incompatible with the current version of the CLI, please upgrade to at least 1.2.3")
}
2 changes: 1 addition & 1 deletion bundle/deploy/terraform/interpolate.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ func (m *interpolateMutator) Apply(ctx context.Context, b *bundle.Bundle) diag.D
return dyn.V(fmt.Sprintf("${%s}", path.String())), nil
})
})
return diag.FromErr(err)

return diag.FromErr(err)
}
4 changes: 2 additions & 2 deletions bundle/deploy/terraform/interpolate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ func TestInterpolateUnknownResourceType(t *testing.T) {
},
}

err := bundle.Apply(context.Background(), b, Interpolate())
assert.Contains(t, err.Error(), `reference does not exist: ${resources.unknown.other_unknown.id}`)
diags := bundle.Apply(context.Background(), b, Interpolate())
assert.ErrorContains(t, diags.Error(), `reference does not exist: ${resources.unknown.other_unknown.id}`)
}

0 comments on commit 8f65288

Please sign in to comment.