Skip to content

Commit

Permalink
Merge commits
Browse files Browse the repository at this point in the history
  • Loading branch information
bowei committed Dec 28, 2017
1 parent a4ab574 commit 8de4032
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions pkg/controller/translator/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func (t *GCE) getServiceNodePort(be extensions.IngressBackend, namespace string)
return backends.ServicePort{}, errors.ErrNodePortNotFound{be, err}
}
svc := obj.(*api_v1.Service)
appProtocols, err := annotations.SvcAnnotations(svc.GetAnnotations()).ApplicationProtocols()
appProtocols, err := annotations.FromService(svc).ApplicationProtocols()
if err != nil {
return backends.ServicePort{}, errors.ErrSvcAppProtosParsing{svc, err}
}
Expand All @@ -191,9 +191,9 @@ PortLoop:
return backends.ServicePort{}, errors.ErrNodePortNotFound{be, fmt.Errorf("could not find matching nodeport from service")}
}

proto := utils.ProtocolHTTP
proto := annotations.ProtocolHTTP
if protoStr, exists := appProtocols[port.Name]; exists {
proto = utils.AppProtocol(protoStr)
proto = annotations.AppProtocol(protoStr)
}

p := backends.ServicePort{
Expand All @@ -202,7 +202,7 @@ PortLoop:
SvcName: types.NamespacedName{Namespace: namespace, Name: be.ServiceName},
SvcPort: be.ServicePort,
SvcTargetPort: port.TargetPort.String(),
NEGEnabled: t.negEnabled && annotations.SvcAnnotations(svc.GetAnnotations()).NEGEnabled(),
NEGEnabled: t.negEnabled && annotations.FromService(svc).NEGEnabled(),
}
return p, nil
}
Expand Down Expand Up @@ -284,7 +284,7 @@ func (t *GCE) ListZones() ([]string, error) {

// geHTTPProbe returns the http readiness probe from the first container
// that matches targetPort, from the set of pods matching the given labels.
func (t *GCE) getHTTPProbe(svc api_v1.Service, targetPort intstr.IntOrString, protocol utils.AppProtocol) (*api_v1.Probe, error) {
func (t *GCE) getHTTPProbe(svc api_v1.Service, targetPort intstr.IntOrString, protocol annotations.AppProtocol) (*api_v1.Probe, error) {
l := svc.Spec.Selector

// Lookup any container with a matching targetPort from the set of pods
Expand Down
10 changes: 5 additions & 5 deletions pkg/controller/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ package controller
import (
"encoding/json"
"fmt"
"strconv"

"github.com/golang/glog"

compute "google.golang.org/api/compute/v1"

api_v1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/cache"

"k8s.io/ingress-gce/pkg/annotations"
Expand Down Expand Up @@ -60,13 +64,9 @@ type ErrSvcAppProtosParsing struct {
origErr error
}

<<<<<<< HEAD
func (e ErrSvcAppProtosParsing) Error() string {
return fmt.Sprintf("could not parse %v annotation on Service %v/%v, err: %v", annotations.ServiceApplicationProtocolKey, e.svc.Namespace, e.svc.Name, e.origErr)
=======
func (e errorSvcAppProtosParsing) Error() string {
return fmt.Sprintf("could not parse Service app protocol annotation %v/%v, err: %v", e.svc.Namespace, e.svc.Name, e.origErr)
>>>>>>> Make annotation wrapper types internal keys private; adds unit tests

}

// compareLinks returns true if the 2 self links are equal.
Expand Down

0 comments on commit 8de4032

Please sign in to comment.