Skip to content

Commit

Permalink
Merge pull request #4420 from aledbf/cleanup
Browse files Browse the repository at this point in the history
Cleanup
  • Loading branch information
k8s-ci-robot authored Aug 9, 2019
2 parents 8c47219 + a768b60 commit 2a3b30b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
7 changes: 1 addition & 6 deletions internal/ingress/annotations/authreq/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,7 @@ func (e1 *Config) Equal(e2 *Config) bool {
return false
}

match = sets.StringElementsMatch(e1.AuthCacheDuration, e2.AuthCacheDuration)
if !match {
return false
}

return true
return sets.StringElementsMatch(e1.AuthCacheDuration, e2.AuthCacheDuration)
}

var (
Expand Down
4 changes: 2 additions & 2 deletions internal/ingress/annotations/authreq/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func TestHeaderAnnotations(t *testing.T) {
i, err := NewParser(&resolver.Mock{}).Parse(ing)
if test.expErr {
if err == nil {
t.Errorf("%v: expected error but retuned nil", err.Error())
t.Error("expected error but retuned nil")
}
continue
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestCacheDurationAnnotations(t *testing.T) {
i, err := NewParser(&resolver.Mock{}).Parse(ing)
if test.expErr {
if err == nil {
t.Errorf("%v: expected error but retuned nil", err.Error())
t.Errorf("expected error but retuned nil")
}
continue
}
Expand Down
12 changes: 6 additions & 6 deletions internal/ingress/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ type Location struct {
// Backend describes the name of the backend to use.
Backend string `json:"backend"`
// Service describes the referenced services from the ingress
Service *apiv1.Service `json:"service,omitempty"`
Service *apiv1.Service `json:"service,omitempty" hash:"ignore"`
// Port describes to which port from the service
Port intstr.IntOrString `json:"port"`
// Overwrite the Host header passed into the backend. Defaults to
Expand Down Expand Up @@ -290,7 +290,7 @@ type Location struct {
ClientBodyBufferSize string `json:"clientBodyBufferSize,omitempty"`
// DefaultBackend allows the use of a custom default backend for this location.
// +optional
DefaultBackend *apiv1.Service `json:"defaultBackend,omitempty"`
DefaultBackend *apiv1.Service `json:"defaultBackend,omitempty" hash:"ignore"`
// DefaultBackendUpstreamName is the upstream-formatted string for the name of
// this location's custom default backend
DefaultBackendUpstreamName string `json:"defaultBackendUpstreamName,omitempty"`
Expand Down Expand Up @@ -327,7 +327,7 @@ type Location struct {
// The endpoints must provide the TLS termination exposing the required SSL certificate.
// The ingress controller only pipes the underlying TCP connection
type SSLPassthroughBackend struct {
Service *apiv1.Service `json:"service,omitempty"`
Service *apiv1.Service `json:"service,omitempty" hash:"ignore"`
Port intstr.IntOrString `json:"port"`
// Backend describes the endpoints to use.
Backend string `json:"namespace,omitempty"`
Expand All @@ -344,7 +344,7 @@ type L4Service struct {
// Endpoints active endpoints of the service
Endpoints []Endpoint `json:"endpoints,omitempty"`
// k8s Service
Service *apiv1.Service `json:"service,omitempty"`
Service *apiv1.Service `json:"service,omitempty" hash:"ignore"`
}

// L4Backend describes the kubernetes service behind L4 Ingress service
Expand All @@ -365,8 +365,8 @@ type ProxyProtocol struct {

// Ingress holds the definition of an Ingress plus its annotations
type Ingress struct {
networking.Ingress
ParsedAnnotations *annotations.Ingress
networking.Ingress `hash:"ignore"`
ParsedAnnotations *annotations.Ingress `json:"parsedAnnotations"`
}

// GeneralConfig holds the definition of lua general configuration data
Expand Down
4 changes: 2 additions & 2 deletions internal/k8s/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ func NetworkingIngressAvailable(client clientset.Interface) bool {
return false
}

serverVersion, _ := client.Discovery().ServerVersion()
serverVersion, err := client.Discovery().ServerVersion()
if err != nil {
klog.Errorf("unexpected error parsing Kubernetes version: %v", err)
return false
}

runningVersion, _ := version.ParseGeneric(serverVersion.String())
runningVersion, err := version.ParseGeneric(serverVersion.String())
if err != nil {
klog.Errorf("unexpected error parsing running Kubernetes version: %v", err)
return false
Expand Down

0 comments on commit 2a3b30b

Please sign in to comment.