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

Conversation

soapy1
Copy link
Contributor

@soapy1 soapy1 commented Sep 26, 2022

This PR aims to allow vagrant-go users to uninstall legacy Ruby plugins.

  • Separates out loading global legacy plugins from local legacy plugins
  • Actually loads local plugins (previously they were just ignored)
# Install local plugin
% ./vagrant plugin install vagrant-vbguest --local
  Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.30.0)'!

% cat Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/bionic64"
  config.vbguest.auto_update = false
end

# Local plugin exercised from parsing the config
% ./vagrant status
  Current machine states:
  
  default                   not created (virtualbox)
  
  The environment has not yet been created. Run `vagrant up` to
  create the environment. If a machine is not created, only the
  default provider will be shown. So if a provider is not listed,
  then the machine is not created for that environment.

# Uninstall works
 % ./vagrant plugin uninstall vagrant-vbguest --local
  Uninstalling the 'vagrant-vbguest' plugin...

% ./vagrant plugin list
  No plugins installed.

Fixes: #12864

@soapy1 soapy1 force-pushed the vagrant-legacy-plugin-uninstall branch 2 times, most recently from 91b7e79 to ad9b93b Compare October 3, 2022 22:17
@soapy1 soapy1 force-pushed the vagrant-legacy-plugin-uninstall branch from f84c0cf to 54acc92 Compare October 4, 2022 19:24
@@ -156,6 +156,13 @@ func New(opts ...Option) (*Runner, error) {
return runner, nil
}

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?

@soapy1 soapy1 marked this pull request as ready for review October 4, 2022 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uninstalling legacy plugins raises errors
1 participant