Add git information during build
This commit is contained in:
parent
cf263c1390
commit
49c3af2c17
11 changed files with 48 additions and 67 deletions
|
|
@ -60,7 +60,7 @@ type loadBalancerController struct {
|
|||
svcLister cache.StoreToServiceLister
|
||||
endpLister cache.StoreToEndpointsLister
|
||||
nginx *nginx.Manager
|
||||
lbInfo *lbInfo
|
||||
podInfo *podInfo
|
||||
defaultSvc string
|
||||
nxgConfigMap string
|
||||
tcpConfigMap string
|
||||
|
|
@ -84,7 +84,7 @@ type loadBalancerController struct {
|
|||
|
||||
// newLoadBalancerController creates a controller for nginx loadbalancer
|
||||
func newLoadBalancerController(kubeClient *client.Client, resyncPeriod time.Duration, defaultSvc,
|
||||
namespace, nxgConfigMapName, tcpConfigMapName, udpConfigMapName string, lbRuntimeInfo *lbInfo) (*loadBalancerController, error) {
|
||||
namespace, nxgConfigMapName, tcpConfigMapName, udpConfigMapName string, runtimeInfo *podInfo) (*loadBalancerController, error) {
|
||||
|
||||
eventBroadcaster := record.NewBroadcaster()
|
||||
eventBroadcaster.StartLogging(glog.Infof)
|
||||
|
|
@ -93,7 +93,7 @@ func newLoadBalancerController(kubeClient *client.Client, resyncPeriod time.Dura
|
|||
lbc := loadBalancerController{
|
||||
client: kubeClient,
|
||||
stopCh: make(chan struct{}),
|
||||
lbInfo: lbRuntimeInfo,
|
||||
podInfo: runtimeInfo,
|
||||
nginx: nginx.NewManager(kubeClient),
|
||||
nxgConfigMap: nxgConfigMapName,
|
||||
tcpConfigMap: tcpConfigMapName,
|
||||
|
|
@ -271,22 +271,22 @@ func (lbc *loadBalancerController) updateIngressStatus(key string) {
|
|||
|
||||
lbIPs := ing.Status.LoadBalancer.Ingress
|
||||
if !lbc.isStatusIPDefined(lbIPs) {
|
||||
glog.Infof("Updating loadbalancer %v/%v with IP %v", ing.Namespace, ing.Name, lbc.lbInfo.Address)
|
||||
glog.Infof("Updating loadbalancer %v/%v with IP %v", ing.Namespace, ing.Name, lbc.podInfo.NodeIP)
|
||||
currIng.Status.LoadBalancer.Ingress = append(currIng.Status.LoadBalancer.Ingress, api.LoadBalancerIngress{
|
||||
IP: lbc.lbInfo.Address,
|
||||
IP: lbc.podInfo.NodeIP,
|
||||
})
|
||||
if _, err := ingClient.UpdateStatus(currIng); err != nil {
|
||||
lbc.recorder.Eventf(currIng, api.EventTypeWarning, "UPDATE", "error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
lbc.recorder.Eventf(currIng, api.EventTypeNormal, "CREATE", "ip: %v", lbc.lbInfo.Address)
|
||||
lbc.recorder.Eventf(currIng, api.EventTypeNormal, "CREATE", "ip: %v", lbc.podInfo.NodeIP)
|
||||
}
|
||||
}
|
||||
|
||||
func (lbc *loadBalancerController) isStatusIPDefined(lbings []api.LoadBalancerIngress) bool {
|
||||
for _, lbing := range lbings {
|
||||
if lbing.IP == lbc.lbInfo.Address {
|
||||
if lbing.IP == lbc.podInfo.NodeIP {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
@ -442,7 +442,7 @@ func (lbc *loadBalancerController) getUpstreamServers(data []interface{}) ([]*ng
|
|||
// default server - no servername.
|
||||
servers[defServerName] = &nginx.Server{
|
||||
Name: defServerName,
|
||||
Locations: []*nginx.Location{&nginx.Location{
|
||||
Locations: []*nginx.Location{{
|
||||
Path: "/",
|
||||
Upstream: *lbc.getDefaultUpstream(),
|
||||
},
|
||||
|
|
@ -718,10 +718,10 @@ func (lbc *loadBalancerController) removeFromIngress() {
|
|||
|
||||
lbIPs := ing.Status.LoadBalancer.Ingress
|
||||
if len(lbIPs) > 0 && lbc.isStatusIPDefined(lbIPs) {
|
||||
glog.Infof("Updating loadbalancer %v/%v. Removing IP %v", ing.Namespace, ing.Name, lbc.lbInfo.Address)
|
||||
glog.Infof("Updating loadbalancer %v/%v. Removing IP %v", ing.Namespace, ing.Name, lbc.podInfo.NodeIP)
|
||||
|
||||
for idx, lbStatus := range currIng.Status.LoadBalancer.Ingress {
|
||||
if lbStatus.IP == lbc.lbInfo.Address {
|
||||
if lbStatus.IP == lbc.podInfo.NodeIP {
|
||||
currIng.Status.LoadBalancer.Ingress = append(currIng.Status.LoadBalancer.Ingress[:idx],
|
||||
currIng.Status.LoadBalancer.Ingress[idx+1:]...)
|
||||
break
|
||||
|
|
@ -733,7 +733,7 @@ func (lbc *loadBalancerController) removeFromIngress() {
|
|||
continue
|
||||
}
|
||||
|
||||
lbc.recorder.Eventf(currIng, api.EventTypeNormal, "DELETE", "ip: %v", lbc.lbInfo.Address)
|
||||
lbc.recorder.Eventf(currIng, api.EventTypeNormal, "DELETE", "ip: %v", lbc.podInfo.NodeIP)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue