AETHER-3427 helm chart for sdcore-adapter v2.1

Change-Id: Iae3bb900cd888700dfd785cd142d78054e36a617
diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml
index bad32a5..7903f72 100644
--- a/aether-roc-umbrella/Chart.yaml
+++ b/aether-roc-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
 description: Aether ROC Umbrella chart to deploy all Aether ROC
 kubeVersion: ">=1.18.0"
 type: application
-version: 2.1.7
+version: 2.1.8
 appVersion: v0.0.0
 keywords:
   - aether
@@ -49,10 +49,10 @@
     condition: import.sdcore-adapter.v2.enabled
     repository: "file://../sdcore-adapter-v2"
     version: 2.1.1
-  - name: sdcore-adapter-v4
-    condition: import.sdcore-adapter.v4.enabled
-    repository: "file://../sdcore-adapter-v4"
-    version: 4.0.19
+  - name: sdcore-adapter-v2-1
+    condition: import.sdcore-adapter.v2-1.enabled
+    repository: "file://../sdcore-adapter-v2-1"
+    version: 2.1.1
   - name: subscriber-proxy
     condition: import.subscriber-proxy.enabled
     repository: "file://../subscriber-proxy"
diff --git a/aether-roc-umbrella/README.md b/aether-roc-umbrella/README.md
index 19ef73f..81e5a80 100644
--- a/aether-roc-umbrella/README.md
+++ b/aether-roc-umbrella/README.md
@@ -36,8 +36,17 @@
 The Aether ROC Umbrella chart controls the Config Model Plugins that are enabled in `onos-config`
 Currently 2 versions of the `Aether` model are loaded:
 
-* aether-2.1.0
-* aether-3.0.0
+* aether-2.0.x
+* aether-2.1.x
+
+## Configuring a default target
+For the 2.1.x models, you may need to set a default target when configuring sdcore-adapter, as onos-config
+does not supply the target at this time. Override the setting "defaultTarget". For example,
+
+```yaml
+sdcore-adapter-v2-1:
+  defaultTarget: acme
+```
 
 ## Deploy with Authentication enabled
 
diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml
index 9831f84..9839918 100644
--- a/aether-roc-umbrella/values.yaml
+++ b/aether-roc-umbrella/values.yaml
@@ -48,9 +48,9 @@
       enabled: false
   sdcore-adapter:
     v2:
-      enabled: true
-    v4:
       enabled: false
+    v2-1:
+      enabled: true
   subscriber-proxy:
     enabled: true
   sdcore-test-dummy:
@@ -143,9 +143,9 @@
   prometheusEnabled: false
   partialUpdateEnabled: true
 
-sdcore-adapter-v4:
+sdcore-adapter-v2-1:
   prometheusEnabled: false
-  partialUpdateEnabled: true
+  partialUpdateEnabled: true  
 
 # Subscriber Proxy
 subscriber-proxy:
diff --git a/sdcore-adapter-v4/.helmignore b/sdcore-adapter-v2-1/.helmignore
similarity index 100%
rename from sdcore-adapter-v4/.helmignore
rename to sdcore-adapter-v2-1/.helmignore
diff --git a/sdcore-adapter-v4/Chart.yaml b/sdcore-adapter-v2-1/Chart.yaml
similarity index 86%
rename from sdcore-adapter-v4/Chart.yaml
rename to sdcore-adapter-v2-1/Chart.yaml
index 1d64831..97bd670 100644
--- a/sdcore-adapter-v4/Chart.yaml
+++ b/sdcore-adapter-v2-1/Chart.yaml
@@ -3,11 +3,11 @@
 # SPDX-License-Identifier: Apache-2.0
 
 apiVersion: v2
-name: sdcore-adapter-v4
+name: sdcore-adapter-v2-1
 kubeVersion: ">=1.17.0"
 type: application
-version: 4.0.19
-appVersion: v4.0.0
+version: 2.1.1
+appVersion: v2.1.0
 description: Aether SD-Core Adapter
 keywords:
   - aether
diff --git a/sdcore-adapter-v4/README.md b/sdcore-adapter-v2-1/README.md
similarity index 100%
rename from sdcore-adapter-v4/README.md
rename to sdcore-adapter-v2-1/README.md
diff --git a/sdcore-adapter-v4/files/certs/README.md b/sdcore-adapter-v2-1/files/certs/README.md
similarity index 100%
rename from sdcore-adapter-v4/files/certs/README.md
rename to sdcore-adapter-v2-1/files/certs/README.md
diff --git a/sdcore-adapter-v4/files/certs/tls.cacert b/sdcore-adapter-v2-1/files/certs/tls.cacert
similarity index 100%
rename from sdcore-adapter-v4/files/certs/tls.cacert
rename to sdcore-adapter-v2-1/files/certs/tls.cacert
diff --git a/sdcore-adapter-v4/files/certs/tls.crt b/sdcore-adapter-v2-1/files/certs/tls.crt
similarity index 100%
rename from sdcore-adapter-v4/files/certs/tls.crt
rename to sdcore-adapter-v2-1/files/certs/tls.crt
diff --git a/sdcore-adapter-v4/files/certs/tls.key b/sdcore-adapter-v2-1/files/certs/tls.key
similarity index 100%
rename from sdcore-adapter-v4/files/certs/tls.key
rename to sdcore-adapter-v2-1/files/certs/tls.key
diff --git a/sdcore-adapter-v4/templates/_helpers.tpl b/sdcore-adapter-v2-1/templates/_helpers.tpl
similarity index 100%
rename from sdcore-adapter-v4/templates/_helpers.tpl
rename to sdcore-adapter-v2-1/templates/_helpers.tpl
diff --git a/sdcore-adapter-v2-1/templates/configmap.yaml b/sdcore-adapter-v2-1/templates/configmap.yaml
new file mode 100644
index 0000000..76c3800
--- /dev/null
+++ b/sdcore-adapter-v2-1/templates/configmap.yaml
@@ -0,0 +1,16 @@
+# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
+#
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ template "sdcore-adapter.fullname" . }}-logconfig
+  labels:
+    app: {{ template "sdcore-adapter.fullname" . }}
+    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+data:
+  logging.yaml: |-
+{{ toYaml .Values.logging | indent 4 }}
diff --git a/sdcore-adapter-v4/templates/deployment.yaml b/sdcore-adapter-v2-1/templates/deployment.yaml
similarity index 83%
rename from sdcore-adapter-v4/templates/deployment.yaml
rename to sdcore-adapter-v2-1/templates/deployment.yaml
index f74c8b1..e85f2e1 100644
--- a/sdcore-adapter-v4/templates/deployment.yaml
+++ b/sdcore-adapter-v2-1/templates/deployment.yaml
@@ -51,14 +51,8 @@
             - "-ca=/etc/sdcore-adapter/certs/tls.cacert"
             - "-alsologtostderr"
             - "-hostCheckDisabled"
-            {{ if .Values.initialConfig }}
-            - "-config={{ .Values.initialConfig }}"
-            {{ end }}
-            {{ if .Values.output }}
-            - "-output={{ .Values.output }}"
-            {{ end }}
-            {{ if .Values.spgwEndpoint }}
-            - "-spgw_endpoint={{ .Values.spgwEndpoint }}"
+            {{ if .Values.defaultTarget }}
+            - "-default_target={{ .Values.defaultTarget }}"
             {{ end }}
             {{ if not .Values.partialUpdateEnabled }}
             - "-partial_update_disable"
@@ -79,9 +73,6 @@
             initialDelaySeconds: 15
             periodSeconds: 20
           volumeMounts:
-            - name: targetconfig
-              mountPath: /etc/sdcore-adapter/configs
-              readOnly: true
             - name: secret
               mountPath: /etc/sdcore-adapter/certs
               readOnly: true              
@@ -91,10 +82,7 @@
       volumes:
         - name: logconfig
           configMap:
-            name: {{ template "sdcore-adapter.fullname" . }}-logconfig
-        - name: targetconfig
-          configMap:
-            name: {{ template "sdcore-adapter.fullname" . }}-targetconfig            
+            name: {{ template "sdcore-adapter.fullname" . }}-logconfig      
         - name: secret
           secret:
             secretName: {{ template "sdcore-adapter.fullname" . }}-secret
diff --git a/sdcore-adapter-v4/templates/secret.yaml b/sdcore-adapter-v2-1/templates/secret.yaml
similarity index 100%
rename from sdcore-adapter-v4/templates/secret.yaml
rename to sdcore-adapter-v2-1/templates/secret.yaml
diff --git a/sdcore-adapter-v4/templates/service.yaml b/sdcore-adapter-v2-1/templates/service.yaml
similarity index 100%
rename from sdcore-adapter-v4/templates/service.yaml
rename to sdcore-adapter-v2-1/templates/service.yaml
diff --git a/sdcore-adapter-v4/templates/servicemonitor.yaml b/sdcore-adapter-v2-1/templates/servicemonitor.yaml
similarity index 100%
rename from sdcore-adapter-v4/templates/servicemonitor.yaml
rename to sdcore-adapter-v2-1/templates/servicemonitor.yaml
diff --git a/sdcore-adapter-v4/values.yaml b/sdcore-adapter-v2-1/values.yaml
similarity index 87%
rename from sdcore-adapter-v4/values.yaml
rename to sdcore-adapter-v2-1/values.yaml
index 3e1b386..6428547 100644
--- a/sdcore-adapter-v4/values.yaml
+++ b/sdcore-adapter-v2-1/values.yaml
@@ -3,14 +3,14 @@
 # SPDX-License-Identifier: Apache-2.0
 
 nameOverride: ""
-fullnameOverride: "sdcore-adapter-v4"
+fullnameOverride: "sdcore-adapter-v2-1"
 
 replicaCount: 1
 annotations: {}
 
 image:
   repository: onosproject/sdcore-adapter
-  tag: v0.2.21
+  tag: v0.4.1
   pullPolicy: IfNotPresent
   pullSecrets: []
 
@@ -24,9 +24,6 @@
 
 partialUpdateEnabled: true
 secure: true
-initialConfig: ""
-output: ""
-spgwEndpoint: ""
 
 ports:
   gnmi:
diff --git a/sdcore-adapter-v4/files/configs/README.md b/sdcore-adapter-v4/files/configs/README.md
deleted file mode 100644
index 85a3e3c..0000000
--- a/sdcore-adapter-v4/files/configs/README.md
+++ /dev/null
@@ -1,10 +0,0 @@
-<!--
-SPDX-FileCopyrightText: 2021 Open Networking Foundation
-
-SPDX-License-Identifier: Apache-2.0
--->
-
-This folder contains test configurations that are loaded into the application
-via a `ConfigMap` when deploying via this Helm chart. The root test configurations
-are copied here because Helm does not allow files outside the chart to be accessed
-via templates. Changes to the root test configurations should be reflected here.
diff --git a/sdcore-adapter-v4/files/configs/empty_config.json b/sdcore-adapter-v4/files/configs/empty_config.json
deleted file mode 100644
index 2c63c08..0000000
--- a/sdcore-adapter-v4/files/configs/empty_config.json
+++ /dev/null
@@ -1,2 +0,0 @@
-{
-}
diff --git a/sdcore-adapter-v4/templates/configmap.yaml b/sdcore-adapter-v4/templates/configmap.yaml
deleted file mode 100644
index 2401af4..0000000
--- a/sdcore-adapter-v4/templates/configmap.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
-#
-# SPDX-License-Identifier: Apache-2.0
-
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ template "sdcore-adapter.fullname" . }}-targetconfig
-  labels:
-    app: {{ template "sdcore-adapter.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-data:
-  {{ $root := . }}
-  {{ range $path, $bytes := .Files.Glob "files/configs/*.json" }}
-  {{ base $path }}: '{{ $root.Files.Get $path }}'
-  {{ end }}
-
----
-
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: {{ template "sdcore-adapter.fullname" . }}-logconfig
-  labels:
-    app: {{ template "sdcore-adapter.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-data:
-  logging.yaml: |-
-{{ toYaml .Values.logging | indent 4 }}