Skip to content

Commit

Permalink
Fix plugin-check cmd for provisioner only plugins (#88)
Browse files Browse the repository at this point in the history
Before change
```
~>  packer-sdc plugin-check packer-plugin-puppet
2021/11/11 14:06:49 this plugin defines no component.
```

After Change
```
~>   packer-sdc plugin-check packer-plugin-puppet && echo $?
0
```
  • Loading branch information
Wilken Rivera authored Nov 11, 2021
1 parent fe59092 commit a49f047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/packer-sdc/internal/plugincheck/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## `plugin-check`

`plugin-check` will check wether a plugin binary seems to work with packer.
`plugin-check` will check whether a plugin binary seems to work with packer.

Use: `packer-sdc plugin-check packer-plugin-happy-cloud`
3 changes: 2 additions & 1 deletion cmd/packer-sdc/internal/plugincheck/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (cmd *Command) run(args []string) error {
return errors.New("APIVersion needs to be set")
}

if len(desc.Builders) == 0 && len(desc.PostProcessors) == 0 && len(desc.Datasources) == 0 {
if len(desc.Builders) == 0 && len(desc.PostProcessors) == 0 && len(desc.Datasources) == 0 && len(desc.Provisioners) == 0 {

This comment has been minimized.

Copy link
@azr

azr Nov 15, 2021

Contributor

nice catch !

return errors.New("this plugin defines no component.")
}
return nil
Expand All @@ -92,6 +92,7 @@ type pluginDescription struct {
Builders []string `json:"builders"`
PostProcessors []string `json:"post_processors"`
Datasources []string `json:"datasources"`
Provisioners []string `json:"provisioners"`
}

func isOldPlugin(pluginName string) bool {
Expand Down

0 comments on commit a49f047

Please sign in to comment.