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

Vagrant legacy plugin uninstall #12920

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Load local plugin for project when loading the project
soapy1 committed Oct 4, 2022
commit 2e4a3e8a3b1bc4c203fa283b4a4eb4e9b9e8e602
6 changes: 6 additions & 0 deletions internal/client/basis.go
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ import (

"github.com/hashicorp/vagrant-plugin-sdk/config"
"github.com/hashicorp/vagrant-plugin-sdk/helper/path"
"github.com/hashicorp/vagrant-plugin-sdk/helper/paths"
"github.com/hashicorp/vagrant-plugin-sdk/proto/vagrant_plugin_sdk"
"github.com/hashicorp/vagrant-plugin-sdk/terminal"
"github.com/hashicorp/vagrant/internal/server/proto/vagrant_server"
@@ -44,6 +45,11 @@ func (b *Basis) DetectProject() (p *Project, err error) {
if err != nil && status.Code(err) != codes.NotFound {
return
}
dataPath, err := paths.VagrantData()
if err != nil {
return
}
b.client.LoadLocalProjectPlugins(dataPath.Join(b.basis.Name, "project", p.project.Name).String())

if err == nil {
p.vagrantfile = v
4 changes: 4 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
@@ -201,6 +201,10 @@ func (c *Client) UI() terminal.UI {
return c.ui
}

func (c *Client) LoadLocalProjectPlugins(path string) error {
return c.runner.LoadLocalProjectPlugins(path)
}

type clientConfig struct {
connectOpts []serverclient.ConnectOption
}
1 change: 1 addition & 0 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
@@ -157,6 +157,7 @@ func New(opts ...Option) (*Runner, error) {
}

func (r *Runner) LoadLocalProjectPlugins(path string) error {
// TODO: should this check if the runner is local?
err := r.plugins.LoadLocalLegacyPlugins(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too sure about this approach. If the runner is local then it should be able to load local project plugins. Not sure how to resolve the situation where the runner is remote?

r.vagrantRubyClient, r.vagrantRubyRuntime, path)
return err