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

plugin should validate plugin params before proceeding #493

Closed
hoatle opened this issue Oct 5, 2018 · 0 comments
Closed

plugin should validate plugin params before proceeding #493

hoatle opened this issue Oct 5, 2018 · 0 comments

Comments

@hoatle
Copy link
Member

hoatle commented Oct 5, 2018

Currently, it's not validating plugin.

Need to validate specified params, fill in default params.

If all params are valid => proceed.

Otherwise, add a warning log and the plugin config.

I'm having this problem when my plugin config is this (yes, I know it's invalid):

vagrant:
  plugins:
    - _id: "essential-0"
      state: installed
      enabled: true

the error:

[TeracyDev::Plugin][INFO]: installing plugin: {"_id"=>"essential-0", "state"=>"installed", "enabled"=>true}
/Users/hoatle/k8s-dev/lib/teracy-dev/plugin.rb:19:in `block in sync'

/opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/dependency.rb:46:in `initialize': dependency name must be a String, was nil (ArgumentError)
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:290:in `new'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:290:in `block in internal_install'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:270:in `each'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:270:in `map'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:270:in `internal_install'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/bundler.rb:128:in `install'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/plugin/manager.rb:138:in `block in install_plugin'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/plugin/manager.rb:148:in `install_plugin'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/plugin.rb:28:in `block in sync'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/plugin.rb:16:in `each'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/plugin.rb:16:in `sync'
	from /Users/hoatle/k8s-dev/extensions/teracy-dev-core/lib/teracy-dev-core/config/plugins.rb:17:in `configure'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/config/manager.rb:33:in `block in configure'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/config/manager.rb:32:in `each'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/config/manager.rb:32:in `configure'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/loader.rb:146:in `configure'
	from /Users/hoatle/k8s-dev/lib/teracy-dev/loader.rb:153:in `block in configure_vagrant'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/v2/loader.rb:37:in `load'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/loader.rb:119:in `each'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/loader.rb:119:in `block in load'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/loader.rb:116:in `each'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/config/loader.rb:116:in `load'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/vagrantfile.rb:28:in `initialize'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/environment.rb:793:in `new'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/environment.rb:793:in `vagrantfile'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/lib/vagrant/environment.rb:178:in `initialize'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/bin/vagrant:144:in `new'
	from /opt/vagrant/embedded/gems/2.1.5/gems/vagrant-2.1.5/bin/vagrant:144:in `<main>'
@hoatle hoatle added this to the v0.6.0-a5-dev milestone Oct 5, 2018
hieptranquoc added a commit to hieptranquoc/dev that referenced this issue Oct 8, 2018
@ghost ghost added stag:in-progress and removed sprt:next labels Oct 8, 2018
hieptranquoc added a commit to hieptranquoc/dev that referenced this issue Oct 9, 2018
hieptranquoc added a commit to hieptranquoc/dev that referenced this issue Oct 9, 2018
hieptranquoc added a commit to hieptranquoc/dev that referenced this issue Oct 9, 2018
@hoatle hoatle assigned hoatle and unassigned hieptranquoc Oct 9, 2018
hieptranquoc added a commit to hieptranquoc/dev that referenced this issue Oct 9, 2018
hoatle added a commit that referenced this issue Oct 9, 2018
…ugin-params-before-proceeding

@ #493 | should validate plugin params before proceeding
hoatle added a commit that referenced this issue Oct 9, 2018
@hoatle hoatle assigned hieptranquoc and unassigned hoatle Oct 9, 2018
@hoatle hoatle closed this as completed Oct 9, 2018
@ghost ghost removed the stag:under-verification label Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants