Commit 8c744767 authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

default locality fix + loc-serv service instance chart updates

parent 2ff5c378
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
{{- if .Values.ingress.enabled -}}
{{- $serviceName := .Values.service.name -}}
{{- $serviceName := include "meep-loc-serv.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $path := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
+1 −1
Original line number Diff line number Diff line
apiVersion: v1
kind: Service
metadata:
  name: {{ .Values.service.name }}
  name: {{ template "meep-loc-serv.fullname" . }}
  labels:
    app: {{ template "meep-loc-serv.name" . }}
    chart: {{ template "meep-loc-serv.chart" . }}
+0 −5
Original line number Diff line number Diff line
@@ -28,11 +28,6 @@ image:
    {{- end}}

service:
  {{- if .IsMepService }}
  name: meep-loc-serv-{{.MepName}}
  {{- else }}
  name: meep-loc-serv
  {{- end }}
  type: ClusterIP
  port: 80

+15 −5
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ type SbiCfg struct {

type LocServSbi struct {
	sandboxName             string
	localityEnabled         bool
	locality                map[string]bool
	mqLocal                 *mq.MsgQueue
	handlerId               int
@@ -73,10 +74,15 @@ func Init(cfg SbiCfg) (err error) {
	sbi.cleanUpCB = cfg.CleanUpCb

	// Fill locality map
	if len(cfg.Locality) > 0 {
		sbi.locality = make(map[string]bool)
		for _, locality := range cfg.Locality {
			sbi.locality[locality] = true
		}
		sbi.localityEnabled = true
	} else {
		sbi.localityEnabled = false
	}

	// Create message queue
	sbi.mqLocal, err = mq.NewMsgQueue(mq.GetLocalName(sbi.sandboxName), moduleName, sbi.sandboxName, cfg.RedisAddr)
@@ -404,6 +410,10 @@ func isUeConnected(name string) bool {
}

func isInLocality(zone string) bool {
	_, found := sbi.locality[zone]
	return found
	if sbi.localityEnabled {
		if _, found := sbi.locality[zone]; !found {
			return false
		}
	}
	return true
}