Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Address further comments in review
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-ol committed May 5, 2017
1 parent 2c6732b commit 85f55f0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion cmd/snaptel/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var (
}
flPluginCACerts = cli.StringFlag{
Name: "plugin-ca-certs, r",
Usage: "List of CA cert paths for plugin (directory/file) to verify TLS clients",
Usage: "List of CA cert paths (directory/file) for plugin to verify TLS clients",
}
flPluginType = cli.StringFlag{
Name: "plugin-type, t",
Expand Down
2 changes: 1 addition & 1 deletion control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ func New(cfg *Config) *pluginControl {
OptSetTempDirPath(cfg.TempDirPath),
}
runnerOpts := []pluginRunnerOpt{}
// Plugin Manager
if cfg.IsTLSEnabled() {
if cfg.CACertPaths != "" {
certPaths := filepath.SplitList(cfg.CACertPaths)
Expand All @@ -233,6 +232,7 @@ func New(cfg *Config) *pluginControl {
managerOpts = append(managerOpts, OptEnableManagerTLS(c.grpcSecurity))
runnerOpts = append(runnerOpts, OptEnableRunnerTLS(c.grpcSecurity))
}
// Plugin Manager
c.pluginManager = newPluginManager(managerOpts...)
controlLogger.WithFields(log.Fields{
"_block": "new",
Expand Down
2 changes: 1 addition & 1 deletion control/control_security_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build medium
// + build medium

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Expand Down
17 changes: 0 additions & 17 deletions control/fixtures/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,20 +155,3 @@ func (m MockRequestedMetric) Version() int {
func (m MockRequestedMetric) Namespace() core.Namespace {
return m.namespace
}

// func NewExecutablePlugin(a plugin.Arg, path string) (*plugin.ExecutablePlugin, error) {
// // Travis optimization: Try starting the plugin three times before finally
// // returning an error
// var e error
// var ep *plugin.ExecutablePlugin
// for i := 0; i < 3; i++ {
// ep, e = plugin.NewExecutablePlugin(a, path)
// if e == nil {
// break
// }
// if e != nil && i == 2 {
// return nil, e
// }
// }
// return ep, nil
// }
5 changes: 2 additions & 3 deletions control/fixtures/tls_cert_util.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build legacy small medium large
// + build legacy small medium large

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Expand Down Expand Up @@ -35,7 +35,6 @@ import (
"net"
"os"
"path/filepath"
"strings"
"time"
)

Expand Down Expand Up @@ -139,7 +138,7 @@ func (u CertTestUtil) MakeSubjCertKeyPair(cn, ou string, keyValidPeriod time.Dur
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth, x509.ExtKeyUsageServerAuth},
SubjectKeyId: subjPubSha256[:],
}
subjCertTpl.DNSNames = strings.Fields("localhost")
subjCertTpl.DNSNames = []string{"localhost"}
subjCertTpl.IPAddresses = []net.IP{net.ParseIP("127.0.0.1")}
subjCertBytes, err = x509.CreateCertificate(rand.Reader, &subjCertTpl, caCertTpl, subjPrivKey.Public(), caPrivKey)
return subjCertBytes, subjPrivKey, err
Expand Down

0 comments on commit 85f55f0

Please sign in to comment.