Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[WIP] backend/enhanced: start with absolute configuration path #22096

Merged
merged 2 commits into from
Jul 17, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion backend/remote/backend_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ func (b *Remote) plan(stopCtx, cancelCtx context.Context, op *backend.Operation,

var configDir string
if op.ConfigDir != "" {
// de-normalize the config path
configDir, err = filepath.Abs(op.ConfigDir)
// Make sure to take the working directory into account by removing
// the working directory from the current path. This will result in
// a path that points to the expected root of the workspace.
configDir = filepath.Clean(strings.TrimSuffix(
filepath.Clean(op.ConfigDir),
filepath.Clean(configDir),
filepath.Clean(w.WorkingDirectory),
))
} else {
Expand Down