fixing clusterIP service type errors

If you try and change the service type from a nodeport
to a cluster IP things break.  We never really exercise
this code path in testing but if you want to experiment
with a totally internal network environment you need to be
able to turn off node ports.

Issue-ID: OOM-1475

Change-Id: I1a0f4b0a4c390f3353e1611b6002b93e54bb5044
Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
diff --git a/kubernetes/aai/charts/aai-champ/values.yaml b/kubernetes/aai/charts/aai-champ/values.yaml
index 1cf9452..c247313 100644
--- a/kubernetes/aai/charts/aai-champ/values.yaml
+++ b/kubernetes/aai/charts/aai-champ/values.yaml
@@ -57,6 +57,7 @@
   type: NodePort
   portName: aai-champ
   internalPort: 9522
+  externalPort: 9522
   nodePort: 78
 
 ingress:
diff --git a/kubernetes/aai/charts/aai-gizmo/templates/NOTES.txt b/kubernetes/aai/charts/aai-gizmo/templates/NOTES.txt
index 1b36fa7..0def4ed 100644
--- a/kubernetes/aai/charts/aai-gizmo/templates/NOTES.txt
+++ b/kubernetes/aai/charts/aai-gizmo/templates/NOTES.txt
@@ -27,7 +27,7 @@
   export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "common.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
   echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
 {{- else if contains "ClusterIP" .Values.service.type }}
-  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "so.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
+  export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "common.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
   echo "Visit http://127.0.0.1:8080 to use your application"
   kubectl port-forward $POD_NAME 8080:{{ .Values.service.internalPort }}
 {{- end }}
diff --git a/kubernetes/aai/charts/aai-gizmo/values.yaml b/kubernetes/aai/charts/aai-gizmo/values.yaml
index ff2049b..7220cd5 100644
--- a/kubernetes/aai/charts/aai-gizmo/values.yaml
+++ b/kubernetes/aai/charts/aai-gizmo/values.yaml
@@ -54,6 +54,7 @@
   name: aai-crud-service
   portName: aai-crud-service
   internalPort: 9520
+  externalPort: 9520
   nodePort: 68
 
 ingress:
diff --git a/kubernetes/aai/templates/service.yaml b/kubernetes/aai/templates/service.yaml
index 29c13f9..91bdb2e 100644
--- a/kubernetes/aai/templates/service.yaml
+++ b/kubernetes/aai/templates/service.yaml
@@ -39,7 +39,7 @@
     name: {{ .Values.service.portName }}
   - port: {{ .Values.service.externalPort2 }}
     targetPort: {{ .Values.service.internalPort2 }}
-    name: {{ .Values.service.portName }}
+    name: {{ .Values.service.portName2 }}
   {{- end}}
   type: {{ .Values.service.type }}
   selector: