Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lint errors #542

Merged
merged 1 commit into from
Apr 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/nginx/pkg/template/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ import (
"encoding/json"
"os"
"path"
"strings"
"reflect"
"strings"
"testing"

"io/ioutil"

"k8s.io/ingress/controllers/nginx/pkg/config"
"k8s.io/ingress/core/pkg/ingress"
"k8s.io/ingress/core/pkg/ingress/annotations/rewrite"
"k8s.io/ingress/core/pkg/ingress/annotations/authreq"
"k8s.io/ingress/core/pkg/ingress/annotations/rewrite"
)

var (
Expand Down
22 changes: 11 additions & 11 deletions core/pkg/ingress/annotations/authreq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package authreq

import (
"net/url"
"strings"
"regexp"
"strings"

"k8s.io/kubernetes/pkg/apis/extensions"

Expand All @@ -33,20 +33,20 @@ const (
authSigninURL = "ingress.kubernetes.io/auth-signin"
authMethod = "ingress.kubernetes.io/auth-method"
authBody = "ingress.kubernetes.io/auth-send-body"
authHeaders = "ingress.kubernetes.io/auth-response-headers"
authHeaders = "ingress.kubernetes.io/auth-response-headers"
)

// External returns external authentication configuration for an Ingress rule
type External struct {
URL string `json:"url"`
SigninURL string `json:"signinUrl"`
Method string `json:"method"`
SendBody bool `json:"sendBody"`
URL string `json:"url"`
SigninURL string `json:"signinUrl"`
Method string `json:"method"`
SendBody bool `json:"sendBody"`
ResponseHeaders []string `json:"responseHeaders"`
}

var (
methods = []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "CONNECT", "OPTIONS", "TRACE"}
methods = []string{"GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "CONNECT", "OPTIONS", "TRACE"}
headerRegexp = regexp.MustCompile(`^[a-zA-Z\d\-_]+$`)
)

Expand Down Expand Up @@ -128,10 +128,10 @@ func (a authReq) Parse(ing *extensions.Ingress) (interface{}, error) {
sb, _ := parser.GetBoolAnnotation(authBody, ing)

return &External{
URL: str,
SigninURL: signin,
Method: m,
SendBody: sb,
URL: str,
SigninURL: signin,
Method: m,
SendBody: sb,
ResponseHeaders: h,
}, nil
}
2 changes: 1 addition & 1 deletion core/pkg/ingress/annotations/authreq/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ package authreq

import (
"fmt"
"testing"
"reflect"
"testing"

"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/apis/extensions"
Expand Down
4 changes: 2 additions & 2 deletions core/pkg/k8s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func IsValidService(kubeClient clientset.Interface, name string) (*api.Service,
return kubeClient.Core().Services(ns).Get(name)
}

// isValidConfigMap check if exists a configmap with the specified name
// IsValidConfigMap check if exists a configmap with the specified name
func IsValidConfigMap(kubeClient clientset.Interface, fullName string) (*api.ConfigMap, error) {

ns, name, err := ParseNameNS(fullName)
Expand All @@ -53,7 +53,7 @@ func IsValidConfigMap(kubeClient clientset.Interface, fullName string) (*api.Con

}

// isValidNamespace chck if exists a namespace with the specified name
// IsValidNamespace chck if exists a namespace with the specified name
func IsValidNamespace(kubeClient clientset.Interface, name string) (*api.Namespace, error) {
return kubeClient.Core().Namespaces().Get(name)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package main

import (
"fmt"
"net/http"
"strings"
"math/rand"
"net/http"
"strconv"
"strings"
)

// Sample authentication service returning several HTTP headers in response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import (
)

func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "UserID: %s, UserRole: %s", r.Header.Get("UserID"), r.Header.Get("UserRole"))}
fmt.Fprintf(w, "UserID: %s, UserRole: %s", r.Header.Get("UserID"), r.Header.Get("UserRole"))
}

// Sample "echo" service displaying UserID and UserRole HTTP request headers
func main() {
Expand Down