Lint files
Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
parent
e9fc9fdf12
commit
54be6beaab
4 changed files with 5 additions and 5 deletions
|
@ -133,7 +133,7 @@ func (dc *DomainsCertificates) removeDuplicates() {
|
||||||
for i2 := i + 1; i2 < len(dc.Certs); i2++ {
|
for i2 := i + 1; i2 < len(dc.Certs); i2++ {
|
||||||
if reflect.DeepEqual(dc.Certs[i].Domains, dc.Certs[i2].Domains) {
|
if reflect.DeepEqual(dc.Certs[i].Domains, dc.Certs[i2].Domains) {
|
||||||
// delete
|
// delete
|
||||||
log.Warnf("Remove duplicate cert: %+v, exipration :%s", dc.Certs[i2].Domains, dc.Certs[i2].tlsCert.Leaf.NotAfter.String())
|
log.Warnf("Remove duplicate cert: %+v, expiration :%s", dc.Certs[i2].Domains, dc.Certs[i2].tlsCert.Leaf.NotAfter.String())
|
||||||
dc.Certs = append(dc.Certs[:i2], dc.Certs[i2+1:]...)
|
dc.Certs = append(dc.Certs[:i2], dc.Certs[i2+1:]...)
|
||||||
i2--
|
i2--
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ func TestRemoveDuplicates(t *testing.T) {
|
||||||
t.Errorf("Bad expiration %s date for domain %+v, now %s", cert.tlsCert.Leaf.NotAfter.String(), cert, now.Add(48*time.Hour).Truncate(1*time.Second).String())
|
t.Errorf("Bad expiration %s date for domain %+v, now %s", cert.tlsCert.Leaf.NotAfter.String(), cert, now.Add(48*time.Hour).Truncate(1*time.Second).String())
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
t.Errorf("Unkown domain %+v", cert)
|
t.Errorf("Unknown domain %+v", cert)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -505,7 +505,7 @@ func processPorts(application marathon.Application, task marathon.Task) []int {
|
||||||
|
|
||||||
// Using port definition if available
|
// Using port definition if available
|
||||||
if application.PortDefinitions != nil && len(*application.PortDefinitions) > 0 {
|
if application.PortDefinitions != nil && len(*application.PortDefinitions) > 0 {
|
||||||
ports := make([]int, 0)
|
var ports []int
|
||||||
for _, def := range *application.PortDefinitions {
|
for _, def := range *application.PortDefinitions {
|
||||||
if def.Port != nil {
|
if def.Port != nil {
|
||||||
ports = append(ports, *def.Port)
|
ports = append(ports, *def.Port)
|
||||||
|
@ -515,7 +515,7 @@ func processPorts(application marathon.Application, task marathon.Task) []int {
|
||||||
}
|
}
|
||||||
// If using IP-per-task using this port definition
|
// If using IP-per-task using this port definition
|
||||||
if application.IPAddressPerTask != nil && len(*((*application.IPAddressPerTask).Discovery).Ports) > 0 {
|
if application.IPAddressPerTask != nil && len(*((*application.IPAddressPerTask).Discovery).Ports) > 0 {
|
||||||
ports := make([]int, 0)
|
var ports []int
|
||||||
for _, def := range *((*application.IPAddressPerTask).Discovery).Ports {
|
for _, def := range *((*application.IPAddressPerTask).Discovery).Ports {
|
||||||
ports = append(ports, def.Number)
|
ports = append(ports, def.Number)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package safe
|
package safe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/cenk/backoff"
|
"github.com/cenk/backoff"
|
||||||
"github.com/containous/traefik/log"
|
"github.com/containous/traefik/log"
|
||||||
"context"
|
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue