Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Oct 18, 2016
1 parent ff9dd0b commit 6f8cf30
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
24 changes: 13 additions & 11 deletions pkg/ingress/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ type Configuration struct {
PublishService string

UpstreamDefaults defaults.Upstream

Backend ingress.IController
}

// newIngressController creates a controller for nginx loadbalancer
Expand Down Expand Up @@ -332,25 +334,25 @@ func (ic *GenericController) sync(key interface{}) error {
}

// by default no custom configuration configmap
//cfg := &api.ConfigMap{}
cfg := &api.ConfigMap{}

/* if ic.cfg.ConfigMapName != "" {
// Search for custom configmap (defined in main args)
var err error
ns, name, _ := k8s.ParseNameNS(ic.cfg.ConfigMapName)
cfg, err = ic.getConfigMap(ns, name)
if err != nil {
return fmt.Errorf("unexpected error searching configmap %v: %v", ic.cfg.ConfigMapName, err)
}
if ic.cfg.ConfigMapName != "" {
// Search for custom configmap (defined in main args)
var err error
ns, name, _ := k8s.ParseNameNS(ic.cfg.ConfigMapName)
cfg, err = ic.getConfigMap(ns, name)
if err != nil {
return fmt.Errorf("unexpected error searching configmap %v: %v", ic.cfg.ConfigMapName, err)
}
*/
}

//ngxConfig := ic.backend.ReadConfig(cfg)
//ngxConfig.HealthzURL = ic.cfg.DefaultHealthzURL

ings := ic.ingLister.Store.List()
upstreams, servers := ic.getUpstreamServers(ings)

err := ic.backend.OnUpdate(ingress.Configuration{
err := ic.backend.OnUpdate(cfg, ingress.Configuration{
Upstreams: upstreams,
Servers: servers,
TCPUpstreams: ic.getTCPServices(),
Expand Down
4 changes: 3 additions & 1 deletion pkg/ingress/controller/launch.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/pflag"

"github.com/aledbf/ingress-controller/pkg/ingress"
"github.com/aledbf/ingress-controller/pkg/k8s"

"k8s.io/kubernetes/pkg/api"
Expand All @@ -23,7 +24,7 @@ import (
)

// NewIngressController returns a configured Ingress controller ready to start
func NewIngressController() IngressController {
func NewIngressController(backend ingress.IController) IngressController {
var (
flags = pflag.NewFlagSet("", pflag.ExitOnError)

Expand Down Expand Up @@ -146,6 +147,7 @@ func NewIngressController() IngressController {
DefaultSSLCertificate: *defSSLCertificate,
DefaultHealthzURL: *defHealthzURL,
PublishService: *publishSvc,
Backend: backend,
}

ic := newIngressController(config)
Expand Down
9 changes: 3 additions & 6 deletions pkg/ingress/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package ingress
import (
"os/exec"

"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/healthz"

"github.com/aledbf/ingress-controller/pkg/ingress/annotations/auth"
Expand All @@ -32,19 +33,15 @@ import (

// IController ...
type IController interface {
Name() string

HealthzPort() int
healthz.HealthzChecker

Start() *exec.Cmd
Stop() *exec.Cmd
Restart() *exec.Cmd

Test(file string) *exec.Cmd

HealthzChecker() healthz.HealthzChecker

OnUpdate(Configuration) error
OnUpdate(*api.ConfigMap, Configuration) error
}

// Configuration describes
Expand Down

0 comments on commit 6f8cf30

Please sign in to comment.