Skip to content

Commit

Permalink
feat(plugins): added better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
StanGirard committed Sep 26, 2022
1 parent 6f4641e commit 2f8d566
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugins/commons/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type Check struct {
Description string `yaml:"description"` // Description of the check
Status string `yaml:"status"` // Status of the check - OK, FAIL
Id string `yaml:"id"` // ID of the check - unique identifier for the check - AWS_IAM_001
Category string `yaml:"category"` // Category of the check - Security, Cost, Performance, Fault Tolerance, Operational Excellence, etc ...
Results []Result `yaml:"results"` // Results of the check
Duration time.Duration `yaml:"duration"` // Duration of the check
StartTime time.Time
Expand Down
8 changes: 7 additions & 1 deletion plugins/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package manager

import (
"encoding/gob"
"fmt"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -42,7 +43,12 @@ func RunPlugin(pluginInput commons.Plugin, c *commons.Config) []commons.Tests {
// Connect via RPC
rpcClient, err := client.Client()
if err != nil {
if strings.Contains(err.Error(), "Incompatible API version with plugin") {
fmt.Println("Plugin " + pluginInput.Name + " is not compatible with YATAS. Please update it.")
log.Fatal(err)
}
log.Fatal(err)

}

// Request the plugin
Expand All @@ -63,7 +69,7 @@ func RunPlugin(pluginInput commons.Plugin, c *commons.Config) []commons.Tests {
// This prevents users from executing bad plugins or executing a plugin
// directory. It is a UX feature, not a security feature.
var handshakeConfig = plugin.HandshakeConfig{
ProtocolVersion: 3,
ProtocolVersion: 1,
MagicCookieKey: "BASIC_PLUGIN",
MagicCookieValue: "hello",
}
Expand Down

0 comments on commit 2f8d566

Please sign in to comment.