Fix lint issues

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-12-05 13:28:28 -03:00
parent 1fed943b3d
commit 68f344233b
17 changed files with 33 additions and 34 deletions

View file

@ -24,8 +24,8 @@ import (
"strings"
"time"
"k8s.io/klog"
"github.com/mitchellh/hashstructure"
"k8s.io/klog"
apiv1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"

View file

@ -20,8 +20,8 @@ import (
"fmt"
"strings"
"k8s.io/klog"
"github.com/imdario/mergo"
"k8s.io/klog"
apiv1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"

View file

@ -25,7 +25,6 @@ import (
"time"
"github.com/eapache/channels"
"k8s.io/klog"
corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
@ -41,6 +40,7 @@ import (
clientcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/tools/record"
"k8s.io/klog"
"k8s.io/ingress-nginx/internal/file"
"k8s.io/ingress-nginx/internal/ingress"
@ -387,11 +387,11 @@ func New(checkOCSP bool,
// find references in ingresses and update local ssl certs
if ings := store.secretIngressMap.Reference(key); len(ings) > 0 {
glog.Infof("secret %v was added and it is used in ingress annotations. Parsing...", key)
klog.Infof("secret %v was added and it is used in ingress annotations. Parsing...", key)
for _, ingKey := range ings {
ing, err := store.getIngress(ingKey)
if err != nil {
glog.Errorf("could not find Ingress %v in local store", ingKey)
klog.Errorf("could not find Ingress %v in local store", ingKey)
continue
}
store.syncIngress(ing)
@ -414,11 +414,11 @@ func New(checkOCSP bool,
// find references in ingresses and update local ssl certs
if ings := store.secretIngressMap.Reference(key); len(ings) > 0 {
glog.Infof("secret %v was updated and it is used in ingress annotations. Parsing...", key)
klog.Infof("secret %v was updated and it is used in ingress annotations. Parsing...", key)
for _, ingKey := range ings {
ing, err := store.getIngress(ingKey)
if err != nil {
glog.Errorf("could not find Ingress %v in local store", ingKey)
klog.Errorf("could not find Ingress %v in local store", ingKey)
continue
}
store.syncIngress(ing)
@ -453,11 +453,11 @@ func New(checkOCSP bool,
// find references in ingresses
if ings := store.secretIngressMap.Reference(key); len(ings) > 0 {
glog.Infof("secret %v was deleted and it is used in ingress annotations. Parsing...", key)
klog.Infof("secret %v was deleted and it is used in ingress annotations. Parsing...", key)
for _, ingKey := range ings {
ing, err := store.getIngress(ingKey)
if err != nil {
glog.Errorf("could not find Ingress %v in local store", ingKey)
klog.Errorf("could not find Ingress %v in local store", ingKey)
continue
}
store.syncIngress(ing)
@ -592,7 +592,7 @@ func New(checkOCSP bool,
// annotation to a go struct
func (s *k8sStore) syncIngress(ing *extensions.Ingress) {
key := k8s.MetaNamespaceKey(ing)
glog.V(3).Infof("updating annotations information for ingress %v", key)
klog.V(3).Infof("updating annotations information for ingress %v", key)
copyIng := &extensions.Ingress{}
ing.ObjectMeta.DeepCopyInto(&copyIng.ObjectMeta)
@ -615,7 +615,7 @@ func (s *k8sStore) syncIngress(ing *extensions.Ingress) {
ParsedAnnotations: s.annotations.Extract(ing),
})
if err != nil {
glog.Error(err)
klog.Error(err)
}
}

View file

@ -31,7 +31,6 @@ import (
text_template "text/template"
"time"
"k8s.io/klog"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/sets"
@ -41,6 +40,7 @@ import (
"k8s.io/ingress-nginx/internal/ingress/annotations/ratelimit"
"k8s.io/ingress-nginx/internal/ingress/controller/config"
ing_net "k8s.io/ingress-nginx/internal/net"
"k8s.io/klog"
)
const (
@ -738,13 +738,13 @@ var nginxOffsetRegex = regexp.MustCompile("^[0-9]+[kKmMgG]{0,1}$")
func isValidByteSize(input interface{}, isOffset bool) bool {
s, ok := input.(string)
if !ok {
glog.Errorf("expected an 'string' type but %T was returned", input)
klog.Errorf("expected an 'string' type but %T was returned", input)
return false
}
s = strings.TrimSpace(s)
if s == "" {
glog.V(2).Info("empty byte size, hence it will not be set")
klog.V(2).Info("empty byte size, hence it will not be set")
return false
}