Plugins and token
This commit is contained in:
parent
3bf4a8fbe2
commit
4c0a3721d0
1 changed files with 10 additions and 2 deletions
|
@ -27,10 +27,10 @@ func initPlugins(staticCfg *static.Configuration) (*plugins.Client, map[string]p
|
||||||
var client *plugins.Client
|
var client *plugins.Client
|
||||||
plgs := map[string]plugins.Descriptor{}
|
plgs := map[string]plugins.Descriptor{}
|
||||||
|
|
||||||
if isPilotEnabled(staticCfg) && hasPlugins(staticCfg) {
|
if hasPlugins(staticCfg) {
|
||||||
opts := plugins.ClientOptions{
|
opts := plugins.ClientOptions{
|
||||||
Output: outputDir,
|
Output: outputDir,
|
||||||
Token: staticCfg.Pilot.Token,
|
Token: getPilotToken(staticCfg),
|
||||||
}
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
@ -79,6 +79,14 @@ func isPilotEnabled(staticCfg *static.Configuration) bool {
|
||||||
return staticCfg.Pilot != nil && staticCfg.Pilot.Token != ""
|
return staticCfg.Pilot != nil && staticCfg.Pilot.Token != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getPilotToken(staticCfg *static.Configuration) string {
|
||||||
|
if staticCfg.Pilot == nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
return staticCfg.Pilot.Token
|
||||||
|
}
|
||||||
|
|
||||||
func hasPlugins(staticCfg *static.Configuration) bool {
|
func hasPlugins(staticCfg *static.Configuration) bool {
|
||||||
return staticCfg.Experimental != nil && len(staticCfg.Experimental.Plugins) > 0
|
return staticCfg.Experimental != nil && len(staticCfg.Experimental.Plugins) > 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue