VOL-2493 - optionally support ofagent-go

Change-Id: I998669a16ae8bbea8c5c827206f34535c7b4850e
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
index 80a1cc7..37aa9b4 100644
--- a/voltha/Chart.yaml
+++ b/voltha/Chart.yaml
@@ -17,7 +17,7 @@
 description: A Helm chart for Voltha based on K8S resources in Voltha project
 icon: https://guide.opencord.org/logos/cord.svg
 
-version: 2.2.0
+version: 2.2.1
 
 # appVersion is 2 because this chart contains multiple 2.x images that may have
 # different individual image versions.
diff --git a/voltha/templates/ofagent.yaml b/voltha/templates/ofagent-go.yaml
similarity index 90%
copy from voltha/templates/ofagent.yaml
copy to voltha/templates/ofagent-go.yaml
index 3f46deb..b92ad81 100644
--- a/voltha/templates/ofagent.yaml
+++ b/voltha/templates/ofagent-go.yaml
@@ -1,4 +1,5 @@
-# Copyright 2019-present Open Networking Foundation
+{{- if and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go }}
+# Copyright 2020-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -11,7 +12,6 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
 ---
 apiVersion: apps/v1beta1
 kind: Deployment
@@ -66,10 +66,10 @@
         - name: CONTROLLER_SERVICE
           value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
         args:
-        - "/ofagent/ofagent/main.py"
-        - "-v"
+        - "/app/ofagent"
+        - "--loglevel={{- tpl .Values.ofagent.log_level . | upper }}"
         - "--controller=$(CONTROLLER_SERVICE)"
-        - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
+        - "--voltha=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
         - "--probe=:8080"
         livenessProbe:
           httpGet:
@@ -83,3 +83,4 @@
             port: 8080
           initialDelaySeconds: 10
           periodSeconds: 5
+{{- end }}
diff --git a/voltha/templates/ofagent.yaml b/voltha/templates/ofagent-py.yaml
similarity index 96%
rename from voltha/templates/ofagent.yaml
rename to voltha/templates/ofagent-py.yaml
index 3f46deb..dcde907 100644
--- a/voltha/templates/ofagent.yaml
+++ b/voltha/templates/ofagent-py.yaml
@@ -1,3 +1,4 @@
+{{- if not (and (hasKey .Values "use_ofagent_go") .Values.use_ofagent_go) }}
 # Copyright 2019-present Open Networking Foundation
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -83,3 +84,4 @@
             port: 8080
           initialDelaySeconds: 10
           periodSeconds: 5
+{{- end }}
diff --git a/voltha/values.yaml b/voltha/values.yaml
index bea3bb3..979119f 100644
--- a/voltha/values.yaml
+++ b/voltha/values.yaml
@@ -16,6 +16,7 @@
 serviceaccount: voltha-serviceaccount
 private_etcd_cluster: true
 private_kafka_cluster: true
+use_ofagent_go: false
 
 # Default Values
 # The following are the default values used for every container in the
@@ -79,6 +80,9 @@
   timeout_long_request: '{{ .Values.defaults.rw_core.timeout }}'
   timeout_request: '{{ .Values.defaults.rw_core.timeout }}'
 
+ofagent:
+  log_level: '{{ .Values.default.log_level }}'
+
 
 # Define Docker images to be used
 images: