Fix lint issues
This commit is contained in:
parent
1fed943b3d
commit
68f344233b
17 changed files with 33 additions and 34 deletions
|
@ -19,8 +19,8 @@ package file
|
|||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"k8s.io/klog"
|
||||
"io/ioutil"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// SHA1 returns the SHA1 of a file.
|
||||
|
|
|
@ -20,8 +20,8 @@ import (
|
|||
"regexp"
|
||||
"strings"
|
||||
|
||||
"k8s.io/klog"
|
||||
extensions "k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations/parser"
|
||||
"k8s.io/ingress-nginx/internal/ingress/resolver"
|
||||
|
|
|
@ -17,8 +17,8 @@ limitations under the License.
|
|||
package class
|
||||
|
||||
import (
|
||||
"k8s.io/klog"
|
||||
extensions "k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -19,9 +19,8 @@ package sessionaffinity
|
|||
import (
|
||||
"regexp"
|
||||
|
||||
"k8s.io/klog"
|
||||
|
||||
extensions "k8s.io/api/extensions/v1beta1"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/ingress-nginx/internal/ingress/annotations/parser"
|
||||
"k8s.io/ingress-nginx/internal/ingress/resolver"
|
||||
|
@ -87,31 +86,31 @@ func (a affinity) cookieAffinityParse(ing *extensions.Ingress) *Cookie {
|
|||
|
||||
cookie.Name, err = parser.GetStringAnnotation(annotationAffinityCookieName, ing)
|
||||
if err != nil {
|
||||
glog.V(3).Infof("Ingress %v: No value found in annotation %v. Using the default %v", ing.Name, annotationAffinityCookieName, defaultAffinityCookieName)
|
||||
klog.V(3).Infof("Ingress %v: No value found in annotation %v. Using the default %v", ing.Name, annotationAffinityCookieName, defaultAffinityCookieName)
|
||||
cookie.Name = defaultAffinityCookieName
|
||||
}
|
||||
|
||||
cookie.Hash, err = parser.GetStringAnnotation(annotationAffinityCookieHash, ing)
|
||||
if err != nil || !affinityCookieHashRegex.MatchString(cookie.Hash) {
|
||||
glog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Setting it to default %v", ing.Name, annotationAffinityCookieHash, defaultAffinityCookieHash)
|
||||
klog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Setting it to default %v", ing.Name, annotationAffinityCookieHash, defaultAffinityCookieHash)
|
||||
cookie.Hash = defaultAffinityCookieHash
|
||||
}
|
||||
|
||||
cookie.Expires, err = parser.GetStringAnnotation(annotationAffinityCookieExpires, ing)
|
||||
if err != nil || !affinityCookieExpiresRegex.MatchString(cookie.Expires) {
|
||||
glog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieExpires)
|
||||
klog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieExpires)
|
||||
cookie.Expires = ""
|
||||
}
|
||||
|
||||
cookie.MaxAge, err = parser.GetStringAnnotation(annotationAffinityCookieMaxAge, ing)
|
||||
if err != nil || !affinityCookieExpiresRegex.MatchString(cookie.MaxAge) {
|
||||
glog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieMaxAge)
|
||||
klog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieMaxAge)
|
||||
cookie.MaxAge = ""
|
||||
}
|
||||
|
||||
cookie.Path, err = parser.GetStringAnnotation(annotationAffinityCookiePath, ing)
|
||||
if err != nil {
|
||||
glog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieMaxAge)
|
||||
klog.V(3).Infof("Invalid or no annotation value found in Ingress %v: %v. Ignoring it", ing.Name, annotationAffinityCookieMaxAge)
|
||||
}
|
||||
|
||||
return cookie
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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(©Ing.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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/ingress-nginx/internal/ingress"
|
||||
|
|
|
@ -23,8 +23,8 @@ import (
|
|||
"regexp"
|
||||
"strconv"
|
||||
|
||||
"k8s.io/klog"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
@ -55,8 +55,8 @@ func (em BinaryNameMatcher) MatchAndName(nacl common.ProcAttributes) (bool, stri
|
|||
}
|
||||
|
||||
// String returns the name of the binary to match
|
||||
func (m BinaryNameMatcher) String() string {
|
||||
return fmt.Sprintf("%+v", m.Binary)
|
||||
func (em BinaryNameMatcher) String() string {
|
||||
return fmt.Sprintf("%+v", em.Binary)
|
||||
}
|
||||
|
||||
type namedProcessData struct {
|
||||
|
|
|
@ -23,10 +23,10 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
|
||||
"k8s.io/klog"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
type upstream struct {
|
||||
|
|
|
@ -25,8 +25,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/klog"
|
||||
|
||||
pool "gopkg.in/go-playground/pool.v3"
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
|
|
|
@ -21,11 +21,11 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"k8s.io/klog"
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
clientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
// ParseNameNS parses a string searching a namespace and name
|
||||
|
|
|
@ -32,8 +32,8 @@ import (
|
|||
"strconv"
|
||||
"time"
|
||||
|
||||
"k8s.io/klog"
|
||||
"github.com/zakjan/cert-chain-resolver/certUtil"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ package e2e
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/klog"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"k8s.io/klog"
|
||||
|
||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
)
|
||||
|
|
|
@ -30,8 +30,8 @@ import (
|
|||
"k8s.io/client-go/kubernetes"
|
||||
restclient "k8s.io/client-go/rest"
|
||||
|
||||
"k8s.io/klog"
|
||||
"github.com/pkg/errors"
|
||||
"k8s.io/klog"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
|
Loading…
Reference in a new issue