Skip to content

Commit 791eca0

Browse files
committed
Add logging for failed cert additions. Update router
1 parent 1c77426 commit 791eca0

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

core/common/common.go

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"strings"
88

99
"github.com/nanopack/portal/balance"
10+
"github.com/nanopack/portal/config"
1011
"github.com/nanopack/portal/core"
1112
"github.com/nanopack/portal/database"
1213
"github.com/nanopack/portal/proxymgr"
@@ -320,6 +321,7 @@ func SetCert(cert core.CertBundle) error {
320321
// save to backend
321322
err = database.SetCert(cert)
322323
if err != nil {
324+
config.Log.Error("Failed to save cert to db, undoing")
323325
// undo proxymgr action
324326
if uerr := proxymgr.SetCerts(oldCerts); uerr != nil {
325327
err = fmt.Errorf("%s - %s", err, uerr)

proxymgr/nanobox.go

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ func (self Nanobox) SetCert(cert core.CertBundle) error {
8484
// for idempotency
8585
for i := range certs {
8686
if certs[i].Cert == cert.Cert && certs[i].Key == cert.Key {
87+
config.Log.Debug("Cert already added, skipping")
8788
return nil
8889
}
8990
}

scripts/build.sh

+4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ getCurrTag() {
2121

2222
# build portal
2323
echo "Building portal..."
24+
# export GOROOT="/usr/local/go-1.7.5/"
25+
# export PATH=/usr/local/go-1.7.5/bin:$PATH
26+
27+
# should be built with go1.7.x until tls regression is resolved. also https://github.com/golang/go/issues/21133
2428
gox -ldflags="-s -X github.com/nanopack/portal/commands.tag=$(getCurrTag)
2529
-X github.com/nanopack/portal/commands.commit=$(getCurrCommit)" \
2630
-osarch "linux/amd64" -output="./build/{{.OS}}/{{.Arch}}/portal"

vendor/vendor.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@
159159
"revisionTime": "2017-03-27T21:44:30Z"
160160
},
161161
{
162-
"checksumSHA1": "xKA5NvBoR4p257SEXsEzbYKhYV0=",
162+
"checksumSHA1": "cMjh4PqNskcfJe/i8rl0DERI8o8=",
163163
"path": "github.com/nanobox-io/nanobox-router",
164-
"revision": "059779d975f5d9ed9913423d5e074e54edf4b501",
165-
"revisionTime": "2017-07-03T23:17:23Z"
164+
"revision": "bc67ee7d4d121988c7a5163e652862978053c683",
165+
"revisionTime": "2017-09-08T14:48:27Z"
166166
},
167167
{
168168
"checksumSHA1": "65+hx0QlLzpWe5pnjAzteKBnC10=",

0 commit comments

Comments
 (0)