Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use absolute file path for local provider paths #66

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion pulumitest/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (a *PulumiTest) Install() string {
cmd.Dir = a.source
out, err := cmd.CombinedOutput()
if err != nil {
a.t.Fatalf("failed to installing packages and plugins: %s\n%s", err, out)
a.t.Fatalf("failed to install packages and plugins: %s\n%s", err, out)
}
return string(out)
}
11 changes: 8 additions & 3 deletions pulumitest/newStack.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,24 @@ func (pt *PulumiTest) NewStack(stackName string, opts ...optnewstack.NewStackOpt
}
sort.Strings(providerPluginNames)
for _, name := range providerPluginNames {
path := providerPluginPaths[providers.ProviderName(name)]
relPath := providerPluginPaths[providers.ProviderName(name)]
absPath, err := filepath.Abs(relPath)
if err != nil {
pt.t.Fatalf("failed to get absolute path for %s: %s", relPath, err)
}

found := false
for _, provider := range providerPlugins {
if provider.Name == name {
provider.Path = path
provider.Path = absPath
found = true
break
}
}
if !found {
providerPlugins = append(providerPlugins, workspace.PluginOptions{
Name: name,
Path: path,
Path: absPath,
})
}
}
Expand Down
Loading